html, body { height: 100%; }

:root{
    --primary:#165DFF;
    --text:#0f172a;
    --muted:rgba(15,23,42,.62);
    --border:rgba(148,163,184,.22);
    --shadow:0 14px 40px rgba(15,23,42,.08);
    --shadow-soft:0 10px 26px rgba(15,23,42,.06);
}

body{
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    color:var(--text);
    background:
        radial-gradient(1200px 700px at 12% 8%, rgba(22,93,255,.14), rgba(255,255,255,0) 58%),
        radial-gradient(900px 560px at 88% 0%, rgba(79,70,229,.12), rgba(255,255,255,0) 62%),
        radial-gradient(1100px 760px at 50% 100%, rgba(16,185,129,.08), rgba(255,255,255,0) 55%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 55%, #f1f5f9 100%);
    min-height:100vh;
}

.page{
    width:min(980px, calc(100% - 32px));
    margin:0 auto;
    padding:28px 0 40px;
}

.site-header{
    padding:10px 6px 18px;
    text-align:center;
}

.site-title{
    margin:0;
    font-size:28px;
    font-weight:700;
    letter-spacing:-.02em;
    background:linear-gradient(90deg, var(--primary), #4f46e5);
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
}

.site-subtitle{
    margin:8px 0 0;
    font-size:14px;
    color:var(--muted);
}

.card{
    background:rgba(255,255,255,.86);
    border:1px solid var(--border);
    border-radius:20px;
    box-shadow:var(--shadow);
    backdrop-filter:blur(10px);
    padding:18px;
}

.notice{
    border:1px solid rgba(148,163,184,.32);
    background:rgba(255,255,255,.78);
    border-radius:16px;
    padding:14px 16px;
    box-shadow:var(--shadow-soft);
    overflow:hidden;
    margin-bottom:16px;
}

.notice-content{
    font-size:13px;
    line-height:1.7;
    word-break:break-word;
    overflow-wrap:anywhere;
}

.notice-content p{
    margin:8px 0;
    font-weight:700;
    color:#b45309;
}

.toolbar{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    flex-wrap:wrap;
    padding:6px 2px 10px;
}

.breadcrumb{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:6px;
    font-size:13px;
    color:var(--muted);
}

.breadcrumb a{
    color:var(--primary);
    text-decoration:none;
}

.breadcrumb a:hover{ text-decoration:underline; }
.breadcrumb span{ color:rgba(15,23,42,.35); }
.breadcrumb-back{ color:rgba(15,23,42,.75) !important; }

.meta-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:2px 2px 14px;
    border-bottom:1px solid rgba(148,163,184,.18);
    margin-bottom:12px;
}

.meta-count{
    font-size:12px;
    color:rgba(15,23,42,.6);
}

.meta-chip{
    display:flex;
    align-items:center;
    gap:8px;
    border:1px solid rgba(148,163,184,.35);
    background:rgba(255,255,255,.65);
    border-radius:999px;
    padding:6px 10px;
    font-size:12px;
    color:rgba(15,23,42,.7);
    box-shadow:0 6px 16px rgba(15,23,42,.05);
}

.meta-chip .dot{
    width:7px;
    height:7px;
    border-radius:999px;
    background:#10b981;
}

.section{ margin-top:14px; }
.section:first-of-type{ margin-top:0; }

.section-head{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:10px;
    padding:4px 2px 10px;
}

.section-title{
    font-size:13px;
    font-weight:800;
    letter-spacing:.02em;
    color:rgba(15,23,42,.78);
}

.section-sub{
    font-size:12px;
    color:rgba(15,23,42,.5);
}

.section-body{
    border-radius:18px;
    border:1px solid rgba(148,163,184,.22);
    background:rgba(248,250,252,.65);
    padding:12px;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.65);
}

.list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

#folderList.list{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
    gap:12px;
    margin-bottom:14px;
}

#fileList.list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px 12px;
    border-radius:16px;
    border:1px solid transparent;
    background:rgba(255,255,255,.75);
    text-decoration:none;
    color:inherit;
    transition:transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.row:hover{
    transform:translateY(-1px);
    background:rgba(255,255,255,.95);
    border-color:rgba(148,163,184,.35);
}

.row-main{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
    flex:1;
}

.row-icon{
    width:28px;
    height:28px;
    object-fit:contain;
    flex:0 0 auto;
}

.row-title{
    min-width:0;
    max-width:100%;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:14px;
    color:rgba(15,23,42,.92);
}

a.row-title:hover{
    color:var(--primary);
    text-decoration:underline;
}

.row-meta{
    flex:0 0 auto;
    font-size:12px;
    color:rgba(15,23,42,.55);
    white-space:nowrap;
}

.row-file{
    display:grid;
    grid-template-columns:minmax(0,1fr) 128px auto;
    align-items:center;
}

.row-file .row-meta{ justify-self:end; }
.row-file .btn{ justify-self:end; }

.btn{
    flex:0 0 auto;
    display:inline-flex;
    align-items:center;
    gap:8px;
    border-radius:14px;
    border:1px solid rgba(22,93,255,.22);
    background:linear-gradient(180deg, rgba(22,93,255,.98), rgba(22,93,255,.88));
    color:#fff;
    padding:9px 12px;
    text-decoration:none;
    font-size:13px;
    box-shadow:0 10px 24px rgba(22,93,255,.22);
    transition:transform 160ms ease, filter 160ms ease;
}

.btn:hover{ filter:brightness(1.05); transform:translateY(-1px); }
.btn:active{ transform:translateY(0); }

.empty{
    text-align:center;
    padding:26px 8px;
    color:rgba(15,23,42,.6);
}

.empty-icon{
    width:52px;
    height:52px;
    border-radius:18px;
    margin:0 auto 10px;
    border:1px solid rgba(148,163,184,.35);
    background:rgba(255,255,255,.6);
    box-shadow:0 8px 20px rgba(15,23,42,.06);
    display:grid;
    place-items:center;
    color:rgba(15,23,42,.6);
    font-size:20px;
}

.empty-text{ font-size:13px; }

.footer{
    text-align:center;
    margin-top:18px;
    font-size:12px;
    color:rgba(15,23,42,.6);
}

.noscript-tip{
    margin:16px 0;
    border-radius:14px;
    border:1px solid rgba(245,158,11,.25);
    background:rgba(245,158,11,.12);
    color:rgba(146,64,14,.95);
    padding:12px 14px;
    font-size:13px;
}

.admin-btn-wrap{
    position:fixed;
    right:16px;
    bottom:16px;
    z-index:20;
}

.admin-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:14px;
    background:rgba(15,23,42,.92);
    color:#fff;
    text-decoration:none;
    padding:10px 14px;
    font-size:13px;
    box-shadow:0 16px 40px rgba(15,23,42,.22);
    transition:transform 160ms ease, filter 160ms ease;
}

.admin-btn:hover{ filter:brightness(1.05); transform:translateY(-1px); }
.admin-btn:active{ transform:translateY(0); }

.splash-screen{
    position:fixed;
    inset:0;
    z-index:50;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:linear-gradient(135deg, rgba(2,6,23,.78) 0%, rgba(30,41,59,.68) 45%, rgba(15,23,42,.78) 100%);
}

.splash-inner{ text-align:center; }

.splash-logo{
    width:220px;
    height:220px;
    object-fit:contain;
    display:block;
    margin:0 auto;
    animation:splashPulse 2s ease-in-out infinite, splashGlow 2s ease-in-out infinite;
}

.splash-text{
    margin-top:18px;
    font-size:18px;
    font-weight:300;
    color:rgba(255,255,255,.9);
    animation:splashFadeIn .9s ease-out .2s both;
}

@keyframes splashPulse{ 0%,100%{ transform:scale(1); opacity:.86 } 50%{ transform:scale(1.06); opacity:1 } }
@keyframes splashGlow{ 0%,100%{ filter:drop-shadow(0 0 14px rgba(255,255,255,.18)) } 50%{ filter:drop-shadow(0 0 34px rgba(255,255,255,.5)) drop-shadow(0 0 60px rgba(22,93,255,.35)) } }
@keyframes splashFadeIn{ from{ opacity:0; transform:translateY(6px) } to{ opacity:1; transform:translateY(0) } }

@media (max-width:768px){
    .admin-btn-wrap{ display:none !important; }
    .page{ width:calc(100% - 14px); padding:16px 0 28px; }
    .site-header{ padding:6px 4px 12px; }
    .site-title{ font-size:22px; }
    .site-subtitle{ font-size:13px; margin-top:6px; }
    .card{ padding:14px; border-radius:18px; }
    .notice{ padding:12px 12px; border-radius:14px; margin-bottom:12px; }
    .notice-content{ font-size:12px; line-height:1.65; }
    .notice-content p{ margin:6px 0; }
    .meta-chip{ display:none; }

    #folderList.list{ grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
    #folderList .row{ flex-direction:column; align-items:stretch; gap:10px; padding:12px 12px; border-radius:14px; }
    #folderList .row-main{ width:100%; align-items:flex-start; }
    #folderList .row-title{ white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
    #folderList .row-meta{ display:block; align-self:flex-end; font-size:11px; color:rgba(15,23,42,.5); }

    .row-file{ grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; row-gap:6px; }
    .row-file .row-main{ grid-column:1 / 2; grid-row:1 / 2; }
    .row-file .row-meta{ display:block; grid-column:1 / 2; grid-row:2 / 3; justify-self:start; font-size:11px; color:rgba(15,23,42,.5); }
    .row-file .btn{ grid-column:2 / 3; grid-row:1 / 3; align-self:center; }

    .btn span{ display:none; }
    .btn{ padding:9px 10px; }
    .splash-logo{ width:190px; height:190px; }
}

@media (prefers-reduced-motion: reduce){
    .row, .btn, .admin-btn, #splashScreen{ transition:none !important; }
    .row:hover, .btn:hover, .admin-btn:hover{ transform:none !important; }
    .splash-logo, .splash-text{ animation:none !important; }
}

.detail-wrap .toolbar {
    padding-top: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 14px;
}

.detail-main, .detail-side {
    min-width: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    margin: 2px 0 12px;
}

.back-link:hover {
    text-decoration: underline;
}

.detail-hero {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,.22);
    background: rgba(255,255,255,.78);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.detail-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(148,163,184,.22);
    background: rgba(248,250,252,.72);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.detail-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex: 0 0 auto;
}

.detail-head {
    min-width: 0;
    flex: 1;
}

.detail-name {
    font-size: 15px;
    font-weight: 800;
    color: rgba(15,23,42,.92);
    line-height: 1.35;
    word-break: break-word;
}

.detail-meta-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.meta-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid rgba(148,163,184,.18);
    background: rgba(255,255,255,.68);
}

.meta-label {
    font-size: 12px;
    color: rgba(15,23,42,.55);
    white-space: nowrap;
}

.meta-value {
    font-size: 12px;
    color: rgba(15,23,42,.86);
    min-width: 0;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 6px;
}

.btn.btn-primary {
    border: 1px solid rgba(22,93,255,.22);
    background: linear-gradient(180deg, rgba(22,93,255,.98), rgba(22,93,255,.88));
    color: #fff;
}

.btn.btn-ghost {
    border: 1px solid rgba(22,93,255,.22);
    background: rgba(255,255,255,.7);
    color: var(--primary);
    box-shadow: 0 8px 18px rgba(15,23,42,.06);
}

.btn.btn-ghost:hover {
    filter: none;
    background: rgba(255,255,255,.9);
}

.detail-desc {
    font-size: 13px;
    line-height: 1.8;
    color: rgba(15,23,42,.86);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.shots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.shot {
    border: 1px solid rgba(148,163,184,.22);
    background: rgba(255,255,255,.65);
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

.shot img {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
    transition: transform 160ms ease;
}

.shot:hover img {
    transform: scale(1.03);
}

.related {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid rgba(148,163,184,.2);
    background: rgba(255,255,255,.7);
    text-decoration: none;
    color: inherit;
    transition: background 160ms ease, border-color 160ms ease;
}

.related-item:hover {
    background: rgba(255,255,255,.92);
    border-color: rgba(148,163,184,.32);
}

.related-name {
    min-width: 0;
    flex: 1;
    font-size: 13px;
    color: rgba(15,23,42,.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-meta {
    flex: 0 0 auto;
    font-size: 11px;
    color: rgba(15,23,42,.55);
    white-space: nowrap;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.86);
    padding: 18px;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-img {
    max-width: min(980px, 92vw);
    max-height: 86vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 14px;
    right: 16px;
    color: #fff;
    background: rgba(0,0,0,.2);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 22px;
    line-height: 38px;
}

.lightbox-counter {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.9);
    font-size: 12px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.95);
    background: rgba(0,0,0,.2);
    border: 1px solid rgba(255,255,255,.18);
    width: 52px;
    height: 52px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 32px;
    line-height: 48px;
    user-select: none;
}

.lightbox-prev { left: 14px; }
.lightbox-next { right: 14px; }

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .detail-hero {
        flex-direction: row;
        align-items: flex-start;
        padding: 14px 12px;
    }
    .detail-icon-wrap {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }
    .detail-icon {
        width: 24px;
        height: 24px;
    }
    .detail-name {
        font-size: 14px;
    }
    .detail-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
    }
    .detail-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .detail-actions .btn {
        flex: 1 1 0;
        min-width: 140px;
        justify-content: center;
    }
    .detail-wrap .btn span {
        display: inline;
    }
    .shots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .related-meta {
        display: none;
    }
}

@media (max-width: 380px) {
    .detail-meta-grid {
        grid-template-columns: 1fr;
    }
    .detail-actions .btn {
        min-width: 0;
        flex: 1 1 100%;
    }
}

/* 跳转链接行 */
#linkList.list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.row-link{
    display:grid;
    grid-template-columns:minmax(0,1fr) 128px auto;
    align-items:center;
}

.row-link .row-meta{ justify-self:end; }
.row-link .btn{ justify-self:end; }

.link-icon-wrap{
    flex:0 0 auto;
    width:28px;
    height:28px;
    display:inline-grid;
    place-items:center;
    border-radius:10px;
    border:1px solid rgba(22,93,255,.22);
    background:linear-gradient(180deg, rgba(22,93,255,.12), rgba(79,70,229,.08));
    color:var(--primary);
    font-size:13px;
}

.btn-link-go{
    background:linear-gradient(180deg, rgba(79,70,229,.98), rgba(67,56,202,.92));
    border-color:rgba(79,70,229,.3);
    box-shadow:0 10px 24px rgba(79,70,229,.22);
}

/* 加密目录标识 */
.folder-lock{
    margin-left:6px;
    color:#f59e0b;
    font-size:12px;
    vertical-align:middle;
}

.row-locked .row-title{ color:rgba(15,23,42,.85); }

@media (max-width:768px){
    .row-link{
        grid-template-columns:minmax(0,1fr) auto;
        grid-template-rows:auto auto;
        row-gap:6px;
    }
    .row-link .row-main{ grid-column:1 / 2; grid-row:1 / 2; }
    .row-link .row-meta{
        display:block;
        grid-column:1 / 2;
        grid-row:2 / 3;
        justify-self:start;
        font-size:11px;
        color:rgba(15,23,42,.5);
    }
    .row-link .btn{
        grid-column:2 / 3;
        grid-row:1 / 3;
        align-self:center;
    }
    .row-link .btn span{ display:none; }
    .row-link .btn{ padding:9px 10px; }
}

/* 文件夹密码解锁页 */
.unlock-card{
    max-width:440px;
    margin:24px auto 0;
}

.unlock-inner{
    display:flex;
    flex-direction:column;
    align-items:center;
    text-align:center;
    gap:8px;
}

.unlock-icon{
    width:64px;
    height:64px;
    border-radius:20px;
    border:1px solid rgba(148,163,184,.35);
    background:linear-gradient(180deg, rgba(22,93,255,.12), rgba(79,70,229,.08));
    color:var(--primary);
    display:grid;
    place-items:center;
    font-size:28px;
    box-shadow:0 14px 34px rgba(22,93,255,.18);
    margin-bottom:4px;
}

.unlock-title{
    font-size:18px;
    font-weight:800;
    color:rgba(15,23,42,.92);
    letter-spacing:.01em;
}

.unlock-subtitle{
    font-size:13px;
    color:var(--muted);
    margin-bottom:8px;
}

.unlock-error{
    font-size:12px;
    color:#dc2626;
    background:rgba(220,38,38,.08);
    border:1px solid rgba(220,38,38,.22);
    padding:8px 12px;
    border-radius:12px;
    margin-bottom:6px;
}

.unlock-form{
    display:flex;
    flex-direction:column;
    gap:10px;
    width:100%;
    margin-top:6px;
}

.unlock-input{
    width:100%;
    padding:11px 14px;
    border-radius:14px;
    border:1px solid rgba(148,163,184,.45);
    background:rgba(255,255,255,.92);
    font-size:14px;
    color:var(--text);
    outline:none;
    transition:border-color 160ms ease, box-shadow 160ms ease;
    box-sizing:border-box;
}

.unlock-input:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(22,93,255,.18);
}

.unlock-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border-radius:14px;
    border:1px solid rgba(22,93,255,.22);
    background:linear-gradient(180deg, rgba(22,93,255,.98), rgba(22,93,255,.88));
    color:#fff;
    padding:11px 14px;
    text-decoration:none;
    font-size:14px;
    box-shadow:0 14px 30px rgba(22,93,255,.22);
    cursor:pointer;
    transition:transform 160ms ease, filter 160ms ease;
}

.unlock-btn:hover{ filter:brightness(1.05); transform:translateY(-1px); }
.unlock-btn:active{ transform:translateY(0); }

.unlock-back{
    margin-top:14px;
    display:inline-flex;
    align-items:center;
    gap:6px;
    color:var(--primary);
    text-decoration:none;
    font-size:13px;
}

.unlock-back:hover{ text-decoration:underline; }
