/* ==========================================================================
   林枫视界 - SkyView v3 — 全局样式
   --------------------------------------------------------------------------
   替代旧版方案：
     · 移除 Tailwind Play CDN（tailwindcss.js）—— 官方明确禁止在生产环境使用，
       它会在浏览器里实时扫描 DOM 生成样式，首屏必然闪烁且体积巨大。
     · 移除 pettite-vue 依赖，交互统一交给 Vue 3。
   本文件为纯手写 CSS，约 20KB，浏览器一次缓存即可。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌
   -------------------------------------------------------------------------- */
:root {
    --brand: #e94560;
    --brand-dark: #c73a52;
    --brand-soft: rgba(233, 69, 96, 0.12);
    --ink-0: #0f1117;
    --ink-1: #1a1a2e;
    --ink-2: #22263a;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 3px rgba(15, 17, 23, 0.08);
    --shadow: 0 6px 24px rgba(15, 17, 23, 0.1);
    --shadow-lg: 0 18px 48px rgba(15, 17, 23, 0.16);

    --nav-h: 64px;
    --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system,
        BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] {
    /* ⚠️ 此处禁止声明 color-scheme（2026-10-15 实测）：移动端内核的强制暗黑
     * （Force Dark）只认「解析期 <meta name="color-scheme" content="light dark">」
     * 这一种豁免（见 head.php）；一旦任何 CSS 规则写出 color-scheme 属性，
     * meta 的豁免即失效，浅色主题在绘制层被内核强行反色，表现为
     * 「点了切换只有图标变、页面永远黑的」。矩阵实验见 e2e 记录。 */
    --bg: #f5f6f8;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --surface-3: #e5e8ee;
    --text: #14161d;
    --text-muted: #6b7280;
    --text-faint: #9aa1ad;
    --border: rgba(15, 17, 23, 0.09);
    --border-strong: rgba(15, 17, 23, 0.16);
    --nav-bg: rgba(255, 255, 255, 0.82);
    --input-bg: #ffffff;
    --skeleton: linear-gradient(90deg, #eef0f3 25%, #f7f8fa 50%, #eef0f3 75%);
    --overlay: rgba(15, 17, 23, 0.45);
}

html[data-theme="dark"] {
    --bg: #0f1117;
    --bg-elevated: #171a23;
    --surface: #171a23;
    --surface-2: #1e2230;
    --surface-3: #2a2f42;
    --text: #e9ecf3;
    --text-muted: #98a1b3;
    --text-faint: #6b7488;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --nav-bg: rgba(15, 17, 23, 0.82);
    --input-bg: rgba(255, 255, 255, 0.06);
    --skeleton: linear-gradient(90deg, #1b1f2a 25%, #232838 50%, #1b1f2a 75%);
    --overlay: rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------------------------------------
   2. 基础重置
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

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

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

[v-cloak] {
    display: none;
}

::selection {
    background: var(--brand-soft);
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-faint);
    background-clip: content-box;
}

/* --------------------------------------------------------------------------
   3. 通用组件
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--ink-1), #0f3460);
    color: #fff;
}

.btn-accent {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
}

.btn-danger {
    background: linear-gradient(135deg, #ff5b4a, #d32f2f);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--text);
    transition: var(--transition);
}

.icon-btn:hover {
    transform: scale(1.08);
    color: var(--brand);
}

.field {
    width: 100%;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.field-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-faint);
    line-height: 1.6;
}

/* ---------------- 水印一次性锁定（2026-10-18） ----------------
 * 首次开启水印后文字与位置永久不可改，界面必须让这件事一目了然：
 * 顶部整块提示 + 字段旁的「已锁定」徽标 + 输入框只读态。
 * readonly 的输入框若不换底色，用户会以为「点了没反应」，故一并给弱化样式。
 */
.wm-locked-notice {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid rgba(233, 69, 96, 0.35);
    border-left: 3px solid var(--brand);
    border-radius: 8px;
    background: var(--brand-soft);
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--text-muted);
}

.wm-locked-notice strong {
    color: var(--brand);
    font-size: 13px;
}

.wm-lock-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--brand);
    background: var(--brand-soft);
    vertical-align: middle;
}

/* 锁定后的只读输入框：弱化 + 禁止光标，传达「这不是可编辑字段」 */
.input.is-locked,
.input.is-locked:focus {
    color: var(--text-muted);
    background: var(--input-bg);
    opacity: 0.7;
    cursor: not-allowed;
    border-color: var(--border);
    box-shadow: none;
}

.input,
.textarea,
.select {
    width: 100%;
    padding: 10px 14px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.7;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.7;
    border: 1px solid transparent;
    word-break: break-word;
}

.alert-success {
    background: rgba(52, 199, 89, 0.12);
    color: #1a7f37;
    border-color: rgba(52, 199, 89, 0.3);
}

html[data-theme="dark"] .alert-success {
    color: #5ee07f;
}

.alert-error {
    background: rgba(255, 59, 48, 0.12);
    color: #c62828;
    border-color: rgba(255, 59, 48, 0.3);
}

html[data-theme="dark"] .alert-error {
    color: #ff8a80;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.14);
    color: #8d6e00;
    border-color: rgba(255, 193, 7, 0.3);
}

html[data-theme="dark"] .alert-warning {
    color: #ffd54f;
}

.alert-info {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: rgba(233, 69, 96, 0.25);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex: none;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.switch-track {
    position: absolute;
    inset: 0;
    background: var(--border-strong);
    border-radius: var(--radius-pill);
    transition: var(--transition);
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-track {
    background: var(--brand);
}

.switch input:checked + .switch-track::after {
    transform: translateX(22px);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* --------------------------------------------------------------------------
   4. 前台：导航栏 / 页脚
   -------------------------------------------------------------------------- */
.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    /* 长站名不把搜索框挤出 360px 屏：允许收缩 + 省略号 */
    min-width: 0;
    flex-shrink: 1;
}

.navbar-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-brand img {
    height: 34px;
    width: auto;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 200px;
    padding: 9px 38px 9px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    outline: none;
    transition: var(--transition);
    font-size: 14px;
}

.search-box input:focus {
    width: 280px;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.search-box svg {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-faint);
    pointer-events: none;
}

.page-body {
    padding-top: var(--nav-h);
}

.notice-bar {
    padding: 9px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.banner {
    /* 超宽屏铺满：不再限宽，仅留两侧内边距 */
    max-width: none;
    margin: 18px 0 0;
    padding: 0 16px;
}

.banner img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    /* 横幅为纯装饰：禁掉拖拽、长按弹出菜单与选中高亮，避免看起来「可点击」 */
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

.site-footer {
    margin-top: 56px;
    padding: 28px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-faint);
    border-top: 1px solid var(--border);
    line-height: 2;
}

.site-footer a:hover {
    color: var(--brand);
}

.site-footer .police {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.site-footer .police img {
    height: 15px;
    width: auto;
    display: inline;
}

/* --------------------------------------------------------------------------
   5. 瀑布流
   -------------------------------------------------------------------------- */
.waterfall {
    column-count: 4;
    column-gap: 16px;
    padding: 18px 16px 0;
    max-width: none;
    margin: 0 auto;
}

.waterfall-item {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 0 16px;
    break-inside: avoid;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
    cursor: zoom-in;
    transition: var(--transition);
}

.waterfall-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    background: var(--skeleton);
}

.waterfall-item:hover {
    box-shadow: var(--shadow-lg);
}

.waterfall-item:hover img {
    transform: scale(1.035);
}

.waterfall-item .overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 44px 14px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
    font-size: 13px;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.waterfall-item:hover .overlay {
    opacity: 1;
}

.waterfall-empty {
    padding: 110px 20px;
    text-align: center;
    color: var(--text-faint);
}

.waterfall-empty .emoji {
    font-size: 52px;
    display: block;
    margin-bottom: 14px;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 28px 16px 8px;
}

/* 骨架屏 */
.skeleton-item {
    height: 220px;
    margin: 0 0 16px;
    border-radius: var(--radius);
    background: var(--skeleton);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    break-inside: avoid;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.fade-in-up {
    animation: fadeInUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@media (max-width: 420px) {
    .waterfall {
        column-count: 1;
        column-gap: 12px;
        padding: 12px 12px 0;
    }
    .waterfall-item {
        margin-bottom: 12px;
    }
}

@media (min-width: 421px) and (max-width: 640px) {
    .waterfall {
        column-count: 2;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .waterfall {
        column-count: 2;
        column-gap: 14px;
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .waterfall {
        column-count: 3;
    }
}

@media (min-width: 1201px) and (max-width: 1500px) {
    .waterfall {
        column-count: 4;
    }
}

@media (min-width: 1501px) {
    .waterfall {
        column-count: 5;
    }
}

/* 超宽屏：铺满全屏后逐档加列，避免卡片被拉得过大 */
@media (min-width: 1800px) {
    .waterfall {
        column-count: 6;
    }
}

@media (min-width: 2200px) {
    .waterfall {
        column-count: 7;
    }
}

@media (min-width: 2600px) {
    .waterfall {
        column-count: 8;
    }
}

/* --------------------------------------------------------------------------
   6. 详情页
   -------------------------------------------------------------------------- */
.detail-page {
    height: 100vh;
    overflow: hidden;
}

.detail-layout {
    display: flex;
    height: 100vh;
}

.detail-stage {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 24px 130px;
}

.detail-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.detail-topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.55), transparent);
}

.detail-topbar a,
.detail-topbar span {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

.detail-topbar .nav-back {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.detail-topbar .nav-back:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.26);
    transform: translateY(-50%) scale(1.08);
}

.nav-arrow.prev {
    left: 18px;
}

.nav-arrow.next {
    right: 18px;
}

.detail-panel {
    width: 330px;
    flex: none;
    padding: 74px 22px 22px;
    overflow-y: auto;
    background: var(--surface);
    border-left: 1px solid var(--border);
}

.detail-panel h1 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    word-break: break-all;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap; /* 360px 屏按钮放不下时换行，不挤压 */
    gap: 8px;
    margin-bottom: 18px;
}

.detail-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.detail-table td {
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.detail-table td:first-child {
    width: 74px;
    color: var(--text-faint);
}

.detail-table td:last-child {
    text-align: right;
    word-break: break-all;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
}

.detail-strip {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 90;
    padding: 56px 20px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
}

.detail-strip-inner {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    justify-content: center;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.detail-strip-inner::-webkit-scrollbar {
    height: 5px;
}

.detail-thumb {
    width: 74px;
    height: 56px;
    flex: none;
    object-fit: cover;
    border-radius: 7px;
    opacity: 0.45;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
}

.detail-thumb:hover {
    opacity: 0.8;
}

.detail-thumb.is-active {
    opacity: 1;
    border-color: var(--brand);
    box-shadow: 0 0 14px rgba(233, 69, 96, 0.5);
}

@media (max-width: 900px) {
    .detail-panel {
        width: 280px;
    }
}

@media (max-width: 760px) {
    /* 移动端详情改为**普通文档流**：固定悬浮的信息面板会遮住图片下半部，
       360×626 下图片只剩 ~220px 高（2026-10-16 用户实测）。改为
       页面整体可滚动，图片区独立占满视口上部，信息在下方顺序展示。 */
    .detail-page {
        height: auto;
        overflow: visible;
    }
    .detail-layout {
        flex-direction: column;
        height: auto;
    }
    .detail-stage {
        height: 62vh;
        padding: 52px 12px 12px;
    }
    .detail-panel {
        position: static;
        width: 100%;
        max-height: none;
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 16px 16px 96px; /* 底部让出底栏高度 */
        overflow: visible;
    }
    /* 移动端取消左右箭头：fixed 悬浮在文档流面板文字上且点按易误触，
       翻页统一交给触摸滑动（detail.js bindSwipe，横向 ≥60px 判定） */
    .nav-arrow {
        display: none;
    }
    /* 缩略图切换条 fixed 悬浮在底部，与文件信息重叠 —— 移动端隐藏 */
    .detail-strip {
        display: none;
    }
    .nav-arrow.next {
        right: 14px;
    }
    .detail-thumb {
        width: 58px;
        height: 44px;
    }
}

/* --------------------------------------------------------------------------
   7. 搜索结果
   -------------------------------------------------------------------------- */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
    gap: 16px;
    padding: 18px 16px 0;
    max-width: 1440px;
    margin: 0 auto;
}

.result-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.result-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--skeleton);
}

.result-card .meta {
    padding: 11px 13px;
}

.result-card .meta strong {
    display: block;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-card .meta span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-summary {
    max-width: 1440px;
    margin: 0 auto;
    padding: 18px 16px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.empty-state {
    padding: 100px 20px;
    text-align: center;
    color: var(--text-faint);
}

.empty-state .emoji {
    font-size: 56px;
    display: block;
    margin-bottom: 14px;
}

.empty-state a {
    color: var(--brand);
}

/* --------------------------------------------------------------------------
   8. 登录 / 安装
   -------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 12% 8%, rgba(15, 52, 96, 0.55), transparent 60%),
        radial-gradient(800px 480px at 88% 92%, rgba(233, 69, 96, 0.45), transparent 62%),
        linear-gradient(140deg, #12152a 0%, #1a1a2e 45%, #0d1729 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    color: #fff;
}

.auth-card.is-wide {
    max-width: 760px;
}

.auth-logo {
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0f3460, var(--brand));
}

.auth-card h1 {
    margin: 0 0 6px;
    font-size: 21px;
    text-align: center;
}

.auth-card .subtitle {
    margin: 0 0 26px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.auth-card .input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.auth-card .input::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.auth-card .input:focus {
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.auth-card .field-label {
    color: rgba(255, 255, 255, 0.78);
}

.auth-footer {
    margin-top: 22px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

.check-list {
    display: grid;
    gap: 8px;
    margin-bottom: 22px;
}

.check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.07);
    font-size: 13px;
}

.check-row .ok {
    color: #4ade80;
    font-weight: 700;
}

.check-row .no {
    color: #ff7b72;
    font-weight: 700;
}

/* 安装向导的「建议项」：不阻断安装，但需要用户知情（如 .env 回退到站点内） */
.check-row .warn {
    color: #f0b429;
    font-weight: 700;
}

.section-title {
    margin: 22px 0 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

/* --------------------------------------------------------------------------
   9. 后台
   -------------------------------------------------------------------------- */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 236px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 14px;
}

.admin-brand .mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, #0f3460, var(--brand));
}

.admin-nav {
    flex: 1;
    padding: 14px 10px;
    overflow-y: auto;
}

/* 侧边栏底部：构建版本 / 资源版本（排查浏览器缓存用） */
.admin-version {
    padding: 12px 20px 16px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-faint);
    border-top: 1px solid var(--border);
}

.admin-nav-title {
    padding: 14px 12px 6px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    margin-bottom: 2px;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-muted);
    transition: var(--transition);
}

.admin-nav a svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.admin-nav a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.admin-nav a.is-active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.admin-nav a.is-danger:hover {
    background: rgba(255, 59, 48, 0.12);
    color: #ff5b4a;
}

.admin-main {
    flex: 1;
    min-width: 0;
    margin-left: 236px;
    padding: 26px 28px 60px;
}

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

.admin-head h1 {
    margin: 0;
    font-size: 20px;
    /* 手机窄屏 + 长页面标题时省略号，不把右侧用户名挤出屏幕 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.admin-head .who {
    font-size: 13px;
    color: var(--text-faint);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card .label {
    font-size: 12px;
    color: var(--text-faint);
}

.stat-card .value {
    margin-top: 4px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    background: var(--surface-2);
    white-space: nowrap;
}

.data-table td {
    padding: 11px 14px;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--surface-2);
}

.data-table .thumb {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--surface-2);
}

.data-table .thumb-holder {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    font-size: 17px;
}

.table-scroll {
    overflow-x: auto;
}

.mini-input {
    width: 100%;
    min-width: 90px;
    padding: 6px 10px;
    font-size: 12.5px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
}

.mini-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.tag-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.14);
    color: #3b82f6;
}

.tag-pill.is-on {
    background: rgba(168, 85, 247, 0.14);
    color: #a855f7;
}

.dropzone {
    padding: 38px 20px;
    text-align: center;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    cursor: pointer;
    transition: var(--transition);
}

.dropzone:hover,
.dropzone.is-over {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.dropzone .icon {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

.dropzone strong {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}

.dropzone span {
    font-size: 13px;
    color: var(--text-faint);
}

.file-list {
    margin-top: 14px;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* 逐项上传队列：外层 item 承担边框与状态底色，内部为行 + 进度条 + 说明 */
.file-item {
    border-bottom: 1px solid var(--border);
    padding: 9px 13px 10px;
}

.file-item:last-child {
    border-bottom: none;
}

/* 单项进度条（网络传输 0~90%，服务端处理 90~100%） */
.file-item .bar {
    height: 4px;
    margin-top: 7px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    overflow: hidden;
}

.file-item .bar > i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--brand);
    transition: width 0.2s ease;
}

/* 服务端处理阶段（压缩大图）：停在 92% 处呼吸闪烁，避免停滞假死感 */
.file-item .bar > i.is-working {
    width: 92%;
    animation: barWorking 1.2s ease-in-out infinite;
}

@keyframes barWorking {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* 服务端返回的说明（压缩结果 / 失败原因） */
.file-item .note {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-faint);
    word-break: break-word;
}

.file-item .note.is-error {
    color: #c62828;
}

html[data-theme="dark"] .file-item .note.is-error {
    color: #ff8a80;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.file-row .name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row .size {
    flex: none;
    color: var(--text-faint);
    font-size: 12px;
}

.file-row .tag-input {
    flex: none;
    width: 190px;
}

/* 远程文件浏览：面包屑 + 可双击进入的目录行 */
.crumb-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    font-size: 12.5px;
    color: var(--text-faint);
}

.crumb-item {
    padding: 2px 6px;
    border: 0;
    border-radius: var(--radius-sm, 6px);
    background: transparent;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}

.crumb-item:hover:not(:disabled) {
    background: var(--surface-3);
}

.crumb-item.is-current {
    color: var(--text);
    font-weight: 600;
    cursor: default;
}

.crumb-item:disabled {
    opacity: 1;
}

.crumb-sep {
    opacity: .5;
}

.file-list .file-row.is-dir {
    cursor: pointer;
}

.file-list .file-row.is-dir:hover {
    background: var(--surface-3);
}

.file-row .dir-icon {
    display: inline-block;
    width: 12px;
    margin-right: 4px;
    color: var(--accent);
}

.grid-2 {
    display: grid;
    /* min(320px, 100%)：360px 及以下的手机屏上自动收成单列，避免 320px 轨道撑破容器 */
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 18px;
}

.toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 220px;
    max-width: 380px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.6;
    box-shadow: var(--shadow);
    background: var(--surface);
    border: 1px solid var(--border);
    animation: fadeInUp 0.28s both;
    pointer-events: auto;
    word-break: break-word;
}

.toast.success {
    border-color: rgba(52, 199, 89, 0.4);
    color: #1a7f37;
}

.toast.error {
    border-color: rgba(255, 59, 48, 0.4);
    color: #c62828;
}

/* 进行中/提示类（如「已启用，正在自动同步…」）：不是成功也不是失败，
   用蓝色以便和绿色的「已保存」区分开，避免用户以为同步已经结束 */
.toast.info {
    border-color: rgba(10, 132, 255, 0.4);
    color: #0a5fd0;
}

html[data-theme="dark"] .toast.success {
    color: #5ee07f;
}

html[data-theme="dark"] .toast.error {
    color: #ff8a80;
}

html[data-theme="dark"] .toast.info {
    color: #79b8ff;
}

.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--overlay);
    backdrop-filter: blur(4px);
}

.modal {
    width: 100%;
    max-width: 400px;
    padding: 30px 26px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: fadeInUp 0.25s both;
}

.modal h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.modal p {
    margin: 0 0 22px;
    font-size: 13.5px;
    color: var(--text-muted);
}

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

.modal-actions .btn {
    flex: 1;
}

/* 取消类按钮靠右（如压缩进度弹窗） */
.modal-actions.is-end {
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-actions.is-end .btn {
    flex: none;
    min-width: 96px;
}

/* 客户端压缩进度弹窗 */
.compress-modal {
    text-align: left;
    max-width: 440px;
}

.compress-current {
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.compress-current .compress-file {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compress-current .compress-stage {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-faint);
}

.compress-count {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-faint);
    text-align: center;
}

.admin-hamburger {
    display: none;
}

@media (max-width: 1000px) {
    /* 移动端导航改为**顶部下拉面板**（2026-10-16 用户要求：侧列抽屉在真机上
       点击无响应且不符合手机操作习惯）。侧栏从视口顶部整体落下，占全宽。 */
    .admin-sidebar {
        inset: 0 0 auto 0;
        width: auto;
        max-height: 82vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        /* 顶部让出头部高度：面板上沿被下方 sticky 的 .admin-head 遮住，
           视觉上从头部下沿展开，汉堡按钮始终可点（否则面板盖住按钮，
           点第二次无法关闭 —— e2e-mobile 实测点击被遮挡超时） */
        padding-top: 54px;
        transform: translateY(-105%);
        transition: transform 0.25s ease;
        box-shadow: var(--shadow-lg);
    }
    .admin-sidebar.is-open {
        transform: none;
    }
    .admin-head {
        position: sticky;
        top: 0;
        z-index: 45;
        background: var(--bg);
        padding-bottom: 10px;
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-hamburger {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    .admin-main {
        padding: 18px 14px 60px;
    }
    .search-box input {
        width: 130px;
    }
    .search-box input:focus {
        width: 170px;
    }
    .navbar {
        padding: 0 12px;
    }
}

/* --------------------------------------------------------------------------
   10. 空状态 / 错误页
   -------------------------------------------------------------------------- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.error-card {
    max-width: 470px;
    padding: 52px 36px;
    text-align: center;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.error-card .emoji {
    font-size: 62px;
    display: block;
    margin-bottom: 16px;
    animation: floaty 3s ease-in-out infinite;
}

@keyframes floaty {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-9px);
    }
}

.error-card h1 {
    margin: 0 0 10px;
    font-size: 22px;
}

.error-card p {
    margin: 0 0 26px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   11. 交互增强层（Vue 接管后才出现，PHP 首屏不依赖）
   -------------------------------------------------------------------------- */

/* 瀑布流工具栏：吸附在导航栏下方，用于筛选与统计 */
.waterfall-toolbar {
    position: sticky;
    top: var(--nav-h);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 11px 16px;
    margin: 0 auto;
    max-width: none;
    background: var(--nav-bg);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.waterfall-toolbar .grow {
    flex: 1;
    min-width: 0;
}

.waterfall-toolbar .count {
    font-size: 12.5px;
    color: var(--text-faint);
    white-space: nowrap;
}

/* 详情页缩略图条：外层 <a> 承担点击，内层 img 复用 .detail-thumb 的尺寸 */
.detail-thumb-link {
    flex: none;
    display: block;
    border-radius: 8px;
    outline-offset: 2px;
    transition: var(--transition);
}

.detail-thumb-link:hover {
    transform: translateY(-2px);
}

/* 详情页点按放大：脱离 contain 限制，允许滚动查看原图 */
.detail-stage img.is-zoomed {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    cursor: zoom-out;
}

.detail-stage.is-scrollable {
    overflow: auto;
    align-items: flex-start;
    justify-content: flex-start;
}

/* 回到顶部 */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 26px;
    z-index: 60;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.back-to-top:hover {
    color: var(--brand);
    border-color: var(--brand);
    transform: translateY(-2px);
}

/* 标签页（新增图片：本地上传 / URL 导入） */
.tab-bar {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 18px;
    border-radius: var(--radius);
    background: var(--surface-2);
    width: fit-content;
}

.tab-btn {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.is-active {
    background: var(--surface);
    color: var(--brand);
    box-shadow: var(--shadow-sm);
}

/* 上传进度条 */
.progress {
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    overflow: hidden;
}

.progress > i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--brand);
    transition: width 0.24s ease;
}

/* ------------------------------------------------------------------ *
 * 存储自动同步进度条（后台顶栏下方，非插件页）
 *
 * 自动同步可能跑几分钟，而触发点在「存储插件」页 —— 用户保存完就跳走的话，
 * 不给任何反馈会以为页面卡住。默认 hidden，由 storage-autosync.js 显示。
 * ------------------------------------------------------------------ */
.autosync-bar {
    margin: 12px 16px 0;
    padding: 10px 14px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------ *
 * 加密密钥异常告警（服务端直出，不依赖 JS）
 *
 * APP_SECRET 与安装时不一致/丢失时，插件凭据会静默解不开，界面只表现为
 * 配置页空白。用醒目的警示条把根因说清楚（详见 docs/BUGS-FIXED.md 第 45 条）。
 * ------------------------------------------------------------------ */
.vault-warn {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 12px 16px 0;
    padding: 12px 14px;
    border: 1px solid #f0b429;
    border-left-width: 4px;
    border-radius: var(--radius-md);
    background: #fffaf0;
    color: #7a5300;
    font-size: 13px;
    line-height: 1.55;
}

.vault-warn strong {
    flex: none;
    color: #8a5a00;
}

[data-theme="dark"] .vault-warn {
    border-color: #8a6a1f;
    background: #2a2115;
    color: #f0c674;
}

[data-theme="dark"] .vault-warn strong {
    color: #f7d488;
}

.autosync-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.autosync-text {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 呼吸圆点：表明后台还在推进，而不是界面卡死 */
.autosync-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    animation: autosync-pulse 1.1s ease-in-out infinite;
}

@keyframes autosync-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(0.75); }
}

@media (prefers-reduced-motion: reduce) {
    .autosync-dot { animation: none; }
}

.file-row .state {
    flex: none;
    font-size: 12px;
    color: var(--text-faint);
    white-space: nowrap;
}

/* URL 导入结果列表：file-row 仍是列表直接子项，沿用原来的内边距与分隔线 */
.file-list > .file-row {
    padding: 9px 13px;
    border-bottom: 1px solid var(--border);
}

.file-list > .file-row:last-child {
    border-bottom: none;
}

.file-list > .file-row.is-done .state {
    color: #1a7f37;
}

html[data-theme="dark"] .file-list > .file-row.is-done .state {
    color: #5ee07f;
}

.file-list > .file-row.is-failed .state {
    color: #c62828;
}

html[data-theme="dark"] .file-list > .file-row.is-failed .state {
    color: #ff8a80;
}

/* 本地上传队列：状态 class 挂在 .file-item 上 */
/* is-compressing = 浏览器内重编码大图（本地 CPU 阶段） */
.file-item.is-compressing,
.file-item.is-uploading,
.file-item.is-processing {
    background: var(--surface-2);
}

.file-item.is-done .state {
    color: #1a7f37;
}

html[data-theme="dark"] .file-item.is-done .state {
    color: #5ee07f;
}

.file-item.is-failed .state {
    color: #c62828;
}

html[data-theme="dark"] .file-item.is-failed .state {
    color: #ff8a80;
}

/* 插件依赖检查（适配浅色后台，与安装向导的 .check-list 区分） */
.req-list {
    display: grid;
    gap: 8px;
}

.req-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 13px;
}

.req-row .ok {
    color: #1a7f37;
    font-weight: 600;
}

.req-row .no {
    color: #c62828;
    font-weight: 600;
}

/* 迁移失败明细里的标记（.req-row .no 是作用域内的，file-row 用不了） */
.file-row .state-fail {
    color: #c62828;
    font-weight: 600;
}

/* 导入导出面板里逐条结果的成功标记 */
.file-row .state-ok {
    color: #1a7f37;
    font-weight: 600;
}

html[data-theme="dark"] .file-row .state-ok {
    color: #5ee07f;
}

html[data-theme="dark"] .file-row .state-fail {
    color: #ff8a80;
}

html[data-theme="dark"] .req-row .ok {
    color: #5ee07f;
}

html[data-theme="dark"] .req-row .no {
    color: #ff8a80;
}

/* 表单栅格与操作区 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.form-actions .spacer {
    flex: 1;
}

.panel-body {
    padding: 20px;
    display: grid;
    gap: 16px;
}

/* 字段行：label 左、控件右 */
.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

.field-row:first-child {
    border-top: none;
}

.field-row .meta {
    min-width: 0;
}

.field-row .meta strong {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
}

.field-row .meta span {
    font-size: 12px;
    color: var(--text-faint);
}

.field-row .control {
    flex: none;
    width: 320px;
    max-width: 52%;
}

@media (max-width: 640px) {
    .waterfall-toolbar {
        gap: 9px;
        padding: 9px 12px;
    }
    .field-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .field-row .control {
        width: 100%;
        max-width: none;
    }
    .back-to-top {
        right: 14px;
        bottom: 18px;
    }
}

/* ====================================================================== *
 * 懒加载模糊占位渐显（2026-10-12，2026-10-17 补三路兜底）
 * 带 .lazy-blur 的图片在 load 前以模糊态显示，加载完成后过渡到清晰；
 * 标记由 head.php 内联 ES5（主，不依赖 module）与 theme.js 的捕获态委托
 * （辅，对无限滚动追加的卡片同样生效）添加。
 * ====================================================================== */
img.lazy-blur {
    filter: blur(16px);
    transform: scale(1.05);
    transition: filter 0.45s ease, transform 0.45s ease;
}

img.lazy-blur.is-loaded {
    filter: none;
    transform: none;
}

/* JS 完全不可用（极老内核或用户禁用脚本，head 内联脚本没能打上 .has-js）
   时不做模糊 —— 宁可没有渐显，也不能让图片永久糊着。见 head.php 内联块。 */
html:not(.has-js) img.lazy-blur {
    filter: none;
    transform: none;
}

/* 纯 CSS 最后一道保险：10 秒后自动清晰，不依赖 JS 定时器（手机省电模式会
   挂起 setInterval、部分内核的捕获态委托也会丢事件）。is-loaded 正常到达时
   本选择器不再匹配，动画随类名移除，无闪烁。 */
img.lazy-blur:not(.is-loaded) {
    animation: lazy-blur-timeout 0.4s ease 10s forwards;
}

@keyframes lazy-blur-timeout {
    to {
        filter: none;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* 偏好减少动态的用户不走模糊渐显：直接清晰（同时避免上面的 CSS 兜底动画
       被禁用后图片反而永久模糊） */
    img.lazy-blur,
    img.lazy-blur:not(.is-loaded) {
        transition: none;
        animation: none;
        filter: none;
        transform: none;
    }
}

/* ====================================================================== *
 * 14. 窄屏适配（2026-10-15）
 * 覆盖主流手机 CSS 宽度：320（老旧） / 360（Android 主力，含 360×626） /
 * 375（iPhone）—— 420 以下统一收紧导航与留白，360 档实测不放不下时逐项收缩。
 * ====================================================================== */
@media (max-width: 380px) {
    /* 前台导航：logo + 站名 + 搜索 + 主题按钮在 360px 内共存 */
    .navbar {
        gap: 10px;
        padding: 0 12px;
    }
    .navbar-brand {
        font-size: 16px;
        gap: 8px;
    }
    .navbar-brand img {
        height: 28px;
    }
    .navbar-brand span {
        max-width: 96px; /* 超长站名省略号，保住搜索框 */
    }
    .navbar-actions {
        gap: 8px;
    }
    .search-box input {
        width: 96px;
        padding: 8px 32px 8px 12px;
        font-size: 13px;
    }
    .search-box input:focus {
        width: 132px; /* 聚焦展开也不超过窄屏可用宽度 */
    }

    /* 后台顶栏：标题省略后右侧用户名/主题按钮不被挤出 */
    .admin-head {
        gap: 10px;
    }
    .admin-head .who {
        max-width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 首页横幅与瀑布流留白收紧，内容区更大 */
    .banner {
        padding: 0 12px;
    }
    .waterfall-toolbar {
        padding: 8px 12px;
    }
}
