/* Foldx 图床 · visual system
   Deep-blue cloud sea + pink/cyan light, glass panels, soft borders. */

:root {
    --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    --font-display: "Noto Serif SC", "Songti SC", "STSong", "Noto Sans SC", serif;
    --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", "Noto Sans Mono", monospace;
    --bg: #061528;
    --bg-2: #0a213c;
    --text: #f2f7ff;
    --muted: rgba(232, 243, 255, 0.66);
    --muted-2: rgba(232, 243, 255, 0.46);
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.24);
    --glass: rgba(255, 255, 255, 0.095);
    --glass-strong: rgba(255, 255, 255, 0.155);
    --accent: #8bb9ff;
    --accent-2: #78e5ec;
    --pink: #f5b8dc;
    --violet: #c1b2ff;
    --danger: #ff8b9f;
    --success: #88efc1;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.18);
    --radius: 24px;
    --radius-sm: 15px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="light"] {
    --bg: #eaf5ff;
    --bg-2: #f7fbff;
    --text: #10233f;
    --muted: rgba(17, 48, 80, 0.66);
    --muted-2: rgba(17, 48, 80, 0.44);
    --line: rgba(18, 61, 105, 0.13);
    --line-strong: rgba(18, 61, 105, 0.23);
    --glass: rgba(255, 255, 255, 0.62);
    --glass-strong: rgba(255, 255, 255, 0.8);
    --accent: #2d78dc;
    --accent-2: #0e9eae;
    --pink: #ce6ca9;
    --violet: #7461df;
    --danger: #d64464;
    --success: #16845d;
    --shadow: 0 24px 70px rgba(36, 84, 138, 0.16);
    --shadow-soft: 0 10px 30px rgba(36, 84, 138, 0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
a {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

code {
    font-family: var(--font-mono);
}

.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 8%, rgba(72, 132, 235, 0.34), transparent 47%),
        radial-gradient(ellipse at 87% 17%, rgba(246, 174, 219, 0.2), transparent 42%),
        radial-gradient(ellipse at 55% 102%, rgba(57, 204, 218, 0.23), transparent 55%),
        linear-gradient(145deg, #061528 0%, #0a213c 42%, #0b3151 68%, #272449 100%);
}

html[data-theme="light"] .ambient::before {
    background:
        radial-gradient(ellipse at 15% 6%, rgba(118, 188, 255, 0.45), transparent 48%),
        radial-gradient(ellipse at 88% 15%, rgba(255, 190, 225, 0.4), transparent 44%),
        radial-gradient(ellipse at 50% 100%, rgba(114, 230, 238, 0.22), transparent 58%),
        linear-gradient(150deg, #edf8ff 0%, #f6faff 42%, #f4eeff 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.7;
    animation: drift 18s var(--ease) infinite alternate;
}

.orb-a {
    width: 54vw;
    height: 34vw;
    left: -12vw;
    top: -12vw;
    background: radial-gradient(circle at 55% 45%, rgba(126, 177, 255, 0.4), transparent 64%);
}

.orb-b {
    width: 44vw;
    height: 34vw;
    right: -10vw;
    top: 10vh;
    background: radial-gradient(circle at 50% 50%, rgba(248, 178, 219, 0.32), transparent 68%);
    animation-delay: -6s;
}

.orb-c {
    width: 52vw;
    height: 30vw;
    left: 20vw;
    bottom: -18vw;
    background: radial-gradient(circle at 50% 50%, rgba(89, 220, 230, 0.22), transparent 68%);
    animation-delay: -11s;
}

.grain {
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(2vw, 3vh, 0) scale(1.08); }
}

.page-wrap,
main,
.site-nav {
    position: relative;
    z-index: 1;
}

.site-nav {
    width: min(1180px, calc(100% - 40px));
    margin: 18px auto 0;
    padding: 12px 14px 12px 18px;
    display: flex;
    align-items: center;
    gap: 26px;
    position: sticky;
    top: 18px;
    z-index: 20;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--glass);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.11);
    -webkit-backdrop-filter: blur(22px) saturate(135%);
    backdrop-filter: blur(22px) saturate(135%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(142deg, #6ab4ff 0%, #4d8bff 44%, #cf9eff 100%);
    box-shadow: 0 8px 22px rgba(85, 146, 255, 0.33), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.brand-mark.small {
    width: 30px;
    height: 30px;
    border-radius: 9px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.08;
}

.brand-copy b {
    font-size: 16px;
    letter-spacing: -0.02em;
}

.brand-copy small {
    margin-top: 4px;
    font-size: 8px;
    letter-spacing: 0.22em;
    color: var(--muted-2);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 13.5px;
    transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .nav-links a.active {
    background: rgba(30, 90, 160, 0.07);
}

.nav-links a .ui-icon {
    margin-left: 4px;
    opacity: 0.5;
    vertical-align: -2px;
}

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    display: inline-grid;
    place-items: center;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.icon-btn:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--glass-strong);
}

.theme-btn .theme-sun { display: none; }
.theme-btn .theme-moon { display: inline-grid; }
html[data-theme="dark"] .theme-btn .theme-sun { display: inline-grid; }
html[data-theme="dark"] .theme-btn .theme-moon { display: none; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 19px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: linear-gradient(135deg, #82b6ff 0%, #70cfe2 100%);
    color: #071c35;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
    box-shadow: 0 10px 28px rgba(101, 179, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.52);
    transition: transform 0.2s var(--ease), box-shadow 0.2s, filter 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    filter: saturate(115%);
    box-shadow: 0 14px 34px rgba(101, 179, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.btn:active { transform: translateY(0); }

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    transform: none;
    box-shadow: none;
}

.btn-small {
    min-height: 36px;
    padding: 0 14px;
    font-size: 12.5px;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--glass-strong);
    border-color: var(--line-strong);
    box-shadow: none;
}

.hero {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 90px 0 62px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.82fr);
    gap: 54px;
    align-items: center;
}

.hero-copy {
    padding: 12px 0;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    color: var(--muted-2);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-2), var(--pink));
    box-shadow: 0 0 0 4px rgba(120, 229, 236, 0.1);
}

.hero h1 {
    margin: 0 0 22px;
    font-family: var(--font-display);
    font-size: clamp(44px, 6.2vw, 78px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.055em;
}

.hero h1 .grad {
    display: inline-block;
    background: linear-gradient(100deg, #ffffff 0%, #b8d6ff 38%, #ffc7e6 76%, #b4fff0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

html[data-theme="light"] .hero h1 .grad {
    background: linear-gradient(100deg, #164b91 0%, #337adc 38%, #b158a0 78%, #128b91 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.lead {
    max-width: 540px;
    margin: 0 0 26px;
    color: var(--muted);
    font-size: 15.5px;
    line-height: 1.92;
}

.hero-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 30px;
    color: var(--muted);
    font-size: 12.5px;
}

.hero-notes span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.hero-notes .ui-icon {
    color: var(--accent-2);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-panel {
    width: 100%;
    padding: 24px;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    background: var(--glass);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    backdrop-filter: blur(24px) saturate(140%);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.panel-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--muted-2);
    font-size: 9px;
    letter-spacing: 0.22em;
    font-weight: 700;
}

.panel-head h2,
.admin-card-head h2,
.section-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(22px, 2.5vw, 28px);
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.panel-badge {
    flex: 0 0 auto;
    margin-top: 4px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 10px;
}

.dropzone {
    position: relative;
    min-height: 198px;
    padding: 24px 18px 20px;
    border: 1.5px dashed rgba(150, 194, 255, 0.42);
    border-radius: 20px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.055), rgba(120, 229, 236, 0.035));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}

.dropzone:hover,
.dropzone.is-over {
    border-color: var(--accent-2);
    background: linear-gradient(150deg, rgba(120, 229, 236, 0.12), rgba(246, 184, 220, 0.07));
    transform: translateY(-2px);
}

.dropzone.is-disabled { pointer-events: none; opacity: 0.62; }

.drop-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 13px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: #071c35;
    background: linear-gradient(140deg, #a9d0ff, #74e3e9);
    box-shadow: 0 8px 24px rgba(102, 201, 232, 0.22);
}

.drop-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.drop-sub {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12.5px;
}

.drop-hint {
    color: var(--muted-2);
    font-size: 10.5px;
    letter-spacing: 0.02em;
}

.upload-queue {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 210px;
    overflow-y: auto;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.queue-item img {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.queue-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.queue-meta b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 600;
}

.queue-meta span {
    color: var(--muted-2);
    font-size: 10px;
}

.queue-remove {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted-2);
    font-size: 20px;
    line-height: 1;
}

.queue-remove:hover {
    color: var(--danger);
    background: rgba(255, 139, 159, 0.1);
}

.upload-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.upload-status {
    color: var(--muted);
    font-size: 11.5px;
}

.upload-status[data-tone="success"] { color: var(--success); }
.upload-status[data-tone="error"] { color: var(--danger); }

.upload-progress {
    height: 3px;
    margin-top: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
}

.upload-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-2), var(--pink));
    transition: width 0.3s var(--ease);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
}

.hero-stats div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hero-stats b {
    font-family: var(--font-mono);
    font-size: 17px;
    letter-spacing: -0.04em;
}

.hero-stats span {
    color: var(--muted-2);
    font-size: 10px;
}

.locked-upload {
    padding: 21px 18px 4px;
    text-align: center;
}

.lock-badge {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border: 1px solid var(--line);
    border-radius: 17px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
}

.locked-upload h3 {
    margin: 0 0 7px;
    font-size: 16px;
}

.locked-upload p {
    max-width: 360px;
    margin: 0 auto 17px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.8;
}

.section {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 58px 0;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12.5px;
}

.text-link:hover { color: var(--text); border-color: var(--line-strong); }

.recent-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.image-card {
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: var(--glass);
    box-shadow: var(--shadow-soft);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition: transform 0.3s var(--ease), border-color 0.25s, background 0.25s;
}

.image-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    background: var(--glass-strong);
}

.image-thumb {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 13px;
    background: #0a2038;
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease), filter 0.3s;
}

.image-thumb:hover img { transform: scale(1.045); filter: saturate(107%); }

.image-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s var(--ease);
}

.image-thumb:hover .image-shine { transform: translateX(120%); }

.image-meta {
    padding: 10px 3px 7px;
    min-width: 0;
}

.image-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    font-weight: 650;
}

.image-sub {
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 10.5px;
}

.image-actions {
    display: flex;
    gap: 5px;
    padding: 0 1px 1px;
}

.mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 29px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.mini-btn:hover {
    color: var(--text);
    background: var(--glass-strong);
    border-color: var(--line-strong);
}

.empty,
.library-empty {
    padding: 48px 22px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--glass);
}

.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.07);
}

.empty h3,
.library-empty h3 {
    margin: 0 0 5px;
    font-size: 16px;
}

.empty p,
.library-empty p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
}

.feature-section { padding-top: 20px; padding-bottom: 80px; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.feature-card {
    padding: 23px 21px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--accent-2);
    background: rgba(120, 229, 236, 0.1);
}

.feature-card h3 {
    margin: 0 0 7px;
    font-size: 15px;
    letter-spacing: -0.02em;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.8;
}

.feature-card code {
    color: var(--accent);
    font-size: 11px;
}

.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.08);
}

.footer-inner {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 38px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 30px;
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 700;
}

.footer-inner p {
    margin: 0;
    color: var(--muted-2);
    font-size: 11.5px;
}

.footer-inner p a {
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.footer-meta { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 10px !important; }

/* Auth */
.auth-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 30px 18px;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(432px, 100%);
    padding: 34px;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    background: var(--glass);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(26px) saturate(140%);
    backdrop-filter: blur(26px) saturate(140%);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.auth-card h1 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 35px;
    line-height: 1.15;
    letter-spacing: -0.045em;
}

.auth-lead {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.8;
}

.form-error {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 139, 159, 0.34);
    border-radius: 10px;
    background: rgba(255, 139, 159, 0.09);
    color: var(--danger);
    font-size: 12px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 650;
    color: var(--muted);
}

.auth-form input {
    width: 100%;
    height: 45px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

html[data-theme="light"] .auth-form input { background: rgba(255, 255, 255, 0.72); }

.auth-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 185, 255, 0.14);
}

.auth-submit { width: 100%; margin-top: 4px; }

.auth-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.auth-foot a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11.5px;
}

.auth-note {
    margin: 20px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    text-align: center;
    font-size: 10px;
}

/* Admin */
body[data-page="admin"] {
    overflow-x: hidden;
}

.admin-sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: 246px;
    padding: 24px 17px 18px;
    border-right: 1px solid var(--line);
    background: rgba(5, 18, 35, 0.62);
    display: flex;
    flex-direction: column;
    gap: 22px;
    -webkit-backdrop-filter: blur(24px) saturate(135%);
    backdrop-filter: blur(24px) saturate(135%);
    transition: transform 0.35s var(--ease);
}

html[data-theme="light"] .admin-sidebar { background: rgba(240, 248, 255, 0.64); }

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-close {
    display: none;
    width: 30px;
    height: 30px;
    font-size: 22px;
    line-height: 1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 13px;
    transition: color 0.2s, background 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .sidebar-nav a:hover,
html[data-theme="light"] .sidebar-nav a.active { background: rgba(32, 96, 170, 0.07); }

.sidebar-nav a.active .ui-icon { color: var(--accent-2); }

.sidebar-storage {
    margin-top: auto;
    padding: 13px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.storage-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 10.5px;
}

.storage-head b { color: var(--text); font-family: var(--font-mono); }

.storage-bar {
    height: 4px;
    margin: 8px 0 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.storage-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-2), var(--pink));
}

.sidebar-storage p {
    margin: 0;
    color: var(--muted-2);
    font-size: 9.5px;
}

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

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 3px;
}

.avatar {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #071c35;
    background: linear-gradient(140deg, #a9d0ff, #f4b8dc);
    font-size: 12px;
    font-weight: 800;
}

.user-chip b { display: block; font-size: 11.5px; line-height: 1.2; }

.user-chip small { color: var(--muted-2); font-size: 9.5px; }

.sidebar-logout {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    text-align: left;
}

.sidebar-logout:hover { color: var(--danger); border-color: rgba(255, 139, 159, 0.3); }

.admin-main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    margin-left: 246px;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    height: 62px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(6, 21, 40, 0.58);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    backdrop-filter: blur(20px) saturate(130%);
}

html[data-theme="light"] .admin-topbar { background: rgba(245, 250, 255, 0.66); }

.menu-btn { display: none; font-size: 20px; }

.crumb {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted-2);
    font-size: 11px;
}

.crumb b { color: var(--text); font-weight: 600; }
.crumb .sep { opacity: 0.5; }

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 11px;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
}

.topbar-link:hover { color: var(--text); }

.dashboard {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 30px 30px 40px;
}

.dash-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    padding: 6px 2px 24px;
}

.dash-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 44px);
    line-height: 1.15;
    letter-spacing: -0.05em;
}

.dash-lead {
    max-width: 580px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.dash-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.stat-card {
    padding: 17px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
}

.stat-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 11px;
}

.stat-icon.blue { color: #9ec5ff; background: rgba(109, 161, 255, 0.14); }
.stat-icon.cyan { color: #85eef3; background: rgba(111, 229, 238, 0.12); }
.stat-icon.pink { color: #ffc3e0; background: rgba(246, 184, 220, 0.12); }
.stat-icon.violet { color: #d4c9ff; background: rgba(193, 178, 255, 0.12); }

html[data-theme="light"] .stat-icon.blue { color: #2268c6; background: rgba(49, 130, 246, 0.1); }
html[data-theme="light"] .stat-icon.cyan { color: #0a8894; background: rgba(28, 184, 201, 0.1); }
html[data-theme="light"] .stat-icon.pink { color: #a84d87; background: rgba(229, 138, 194, 0.13); }
html[data-theme="light"] .stat-icon.violet { color: #6350d6; background: rgba(140, 123, 255, 0.1); }

.stat-card div { display: flex; flex-direction: column; min-width: 0; }

.stat-card b {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.05em;
}

.stat-card span {
    margin-top: 3px;
    color: var(--muted-2);
    font-size: 10px;
}

.admin-card {
    margin-top: 16px;
    padding: 23px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--glass);
    box-shadow: var(--shadow-soft);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    scroll-margin-top: 80px;
}

.admin-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.admin-card-head p:not(.eyebrow) {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11.5px;
}

.library-head { align-items: flex-end; }

.library-tools { flex: 0 0 auto; }

.search-box {
    width: min(250px, 32vw);
    height: 37px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted-2);
}

html[data-theme="light"] .search-box { background: rgba(255, 255, 255, 0.66); }

.search-box:focus-within { border-color: var(--accent); }

.search-box input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 11.5px;
}

.search-box input::placeholder { color: var(--muted-2); }

.library-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.library-loading {
    grid-column: 1 / -1;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.spinner {
    width: 17px;
    height: 17px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--accent-2);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.library-card {
    min-width: 0;
    padding: 9px;
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}

.library-card:hover {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.075);
    transform: translateY(-1px);
}

.library-thumb {
    position: relative;
    width: 98px;
    height: 74px;
    overflow: hidden;
    border-radius: 10px;
    background: #0a2038;
}

.library-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-dim {
    position: absolute;
    right: 4px;
    bottom: 4px;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(2, 12, 24, 0.62);
    color: #e9f3ff;
    font-family: var(--font-mono);
    font-size: 8px;
    line-height: 1.3;
}

.library-body { min-width: 0; }

.library-body h3 {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
    font-weight: 650;
}

.library-body p {
    margin: 2px 0 4px;
    color: var(--muted-2);
    font-size: 9.5px;
}

.library-body code {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted-2);
    font-size: 8.5px;
}

.library-actions {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.icon-action {
    width: 27px;
    height: 27px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
}

.icon-action:hover {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.07);
}

.icon-action.danger:hover {
    color: var(--danger);
    border-color: rgba(255, 139, 159, 0.26);
    background: rgba(255, 139, 159, 0.08);
}

.library-empty { margin-top: 8px; padding: 30px 18px; border-style: dashed; }

.library-empty[hidden] { display: none; }

.library-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
    color: var(--muted-2);
    font-size: 10px;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.025);
}

.setting-row:not(:last-child) { border-bottom: 1px solid var(--line); }

.setting-row > div:first-child { min-width: 0; }

.setting-row b {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
}

.setting-row span {
    display: block;
    margin-top: 1px;
    color: var(--muted-2);
    font-size: 9.5px;
}

.setting-value {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
}

.setting-value code {
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 9.5px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border: 1px solid rgba(136, 239, 193, 0.2);
    border-radius: 999px;
    color: var(--success);
    background: rgba(136, 239, 193, 0.08);
    font-size: 9px;
    line-height: 1.5;
}

.status-pill i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.dash-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 25px 2px 10px;
    color: var(--muted-2);
    font-size: 10px;
}

.dash-footer a { color: var(--muted); }
.dash-footer a:hover { color: var(--text); }

.sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(1, 8, 17, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* Toast */
.toast {
    position: fixed;
    z-index: 60;
    left: 50%;
    bottom: 26px;
    max-width: min(420px, calc(100% - 36px));
    padding: 9px 15px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: rgba(5, 18, 35, 0.82);
    color: #f2f7ff;
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.28);
    font-size: 11.5px;
    line-height: 1.5;
    transform: translate(-50%, 14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s var(--ease);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="error"] { border-color: rgba(255, 139, 159, 0.4); color: #ffd5dd; }
.toast[data-tone="success"] { border-color: rgba(136, 239, 193, 0.32); color: #c6ffe2; }

.ui-icon { vertical-align: -3px; flex: 0 0 auto; }

/* Responsive */
@media (max-width: 1050px) {
    .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 66px; }
    .hero-panel { max-width: 580px; }
    .recent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dash-hero { align-items: flex-start; flex-direction: column; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .library-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.is-open { transform: translateX(0); }
    .sidebar-close { display: inline-grid; }
    .admin-main { margin-left: 0; }
    .menu-btn { display: inline-grid; }
    .admin-topbar { padding: 0 17px; }
    .dashboard { padding: 24px 17px 32px; }
    .nav-links { display: none; }
    .site-nav { gap: 14px; }
}

@media (max-width: 740px) {
    .hero { padding: 44px 0 45px; }
    .hero h1 { font-size: clamp(36px, 10vw, 51px); }
    .hero-notes { gap: 8px 15px; }
    .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feature-grid { grid-template-columns: 1fr; }
    .section { padding: 40px 0; }
    .section-head { align-items: flex-start; flex-direction: column; gap: 12px; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-meta { grid-column: auto; }
    .auth-card { padding: 25px; }
    .auth-card h1 { font-size: 30px; }
    .admin-topbar .topbar-link { display: none; }
    .library-card { grid-template-columns: 82px minmax(0, 1fr) auto; }
    .library-thumb { width: 82px; height: 64px; }
    .setting-row { align-items: flex-start; flex-direction: column; gap: 5px; }
    .setting-value { width: 100%; }
    .setting-value code { max-width: 100%; }
    .dash-hero-actions { width: 100%; }
    .dash-hero-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 470px) {
    .site-nav { width: calc(100% - 24px); margin-top: 12px; top: 12px; padding: 9px 9px 9px 11px; }
    .brand-copy small { display: none; }
    .brand-mark { width: 33px; height: 33px; }
    .nav-actions .btn { padding: 0 11px; }
    .hero { width: calc(100% - 30px); }
    .hero-panel { padding: 16px; border-radius: 21px; }
    .hero h1 { letter-spacing: -0.06em; }
    .recent-grid { grid-template-columns: 1fr; }
    .hero-stats b { font-size: 15px; }
    .admin-card { padding: 16px; border-radius: 17px; }
    .dashboard { padding: 21px 12px 28px; }
    .stat-card { padding: 13px 12px; gap: 9px; }
    .stat-card b { font-size: 17px; }
    .stat-icon { width: 32px; height: 32px; }
    .library-head { align-items: flex-start; flex-direction: column; }
    .search-box { width: 100%; }
    .library-card { padding: 7px; gap: 8px; }
    .library-actions { gap: 1px; }
    .library-body h3 { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
