@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --ink: #17211c;
    --ink-soft: #4e5c54;
    --muted: #8a968e;
    --paper: #f4f2ec;
    --paper-deep: #ebe7dc;
    --card: #fffdf8;
    --line: #dedbd0;
    --green: #1c4b38;
    --green-deep: #103326;
    --green-light: #dfe9df;
    --amber: #d89b45;
    --amber-soft: #f4e6cd;
    --blue: #56758a;
    --blue-soft: #e3eaee;
    --danger: #b54a3f;
    --shadow: 0 20px 60px rgba(29, 44, 35, .08);
    --radius: 18px;
    --font: 'DM Sans', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    --display: 'Space Grotesk', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.shell { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }

/* Public shell */
.public-page { background: var(--paper); }
.public-header {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(28, 75, 56, .12);
    background: rgba(244, 242, 236, .86);
    backdrop-filter: blur(14px);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 82px; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.02em;
}
.brand small {
    display: block;
    color: var(--muted);
    font-family: var(--font);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .22em;
    line-height: 1.2;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--paper);
    background: var(--green);
    font-family: var(--display);
    font-size: 19px;
    font-weight: 700;
}
.brand.light { color: #f4f2ec; }
.brand.light .brand-mark { color: var(--green); background: #e8e1cd; }
.brand.light small { color: rgba(244, 242, 236, .5); }
.public-nav { display: flex; align-items: center; gap: 34px; font-size: 14px; }
.public-nav a { color: var(--ink-soft); position: relative; }
.public-nav a.active, .public-nav a:hover { color: var(--green); }
.public-nav a.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -9px;
    height: 2px;
    background: var(--green);
}
.public-nav .nav-user {
    max-width: 140px;
    overflow: hidden;
    color: var(--green);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    color: #f6f3e9;
    background: var(--green-deep);
}
.hero::before {
    content: '';
    position: absolute;
    width: 700px; height: 700px;
    right: -190px; top: -360px;
    border: 1px solid rgba(224, 217, 195, .14);
    border-radius: 50%;
    box-shadow: 0 0 0 100px rgba(224, 217, 195, .035), 0 0 0 200px rgba(224, 217, 195, .025);
}
.hero::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 0;
    width: 1px; height: 100%;
    background: linear-gradient(transparent, rgba(224, 217, 195, .16), transparent);
}
.hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 60px;
    padding: 70px 0 78px;
}
.hero-copy { max-width: 720px; }
.eyebrow {
    margin: 0 0 22px;
    color: #c6bca2;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .3em;
}
.hero h1 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(38px, 5.2vw, 66px);
    font-weight: 500;
    letter-spacing: -.055em;
    line-height: 1.18;
}
.hero h1 em { color: #d8c89f; font-style: normal; }
.hero-desc {
    max-width: 510px;
    margin: 26px 0 0;
    color: rgba(246, 243, 233, .62);
    font-size: 15px;
    line-height: 1.9;
}
.hero-stats {
    display: flex;
    gap: 38px;
    padding-bottom: 8px;
    flex-shrink: 0;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong {
    font-family: var(--display);
    font-size: 33px;
    font-weight: 500;
    line-height: 1.1;
}
.hero-stats span {
    margin-top: 8px;
    color: rgba(246, 243, 233, .48);
    font-size: 11px;
    letter-spacing: .08em;
}

/* Search */
.search-section { position: relative; z-index: 2; margin-top: -1px; }
.search-panel {
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
}
.search-main {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 4px 4px 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 11px;
}
.search-icon {
    position: relative;
    width: 16px; height: 16px;
    flex-shrink: 0;
    border: 1.8px solid var(--green);
    border-radius: 50%;
}
.search-icon::after {
    content: '';
    position: absolute;
    right: -5px; bottom: -4px;
    width: 6px; height: 1.8px;
    background: var(--green);
    transform: rotate(45deg);
}
.search-icon.small { width: 14px; height: 14px; }
.search-main input {
    flex: 1;
    min-width: 0;
    padding: 14px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
}
.search-main input::placeholder { color: var(--muted); }
.search-main button {
    padding: 14px 27px;
    border: 0;
    border-radius: 8px;
    color: #f6f3e9;
    background: var(--green);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .03em;
    transition: background .2s;
}
.search-main button:hover { background: #143d2d; }
.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 4px 0;
}
.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-label {
    margin-right: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
    display: inline-block;
    padding: 5px 15px;
    border: 1px solid transparent;
    border-radius: 100px;
    color: var(--ink-soft);
    font-size: 12px;
    transition: all .2s;
    cursor: pointer;
}
.chip span:hover { border-color: var(--line); }
.chip input:checked + span { color: var(--green); background: var(--green-light); font-weight: 600; }
.filter-group select {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: 0;
    color: var(--ink-soft);
    background: transparent;
    font-size: 12px;
}

/* Archive */
.archive-section { padding: 55px 0 90px; }
.archive-layout { display: grid; grid-template-columns: 220px 1fr; gap: 52px; }
.category-rail { position: sticky; top: 24px; align-self: start; }
.rail-title {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
}
.rail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3px;
    padding: 11px 13px;
    border-radius: 9px;
    color: var(--ink-soft);
    font-size: 13px;
    transition: all .18s;
}
.rail-item:hover { background: var(--paper-deep); color: var(--green); }
.rail-item.active { color: var(--green); background: var(--card); box-shadow: 0 3px 14px rgba(30, 50, 38, .06); font-weight: 600; }
.rail-item b { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
.rail-item.active b { color: var(--green); }
.rail-icon {
    display: inline-block;
    width: 17px; height: 17px;
    flex-shrink: 0;
    background: currentColor;
    opacity: .72;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}
.all-icon {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
}
.icon-folder, .glyph-files {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E");
}
.icon-mic {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10a7 7 0 0 0 14 0M12 17v4M8 21h8'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10a7 7 0 0 0 14 0M12 17v4M8 21h8'/%3E%3C/svg%3E");
}
.icon-book {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M4 5.5A2.5 2.5 0 0 1 6.5 3H20v16H6.5A2.5 2.5 0 0 0 4 21.5zM4 5.5v16M8 7h8M8 11h6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M4 5.5A2.5 2.5 0 0 1 6.5 3H20v16H6.5A2.5 2.5 0 0 0 4 21.5zM4 5.5v16M8 7h8M8 11h6'/%3E%3C/svg%3E");
}
.icon-shield {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z'/%3E%3C/svg%3E");
}
.icon-archive {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='3' y='4' width='18' height='4'/%3E%3Cpath d='M5 8v12h14V8M10 12h4'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='3' y='4' width='18' height='4'/%3E%3Cpath d='M5 8v12h14V8M10 12h4'/%3E%3C/svg%3E");
}
.rail-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .06em;
}
.dot { width: 5px; height: 5px; border-radius: 50%; background: #6f9b79; }
.content-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px;
}
.section-kicker {
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2em;
}
.content-head h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 29px;
    font-weight: 600;
    letter-spacing: -.035em;
}
.result-count { color: var(--muted); font-size: 11px; }
.file-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.file-card {
    display: flex;
    flex-direction: column;
    min-height: 250px;
    padding: 21px 21px 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--card);
    transition: transform .22s, box-shadow .22s, border-color .22s;
}
.file-card:hover {
    transform: translateY(-3px);
    border-color: #c7c2b4;
    box-shadow: 0 16px 36px rgba(33, 50, 39, .09);
}
.card-top { display: flex; justify-content: space-between; align-items: center; }
.file-kind {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
}
.file-kind.audio { color: #8b5f24; background: var(--amber-soft); }
.file-kind.document { color: #3f6276; background: var(--blue-soft); }
.wave-icon, .doc-icon { display: inline-block; width: 11px; height: 11px; background: currentColor; }
.wave-icon {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M3 12h2M8 7v10M13 4v16M18 9v6M22 12h-1'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M3 12h2M8 7v10M13 4v16M18 9v6M22 12h-1'/%3E%3C/svg%3E");
    -webkit-mask-size: contain; mask-size: contain;
}
.doc-icon {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M6 2h8l4 4v16H6zM14 2v4h4M9 11h6M9 15h6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M6 2h8l4 4v16H6zM14 2v4h4M9 11h6M9 15h6'/%3E%3C/svg%3E");
    -webkit-mask-size: contain; mask-size: contain;
}
.file-ext { color: var(--muted); font-family: var(--display); font-size: 9px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.card-body { flex: 1; padding: 22px 0 16px; }
.card-body h3 {
    display: -webkit-box;
    margin: 0 0 10px;
    overflow: hidden;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.card-body p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 13px;
    border-top: 1px solid #eeebe2;
    color: var(--muted);
    font-size: 10px;
}
.card-meta span + span::before { content: '·'; margin-right: 12px; color: #c6c1b5; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag-row span { color: #879489; font-size: 10px; }
.empty-state { padding: 85px 20px; text-align: center; }
.empty-state.compact { padding: 45px 20px; }
.empty-mark {
    position: relative;
    width: 54px; height: 42px;
    margin: 0 auto 20px;
    border: 1.5px solid #c8c3b5;
    border-radius: 5px;
}
.empty-mark::before {
    content: '';
    position: absolute;
    left: 9px; top: -8px;
    width: 20px; height: 8px;
    border: 1.5px solid #c8c3b5;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
}
.empty-state h3 { margin: 0 0 8px; font-family: var(--display); font-size: 19px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.text-link { color: var(--green); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* Pagination */
.pagination-wrap { margin-top: 36px; }
.pagination { display: flex; justify-content: center; gap: 5px; }
.pagination li { list-style: none; }
.pagination li a, .pagination li span {
    display: grid;
    place-items: center;
    min-width: 34px; height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink-soft);
    background: var(--card);
    font-size: 12px;
}
.pagination li.active span { color: #fff; border-color: var(--green); background: var(--green); }
.pagination li.disabled span { opacity: .4; }

/* Footer */
.public-footer {
    padding: 28px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .06em;
}
.public-footer .shell { display: flex; justify-content: space-between; }

/* Detail */
.detail-main { padding: 32px 0 80px; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 27px;
    color: var(--muted);
    font-size: 11px;
}
.breadcrumb a:hover { color: var(--green); }
.breadcrumb b { max-width: 45%; overflow: hidden; color: var(--ink-soft); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: start; }
.detail-main-card {
    padding: 45px 48px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
}
.detail-kind {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .05em;
}
.detail-kind.audio { color: #8b5f24; background: var(--amber-soft); }
.detail-kind.document { color: #3f6276; background: var(--blue-soft); }
.detail-main-card h1 {
    margin: 20px 0 14px;
    font-family: var(--display);
    font-size: clamp(27px, 3.3vw, 40px);
    font-weight: 600;
    letter-spacing: -.045em;
    line-height: 1.3;
}
.detail-desc { max-width: 660px; margin: 0 0 34px; color: var(--ink-soft); font-size: 14px; line-height: 1.9; }
.audio-player {
    display: flex;
    align-items: center;
    gap: 19px;
    padding: 18px 20px;
    border: 1px solid #e7dfcd;
    border-radius: 10px;
    background: #f7f0df;
}
.audio-badge {
    padding: 5px 8px;
    border-radius: 3px;
    color: #f6f0df;
    background: var(--green);
    font-family: var(--display);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .12em;
}
.audio-player audio { width: 100%; height: 36px; }
.document-preview {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    border: 1px solid #dce4e9;
    border-radius: 10px;
    background: #eff3f5;
}
.document-glyph {
    display: grid;
    place-items: center;
    width: 51px; height: 62px;
    border: 1px solid #bfd0d8;
    border-radius: 4px;
    color: var(--blue);
    background: #fff;
    font-family: var(--display);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.document-preview strong { display: block; margin-bottom: 4px; font-size: 13px; }
.document-preview p { margin: 0; color: var(--muted); font-size: 11px; }
.detail-actions { display: flex; gap: 10px; margin-top: 30px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; padding-top: 23px; border-top: 1px solid var(--line); }
.detail-tags span { color: var(--muted); font-size: 11px; }

/* Front upload */
.upload-page-main { padding: 48px 0 85px; }
.upload-page-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 55px;
    align-items: start;
}
.upload-intro { position: sticky; top: 32px; padding-top: 22px; }
.upload-intro h1 {
    margin: 12px 0 22px;
    font-family: var(--display);
    font-size: 42px;
    font-weight: 600;
    letter-spacing: -.06em;
    line-height: 1.12;
}
.upload-intro h1 em { color: var(--green); font-style: normal; }
.upload-intro > p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.9; }
.upload-cloud-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 26px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 30px;
    color: var(--green);
    font-size: 10px;
}
.cloud-dot { width: 6px; height: 6px; border-radius: 50%; background: #5a9472; box-shadow: 0 0 0 4px #e1ecdf; }
.upload-page-form { display: block; }
.upload-page-form .panel + .panel { margin-top: 18px; }
.upload-submit { margin-top: 22px; min-height: 47px; }
.upload-config-warning {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #e6d5b4;
    border-radius: 8px;
    color: #785a2d;
    background: #fbf3e2;
    font-size: 12px;
    line-height: 1.7;
}
.detail-side { display: flex; flex-direction: column; gap: 18px; }
.side-card { padding: 25px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.side-card h3 { margin: 0 0 19px; font-size: 13px; font-weight: 600; }
.side-card dl { margin: 0; }
.side-card dl div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #f0ede5; font-size: 11px; }
.side-card dl div:last-child { border: 0; }
.side-card dt { color: var(--muted); }
.side-card dd { margin: 0; text-align: right; }
.related-list { display: flex; flex-direction: column; gap: 12px; }
.related-list a { display: flex; gap: 9px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.related-list a:hover { color: var(--green); }
.mini-type { display: inline-block; width: 6px; height: 6px; flex-shrink: 0; margin-top: 6px; border-radius: 50%; }
.mini-type.audio { background: var(--amber); }
.mini-type.document { background: var(--blue); }

/* Buttons and form */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    transition: all .18s;
}
.btn-primary { color: #f7f4ea; background: var(--green); }
.btn-primary:hover { background: #153d2d; }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); background: transparent; }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-danger:hover { background: #963a31; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 8px 15px; font-size: 11px; }
.btn:disabled { cursor: wait; opacity: .65; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 17px; }
.field > span { color: var(--ink-soft); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.field > span i { color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: 0;
    color: var(--ink);
    background: #fdfbf5;
    font-size: 13px;
    transition: border-color .18s, box-shadow .18s;
}
.field textarea { resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: #89a391;
    box-shadow: 0 0 0 3px rgba(28, 75, 56, .07);
}
.field small { color: var(--muted); font-size: 10px; }

/* Login */
.login-page { background: #ebe7dc; }
.login-layout { display: grid; grid-template-columns: 46% 54%; min-height: 100vh; }
.login-brand-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px 54px;
    color: #f4f2ec;
    background: var(--green-deep);
}
.login-brand-side::after {
    content: '';
    position: absolute;
    right: -170px; bottom: -230px;
    width: 550px; height: 550px;
    border: 1px solid rgba(231, 222, 198, .16);
    border-radius: 50%;
    box-shadow: 0 0 0 80px rgba(231, 222, 198, .04), 0 0 0 160px rgba(231, 222, 198, .025);
}
.login-quote { position: relative; z-index: 1; padding: 60px 0; }
.quote-line { display: block; width: 42px; height: 1px; margin-bottom: 27px; background: #c2b28a; }
.login-quote h2 {
    margin: 0 0 25px;
    font-family: var(--display);
    font-size: clamp(31px, 3.6vw, 46px);
    font-weight: 400;
    letter-spacing: -.05em;
    line-height: 1.45;
}
.login-quote p { color: rgba(244, 242, 236, .47); font-size: 11px; letter-spacing: .16em; }
.login-foot { position: relative; z-index: 1; color: rgba(244, 242, 236, .33); font-size: 9px; letter-spacing: .25em; }
.login-form-side { display: grid; place-items: center; padding: 40px; }
.login-box { width: min(365px, 100%); }
.login-box .eyebrow { margin-bottom: 12px; color: #8b907f; }
.login-box h1 { margin: 0; font-family: var(--display); font-size: 36px; font-weight: 600; letter-spacing: -.05em; }
.login-tip { margin: 9px 0 31px; color: var(--muted); font-size: 12px; }
.login-box .field { margin-bottom: 19px; }
.login-box .field input { padding: 13px 14px; background: #fbf9f2; }
.login-box .btn { min-height: 47px; margin-top: 7px; }
.form-error { min-height: 19px; margin: 0 0 6px; color: var(--danger); font-size: 11px; }
.back-link { display: block; margin-top: 24px; color: var(--muted); font-size: 11px; text-align: center; }
.back-link:hover { color: var(--green); }

/* Admin shell */
.admin-page { display: flex; min-height: 100vh; background: #f1efe8; }
.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: 232px;
    padding: 32px 20px 23px;
    color: rgba(244, 242, 236, .7);
    background: var(--green-deep);
}
.admin-sidebar .brand { padding: 0 8px; }
.admin-nav { flex: 1; margin-top: 51px; }
.admin-nav p {
    margin: 26px 11px 8px;
    color: rgba(244, 242, 236, .32);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .2em;
}
.admin-nav p:first-child { margin-top: 0; }
.admin-nav a, .sidebar-bottom a {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3px;
    padding: 10px 11px;
    border-radius: 7px;
    font-size: 12px;
    transition: all .18s;
}
.admin-nav a:hover, .sidebar-bottom a:hover { color: #f4f2ec; background: rgba(244, 242, 236, .07); }
.admin-nav a.active { color: #f4f2ec; background: rgba(244, 242, 236, .1); }
.nav-glyph {
    display: inline-block;
    width: 16px; height: 16px;
    flex-shrink: 0;
    background: currentColor;
    opacity: .7;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
}
.glyph-dashboard {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Crect x='3' y='3' width='7' height='8' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='3' y='15' width='7' height='6' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Crect x='3' y='3' width='7' height='8' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='3' y='15' width='7' height='6' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3C/svg%3E");
}
.glyph-categories {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E");
}
.glyph-external {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E");
}
.glyph-logout {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M10 4H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h5M15 8l4 4-4 4M9 12h10'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M10 4H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h5M15 8l4 4-4 4M9 12h10'/%3E%3C/svg%3E");
}
.sidebar-bottom { padding-top: 16px; border-top: 1px solid rgba(244, 242, 236, .12); }
.admin-main { flex: 1; min-width: 0; margin-left: 232px; }
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 45px 26px;
    border-bottom: 1px solid var(--line);
}
.admin-kicker { margin: 0 0 6px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .2em; }
.admin-topbar h1 { margin: 0; font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: -.04em; }
.admin-user { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 11px; }
.avatar {
    display: grid;
    place-items: center;
    width: 31px; height: 31px;
    border-radius: 50%;
    color: #f5f1e7;
    background: var(--green);
    font-family: var(--display);
    font-size: 12px;
}
.admin-content { padding: 32px 45px 55px; }

/* Admin components */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 23px; }
.stat-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--card);
}
.stat-label { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .07em; }
.stat-card strong { margin: 12px 0 7px; font-family: var(--display); font-size: 37px; font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.stat-note { color: var(--muted); font-size: 10px; }
.stat-card.accent-amber { border-top: 2px solid var(--amber); }
.stat-card.accent-blue { border-top: 2px solid var(--blue); }
.admin-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 18px; align-items: start; }
.panel { padding: 23px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; }
.data-table th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .09em;
    white-space: nowrap;
}
.data-table td { padding: 13px 12px; border-bottom: 1px solid #f0ede5; color: var(--ink-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbf8f0; }
.table-file { display: flex; align-items: center; gap: 9px; min-width: 160px; color: var(--ink); }
.table-file:hover { color: var(--green); }
.table-file b { display: block; overflow: hidden; max-width: 230px; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.table-file small { display: block; overflow: hidden; max-width: 230px; margin-top: 2px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.status-dot::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-dot.on { color: #558368; }
.status-dot.off { color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; }
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 27px; height: 27px;
    margin-left: 2px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--muted);
    background: transparent;
    font-size: 15px;
    line-height: 1;
}
.icon-btn:hover { color: var(--green); border-color: var(--line); background: var(--paper); }
.icon-btn.danger:hover { color: var(--danger); border-color: #e6c8c3; background: #fdf1ef; }
.category-stat-list { margin-bottom: 22px; }
.category-stat { margin-bottom: 17px; }
.category-stat-head { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 11px; }
.category-stat-head b { color: var(--muted); font-weight: 500; }
.bar { height: 4px; overflow: hidden; border-radius: 10px; background: var(--paper-deep); }
.bar i { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: #7f9b83; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.admin-filter { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon .search-icon { position: absolute; left: 12px; }
.input-with-icon input {
    width: 240px;
    padding: 9px 12px 9px 35px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: 0;
    background: var(--card);
    font-size: 11px;
}
.admin-filter select {
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: 0;
    color: var(--ink-soft);
    background: var(--card);
    font-size: 11px;
}
.config-badge { padding: 4px 9px; border-radius: 4px; color: var(--muted); background: var(--paper-deep); font-size: 9px; }
.config-badge.on { color: #43705a; background: var(--green-light); }

/* Upload form */
.file-form { display: grid; grid-template-columns: minmax(0, 1fr) 265px; gap: 18px; align-items: start; }
.form-main .panel { margin: 0 0 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 17px; }
.span-2 { grid-column: span 2; }
.form-side { position: sticky; top: 24px; }
.form-side .panel { margin: 0 0 18px; }
.form-side h2 { margin: 0 0 10px; font-size: 14px; }
.publish-note { margin: 0 0 19px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.form-side .btn { margin-bottom: 9px; }
.upload-zone {
    position: relative;
    padding: 36px 20px;
    border: 1px dashed #c9c4b5;
    border-radius: 9px;
    background: #fbf8f0;
    text-align: center;
    transition: all .2s;
    cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover, .upload-zone.dragging { border-color: #7e9b84; background: #f4f7ef; }
.upload-zone input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.upload-visual { display: grid; place-items: center; width: 37px; height: 37px; margin: 0 auto 14px; border: 1px solid #bdcbbf; border-radius: 50%; }
.upload-arrow {
    position: relative;
    display: block;
    width: 11px; height: 11px;
    border-top: 1.5px solid var(--green);
    border-left: 1.5px solid var(--green);
    transform: rotate(45deg);
}
.upload-arrow::after { content: ''; position: absolute; left: 4px; top: 4px; width: 1.5px; height: 14px; background: var(--green); }
.upload-zone h3 { margin: 0 0 7px; font-size: 13px; font-weight: 600; }
.upload-zone p { margin: 0; color: var(--muted); font-size: 10px; }
.selected-file { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid transparent; border-radius: 7px; color: var(--green); background: var(--green-light); font-size: 11px; }
.selected-file-info { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.selected-file-info strong { overflow: hidden; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.selected-file-info span { color: var(--muted); font-size: 10px; }
.selected-file.is-ready { border-color: #bfd4c4; }
.selected-file.is-error { border-color: #e3c1bc; color: var(--danger); background: #fbf0ee; }
.selected-file-cancel { flex: none; padding: 0; border: 0; color: var(--muted); background: none; font: inherit; cursor: pointer; }
.selected-file-cancel:hover { color: var(--ink); }
.upload-progress { margin-top: 16px; }
.progress-info { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; }
.progress-info b { color: var(--green); font-weight: 600; }
.progress-bar { height: 5px; overflow: hidden; border-radius: 10px; background: var(--paper-deep); }
.progress-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: #73977c; transition: width .2s; }
.current-file { display: flex; align-items: center; gap: 13px; margin-bottom: 17px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fbf9f3; }
.current-file > div:nth-child(2) { flex: 1; min-width: 0; }
.current-file strong { display: block; overflow: hidden; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.current-file p { overflow: hidden; margin: 3px 0 0; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.replace-tip { margin: 0 0 17px; color: var(--muted); font-size: 10px; }
.categories-layout { grid-template-columns: minmax(0, 1.6fr) 300px; }
.category-editor { position: sticky; top: 24px; }
.category-cell { display: flex; align-items: center; gap: 10px; }
.category-cell > span:last-child { display: flex; flex-direction: column; }
.category-cell b { font-size: 12px; font-weight: 500; }
.category-cell small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.category-cell .rail-icon { color: var(--green); }
code { padding: 2px 5px; border-radius: 3px; color: #68766a; background: var(--paper-deep); font-family: monospace; font-size: 10px; }
.danger-panel { border-color: #ead4d0; }
.danger-panel h2 { color: var(--danger); }

/* Toast */
.toast {
    position: fixed;
    right: 26px; bottom: 26px;
    z-index: 100;
    padding: 11px 18px;
    border-radius: 7px;
    color: #f7f4ea;
    background: var(--green);
    box-shadow: 0 10px 30px rgba(16, 51, 38, .2);
    font-size: 12px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: all .22s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

@media (max-width: 1050px) {
    .file-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-columns { grid-template-columns: 1fr; }
    .category-editor { position: static; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .file-form { grid-template-columns: 1fr; }
    .form-side { position: static; }
    .upload-page-layout { grid-template-columns: 1fr; gap: 28px; }
    .upload-intro { position: static; padding-top: 0; }
    .upload-intro h1 { font-size: 34px; }
}
@media (max-width: 820px) {
    .shell { width: calc(100% - 36px); }
    .nav-row { height: 68px; }
    .public-nav { gap: 17px; font-size: 12px; }
    .hero-inner { display: block; padding: 52px 0 57px; }
    .hero-stats { margin-top: 34px; gap: 28px; }
    .hero-stats strong { font-size: 26px; }
    .archive-layout { grid-template-columns: 1fr; gap: 28px; }
    .category-rail { position: static; display: flex; overflow-x: auto; gap: 5px; padding-bottom: 4px; }
    .rail-title, .rail-note { display: none; }
    .rail-item { flex-shrink: 0; margin: 0; padding: 8px 12px; }
    .rail-item b { margin-left: 3px; }
    .archive-section { padding-top: 35px; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-main-card { padding: 29px 23px; }
    .login-layout { grid-template-columns: 1fr; }
    .login-brand-side { min-height: 260px; padding: 30px; }
    .login-quote { padding: 30px 0 15px; }
    .login-quote h2 { font-size: 28px; }
    .login-form-side { padding: 45px 25px; }
    .admin-sidebar { width: 63px; padding: 23px 10px; }
    .admin-sidebar .brand span:last-child, .admin-nav p, .admin-nav a span:last-child, .sidebar-bottom a span:last-child { display: none; }
    .admin-sidebar .brand { justify-content: center; padding: 0; }
    .admin-nav { margin-top: 37px; }
    .admin-nav a, .sidebar-bottom a { justify-content: center; padding: 11px; }
    .admin-main { margin-left: 63px; }
    .admin-topbar { padding: 23px 25px; }
    .admin-content { padding: 24px 25px 45px; }
    .admin-topbar h1 { font-size: 23px; }
    .admin-user span:last-child { display: none; }
    .toolbar { align-items: flex-start; flex-direction: column; }
    .input-with-icon input { width: min(240px, calc(100vw - 180px)); }
    .categories-layout { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .file-grid { grid-template-columns: 1fr; }
    .search-panel { padding: 13px; }
    .search-main { padding-left: 12px; gap: 10px; }
    .search-main button { padding: 12px 16px; font-size: 12px; }
    .filter-row { align-items: flex-start; flex-direction: column; gap: 11px; }
    .content-head h2 { font-size: 24px; }
    .detail-actions { flex-wrap: wrap; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-card strong { font-size: 29px; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .admin-content { padding: 18px 14px 40px; }
    .admin-topbar { padding: 19px 14px; }
    .panel { padding: 16px; }
    .public-footer .shell { flex-direction: column; gap: 5px; }
}
