*{
    box-sizing:border-box;
}

html,
body{
    width:100%;
    height:100%;
    margin:0;
    overflow:hidden;
    font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
    background:#000;
    color:#fff;
}

button,
input{
    font:inherit;
}

button{
    -webkit-tap-highlight-color:transparent;
}

[hidden]{
    display:none!important;
}

.memory-detail-page{
    position:relative;
    width:100%;
    max-width:430px;
    height:100vh;
    margin:0 auto;
    overflow:hidden;
    background:#000;
}


/* 顶部 */

.top-bar{
    position:absolute;
    top:0;
    left:0;
    right:0;
    z-index:40;
    height:calc(74px + env(safe-area-inset-top));
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    padding:env(safe-area-inset-top) 14px 12px;
    background:linear-gradient(to bottom,rgba(0,0,0,.9),transparent);
}

.back-button{
    position:relative;
    width:44px;
    height:44px;
    padding:0;
    border:0;
    background:transparent;
}

.back-button span{
    position:absolute;
    left:14px;
    top:11px;
    width:22px;
    height:22px;
    border-left:3px solid #fff;
    border-bottom:3px solid #fff;
    transform:rotate(45deg);
}

.top-actions{
    height:46px;
    display:flex;
    align-items:center;
    padding:0 7px;
    border:1px solid rgba(255,255,255,.18);
    border-radius:24px;
    background:rgba(255,255,255,.68);
    color:#111;
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
}

.top-actions button{
    width:49px;
    height:42px;
    padding:0;
    border:0;
    background:transparent;
    color:#111;
}

.top-divider{
    width:1px;
    height:27px;
    background:rgba(0,0,0,.16);
}

.more-button{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:4px;
}

.more-button i{
    width:6px;
    height:6px;
    border-radius:50%;
    background:#111;
}

.minimize-button{
    position:relative;
}

.minimize-button span{
    position:absolute;
    left:13px;
    top:20px;
    width:25px;
    height:4px;
    border-radius:3px;
    background:#111;
}

.close-button{
    display:flex;
    align-items:center;
    justify-content:center;
}

.close-button span{
    position:relative;
    width:29px;
    height:29px;
    border:4px solid #111;
    border-radius:50%;
}

.close-button span::after{
    content:"";
    position:absolute;
    left:50%;
    top:50%;
    width:9px;
    height:9px;
    border-radius:50%;
    background:#111;
    transform:translate(-50%,-50%);
}


/* 图片 */

.photo-viewer{
    position:absolute;
    inset:0;
    overflow:hidden;
    touch-action:pan-y;
    background:#000;
}

.photo-track{
    display:flex;
    width:100%;
    height:100%;
    transition:transform .38s cubic-bezier(.22,.61,.36,1);
}

.photo-slide{
    position:relative;
    flex:0 0 100%;
    width:100%;
    height:100%;
}

.photo-slide img{
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
    object-position:center;
    user-select:none;
    -webkit-user-drag:none;
}

.photo-slide::after{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(
        to bottom,
        rgba(0,0,0,.08) 0%,
        transparent 45%,
        rgba(0,0,0,.12) 63%,
        #000 100%
    );
    pointer-events:none;
}

.photo-dots{
    position:absolute;
    top:calc(85px + env(safe-area-inset-top));
    left:50%;
    z-index:41;
    display:flex;
    gap:7px;
    transform:translateX(-50%);
}

.photo-dot{
    width:6px;
    height:6px;
    padding:0;
    border:0;
    border-radius:4px;
    background:rgba(255,255,255,.42);
    transition:.2s;
}

.photo-dot.is-active{
    width:20px;
    background:#fff;
}


/* 底部内容 */

.content-panel{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    z-index:25;
    min-height:340px;
    pointer-events:none;
}

.content-gradient{
    position:absolute;
    inset:-180px 0 0;
    background:linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0,0,0,.34) 22%,
        rgba(0,0,0,.86) 56%,
        #000 100%
    );
}

.content-inner{
    position:relative;
    z-index:2;
    padding:20px 14px calc(27px + env(safe-area-inset-bottom));
    pointer-events:auto;
}

.title-action-row{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:12px;
}

.title-block{
    min-width:0;
}

.memory-label{
    display:block;
    margin-bottom:7px;
    color:#36d3cf;
    font-size:9px;
    letter-spacing:1px;
}

.title-block h1{
    margin:0;
    font-size:29px;
    line-height:1.25;
}

.photo-counter{
    margin-top:10px;
    color:#ddd;
    font-size:14px;
}

.action-buttons{
    flex:0 0 auto;
    display:flex;
    gap:10px;
}

.action-button{
    min-width:42px;
    display:flex;
    flex-direction:column;
    align-items:center;
    padding:0;
    border:0;
    background:transparent;
    color:#fff;
}

.action-icon{
    height:25px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:23px;
}

.comment-icon{
    font-size:18px;
}

.action-button strong{
    margin-top:4px;
    font-size:10px;
    font-weight:500;
}

.action-button small{
    margin-top:2px;
    color:#aaa;
    font-size:9px;
}

.action-button.is-active .action-icon{
    color:#ff6d6d;
}

.action-button.is-collected .action-icon{
    color:#ffd45e;
}

.source-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    margin-top:22px;
    color:#aaa;
    font-size:11px;
}

.source-row strong{
    color:#fff;
    font-size:14px;
}

.description{
    margin:17px 0 0;
    color:#eee;
    font-size:14px;
    line-height:1.72;
    text-align:justify;
}

.meta-tags{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin-top:14px;
}

.meta-tags span{
    padding:6px 9px;
    border:1px solid rgba(255,255,255,.16);
    border-radius:8px;
    background:rgba(255,255,255,.08);
    color:#ccc;
    font-size:10px;
}

.navigation-button{
    height:45px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    margin:20px auto 0;
    padding:0 23px;
    border:1px solid rgba(255,255,255,.76);
    border-radius:23px;
    background:rgba(255,255,255,.08);
    color:#fff;
    font-size:14px;
}


/* 遮罩和弹层 */

.sheet-mask{
    position:absolute;
    inset:0;
    z-index:60;
    background:rgba(0,0,0,.66);
    backdrop-filter:blur(3px);
    -webkit-backdrop-filter:blur(3px);
}

.comment-sheet,
.more-sheet{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    z-index:70;
    padding:9px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius:28px 28px 0 0;
    background:#171717;
    animation:sheet-enter .28s ease;
}

@keyframes sheet-enter{
    from{
        transform:translateY(100%);
    }
}

.comment-sheet{
    max-height:72vh;
    display:flex;
    flex-direction:column;
}

.sheet-handle{
    width:43px;
    height:4px;
    margin:0 auto 17px;
    border-radius:3px;
    background:#555;
}

.comment-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    margin-bottom:15px;
}

.comment-header>div>span{
    color:#24c9c5;
    font-size:9px;
    letter-spacing:1px;
}

.comment-header h2{
    margin:5px 0 0;
    font-size:22px;
}

.comment-header h2 small{
    color:#888;
    font-size:12px;
}

.comment-header button{
    width:38px;
    height:38px;
    padding:0;
    border:0;
    border-radius:50%;
    background:#292929;
    color:#fff;
    font-size:23px;
}

.comment-list{
    flex:1;
    overflow-y:auto;
    scrollbar-width:none;
}

.comment-list::-webkit-scrollbar{
    display:none;
}

.comment-item{
    display:grid;
    grid-template-columns:40px minmax(0,1fr);
    gap:11px;
    padding:14px 0;
    border-bottom:1px solid #2c2c2c;
}

.comment-avatar{
    width:40px;
    height:40px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:#214e4d;
    color:#4ed6d2;
    font-size:13px;
    font-weight:700;
}

.comment-content>div:first-child{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}

.comment-content strong{
    font-size:13px;
}

.comment-content>div:first-child span{
    color:#777;
    font-size:9px;
}

.comment-content p{
    margin:8px 0 0;
    color:#ccc;
    font-size:12px;
    line-height:1.62;
}

.comment-like{
    margin-top:8px;
    padding:0;
    border:0;
    background:transparent;
    color:#888;
    font-size:10px;
}

.comment-like.is-liked{
    color:#ff7474;
}

.comment-form{
    display:grid;
    grid-template-columns:minmax(0,1fr) 60px;
    gap:9px;
    padding-top:13px;
}

.comment-form input{
    width:100%;
    height:43px;
    padding:0 14px;
    border:1px solid #333;
    border-radius:22px;
    outline:none;
    background:#242424;
    color:#fff;
    font-size:12px;
}

.comment-form button{
    border:0;
    border-radius:22px;
    background:#28aaa6;
    color:#fff;
    font-size:12px;
}

.more-sheet h2{
    margin:0 0 15px;
    font-size:20px;
}

.more-sheet>button{
    width:100%;
    min-height:55px;
    display:flex;
    align-items:center;
    gap:14px;
    padding:0 15px;
    border:0;
    border-bottom:1px solid #303030;
    background:transparent;
    color:#fff;
    text-align:left;
}

.more-sheet>button span{
    width:30px;
    color:#25cbc7;
    font-size:21px;
    text-align:center;
}

.more-sheet .cancel-button{
    justify-content:center;
    margin-top:10px;
    border:0;
    border-radius:14px;
    background:#2c2c2c;
    text-align:center;
}


/* Toast */

.toast{
    position:fixed;
    left:50%;
    bottom:calc(35px + env(safe-area-inset-bottom));
    z-index:100;
    max-width:330px;
    padding:11px 18px;
    border-radius:22px;
    background:rgba(44,44,44,.96);
    color:#fff;
    font-size:13px;
    text-align:center;
    opacity:0;
    pointer-events:none;
    transform:translate(-50%,18px);
    transition:.23s;
}

.toast.is-visible{
    opacity:1;
    transform:translate(-50%,0);
}


/* 小屏 */

@media(max-height:760px){
    .content-panel{
        min-height:300px;
    }

    .description{
        margin-top:13px;
        font-size:12px;
        line-height:1.58;
    }

    .meta-tags{
        display:none;
    }

    .navigation-button{
        margin-top:14px;
    }
}

@media(max-width:360px){
    .title-block h1{
        font-size:26px;
    }

    .action-buttons{
        gap:7px;
    }

    .action-button{
        min-width:38px;
    }
}

@media(prefers-reduced-motion:reduce){
    *,
    *::before,
    *::after{
        animation-duration:.01ms!important;
        transition-duration:.01ms!important;
    }
}
