/* ===== 文件床样式（阶段四 T03：全量 CSS 变量化，亮色值=原字面值逐字符一致） ===== */
:root {
  /* 21 组 --fh-* 语义变量（§1.5 表）+ 必要超集；命名禁色相、成组配对 */
  --fh-bg: #f3f5f9;               /* body 背景 */
  --fh-fg: #1f2937;               /* body/按钮/inputs 文字 */
  --fh-card-bg: #fff;             /* 卡片/顶栏/表格/页脚底 */
  --fh-border: #e5e9f2;           /* 卡片/顶栏/tabs 主边框 */
  --fh-border-soft: #eef1f6;      /* 表格行线/chart-wrap 边框 */
  --fh-accent: #2563eb;           /* 主色：链接/主按钮/进度条/选中态 */
  --fh-accent-2: #3b82f6;         /* 渐变起色 */
  --fh-accent-hover: #f1f5fb;     /* nav 链接 hover 底 */
  --fh-accent-soft: #eff6ff;      /* dropzone 拖拽态 / 九宫格选中底 */
  --fh-hover-bg: #f6f9ff;         /* tabs.on / 选中 radio 底 */
  --fh-hover-row: #fafbfe;        /* 行 hover / dropzone 底 */
  --fh-muted: #8a94a6;            /* 次要文字 / 图表轴文字 */
  --fh-muted-2: #9aa5b8;          /* 图标占位色 / 页脚 */
  --fh-muted-3: #6b7280;          /* 表头 / hero 段落 / 举报列表 */
  --fh-fg-2: #374151;             /* nav 链接 / h3 */
  --fh-fg-3: #4b5563;             /* label / tabs a */
  --fh-brand: #111827;            /* 品牌名文字 */
  --fh-input-bg: #fff;            /* 输入控件底 */
  --fh-input-border: #d7dce6;     /* 输入框/ghost 按钮边框 */
  --fh-input-bg-alt: #fafbfd;     /* 表头 / chart-wrap / 九宫格 label 底 */
  --fh-focus-ring: #bfdbfe;       /* 输入焦点外圈 */
  --fh-focus-border: #60a5fa;     /* 输入焦点边框 */
  --fh-btn-bg: #eef1f6;           /* 默认按钮底 */
  --fh-bar-bg: #e8ecf4;           /* 进度条/配额条底槽 */
  --fh-danger: #b91c1c;           /* 危险文字 */
  --fh-danger-2: #dc2626;         /* 危险文字（强调红，admin 数字） */
  --fh-danger-bg: #fee2e2;        /* btn-danger/badge-down 底 */
  --fh-ok: #065f46;               /* 成功文字 */
  --fh-ok-bg: #d1fae5;            /* btn-ok/badge-ok 底 */
  --fh-warn: #b45309;             /* 警示文字 */
  --fh-warn-2: #92400e;           /* badge-pend 文字 */
  --fh-warn-bg: #fef3c7;          /* badge-pend/nav-badge 底 */
  --fh-off-bg: #e5e7eb;           /* badge-off 底 */
  --fh-tag-bg: #eef2ff;           /* tag-chip 底 */
  --fh-tag-bg-hover: #e0e7ff;     /* tag-chip hover 底 */
  --fh-tag-border: #dfe4ff;       /* tag-chip 边框 */
  --fh-tag-fg: #4f46e5;           /* tag-chip 文字 */
  --fh-code-bg: #eef2f7;          /* 行内 code 底 */
  --fh-pre-bg: #0f172a;           /* md-pre / 恢复码块底 */
  --fh-pre-fg: #e2e8f0;           /* md-pre / 恢复码块文字 */
  --fh-shadow: 0 1px 2px rgba(16,24,40,.04); /* 卡片阴影 */
  --fh-dropzone-border: #c3cddf;  /* dropzone / 虚线层边框 */
  --fh-dropzone-bg: #fafbfe;      /* dropzone 底 */
  --fh-thumb-bg: #f5f7fb;         /* 缩略图占位底 */
  --fh-panel-bg: #f8fafc;         /* short-layer/share-panel 底 */
  --fh-flash-ok-bg: #ecfdf5;
  --fh-flash-ok-border: #a7f3d0;
  --fh-flash-err-bg: #fef2f2;
  --fh-flash-err-border: #fecaca;
  --fh-sworn-bg: #fffbeb;         /* dmca 声明底 */
  --fh-sworn-border: #fde68a;     /* dmca 声明边框 */
  --fh-footer-border: #e9edf4;    /* 页脚上边框 */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--fh-bg); color: var(--fh-fg); font-size: 15px; line-height: 1.55;
}
a { color: var(--fh-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--fh-muted); }
.small { font-size: 12.5px; }
.inline-form { display: inline; }

/* 顶栏 */
.topnav { background: var(--fh-card-bg); border-bottom: 1px solid var(--fh-border); position: sticky; top: 0; z-index: 50; }
.nav-inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 18px; }
.brand { font-weight: 700; font-size: 17px; color: var(--fh-brand); white-space: nowrap; }
.nav-links { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav-links a { padding: 7px 12px; border-radius: 8px; color: var(--fh-fg-2); white-space: nowrap; font-size: 14.5px; }
.nav-links a:hover { background: var(--fh-accent-hover); text-decoration: none; }
.nav-badge { color: var(--fh-warn) !important; background: var(--fh-warn-bg) !important; font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.quota-mini .qbar { display: inline-block; width: 90px; height: 7px; background: var(--fh-bar-bg); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.quota-mini .qbar i { display: block; height: 100%; background: linear-gradient(90deg,var(--fh-accent-2),var(--fh-accent)); }

.container { max-width: 1120px; margin: 22px auto 40px; padding: 0 16px; }

/* 卡片与布局 */
.card { background: var(--fh-card-bg); border: 1px solid var(--fh-border); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--fh-shadow); }
.card h2 { margin: 0 0 14px; font-size: 17px; }
.card h3 { margin: 18px 0 10px; font-size: 15px; color: var(--fh-fg-2); }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .grid-4, .grid-6 { grid-template-columns: repeat(3, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; } .nav-links { display: none; } }

.stat-card { background: var(--fh-card-bg); border: 1px solid var(--fh-border); border-radius: 12px; padding: 16px 18px; }
.stat-card .num { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat-card .lbl { font-size: 12.5px; color: var(--fh-muted); }

/* 按钮 */
.btn { display: inline-block; border: 1px solid transparent; border-radius: 8px; padding: 9px 18px; font-size: 14.5px; cursor: pointer; background: var(--fh-btn-bg); color: var(--fh-fg); text-decoration: none; line-height: 1.3; font-family: inherit; }
.btn:hover { filter: brightness(.96); text-decoration: none; }
.btn-primary { background: var(--fh-accent); color: #fff; }
.btn-danger { background: var(--fh-danger-bg); color: var(--fh-danger); }
.btn-ok { background: var(--fh-ok-bg); color: var(--fh-ok); }
.btn-ghost { background: transparent; border-color: var(--fh-input-border); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

/* 表单 */
label { display: block; font-size: 13.5px; color: var(--fh-fg-3); margin: 12px 0 5px; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--fh-input-border); border-radius: 8px; font-size: 14.5px; font-family: inherit; background: var(--fh-input-bg);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--fh-focus-ring); border-color: var(--fh-focus-border); }
.form-narrow { max-width: 420px; }
.radios label, .checks label { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-size: 14px; color: var(--fh-fg); }
.radios input, .checks input { width: auto; }

/* 提示 */
.flash { padding: 11px 16px; border-radius: 9px; margin-bottom: 14px; font-size: 14px; word-break: break-all; }
.flash-ok { background: var(--fh-flash-ok-bg); border: 1px solid var(--fh-flash-ok-border); color: var(--fh-ok); }
.flash-err { background: var(--fh-flash-err-bg); border: 1px solid var(--fh-flash-err-border); color: var(--fh-danger); }
.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 20px; font-weight: 500; }
.badge-ok { background: var(--fh-ok-bg); color: var(--fh-ok); }
.badge-pend { background: var(--fh-warn-bg); color: var(--fh-warn-2); }
.badge-off { background: var(--fh-off-bg); color: var(--fh-fg-3); }
.badge-down { background: var(--fh-danger-bg); color: var(--fh-danger); }

/* 上传区 */
.dropzone { border: 2px dashed var(--fh-dropzone-border); border-radius: 12px; background: var(--fh-dropzone-bg); padding: 34px 20px; text-align: center; transition: .15s; cursor: pointer; }
.dropzone.drag { border-color: var(--fh-accent); background: var(--fh-accent-soft); }
.dropzone .dz-icon { font-size: 34px; }
.dropzone .dz-hint { color: var(--fh-muted); font-size: 13px; margin-top: 6px; }
.up-progress { height: 8px; background: var(--fh-bar-bg); border-radius: 4px; overflow: hidden; margin: 12px 0 4px; display: none; }
.up-progress i { display: block; height: 100%; width: 0; background: var(--fh-accent); transition: width .15s; }
.up-results { margin-top: 14px; }
.up-item { border: 1px solid var(--fh-border); border-radius: 10px; padding: 12px 14px; margin-top: 10px; background: var(--fh-card-bg); }
.up-item .up-name { font-weight: 600; word-break: break-all; }
.up-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.up-links input { flex: 1; min-width: 220px; font-size: 12.5px; padding: 7px 9px; font-family: Consolas, monospace; }

/* 文件列表 */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=text], .toolbar select { width: auto; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.file-card { background: var(--fh-card-bg); border: 1px solid var(--fh-border); border-radius: 11px; padding: 10px; position: relative; }
.file-card .fcheck { position: absolute; top: 8px; left: 8px; z-index: 2; }
.file-thumb { height: 110px; display: flex; align-items: center; justify-content: center; background: var(--fh-thumb-bg); border-radius: 8px; overflow: hidden; color: var(--fh-muted-2); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-name { font-size: 13px; margin-top: 8px; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file-meta { font-size: 11.5px; color: var(--fh-muted); margin-top: 3px; display: flex; justify-content: space-between; align-items: center; }
.file-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* 视图切换控件（阶段一） */
.view-toggle { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }

/* 紧凑行视图（阶段一）：48px 方图 | 文件名 | 标签 | 大小 | 状态徽章 | 操作 */
.file-list { display: flex; flex-direction: column; gap: 6px; }
.fl-row { display: flex; align-items: center; gap: 10px; background: var(--fh-card-bg); border: 1px solid var(--fh-border); border-radius: 9px; padding: 7px 12px; min-height: 62px; flex-wrap: wrap; row-gap: 6px; }
.fl-row:hover { background: var(--fh-hover-row); }
.fl-row .fh-check { flex: none; }
.fl-thumb { width: 48px; height: 48px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--fh-thumb-bg); border-radius: 7px; overflow: hidden; color: var(--fh-muted-2); }
.fl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fl-name { flex: 1 1 200px; min-width: 120px; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-tags { flex: 0 1 auto; max-width: 220px; display: flex; gap: 4px; overflow: hidden; }
.fl-size { flex: none; width: 70px; text-align: right; font-size: 12.5px; color: var(--fh-muted); }
.fl-status { flex: none; width: 58px; text-align: center; }
.fl-acts { flex: none; display: flex; gap: 6px; }

/* 紧凑行 <768px 回落：两行卡片式（纯 CSS，无 JS） */
@media (max-width: 768px) {
  .fl-row { flex-wrap: wrap; row-gap: 6px; }
  .fl-name { flex: 1 1 calc(100% - 62px); }
  .fl-tags { order: 5; max-width: 100%; flex-basis: 100%; }
  .fl-size { order: 6; width: auto; flex: 1; text-align: left; }
  .fl-status { order: 7; width: auto; }
  .fl-acts { order: 8; margin-left: auto; }
}

/* 表格 */
table.table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--fh-card-bg); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--fh-border-soft); vertical-align: middle; }
.table th { color: var(--fh-muted-3); font-weight: 600; font-size: 13px; background: var(--fh-input-bg-alt); }
.table tr:hover td { background: var(--fh-hover-row); }

/* 分页 */
.pager { display: flex; gap: 6px; margin: 18px 0; flex-wrap: wrap; }

/* 广场 */
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.g-item { background: var(--fh-card-bg); border: 1px solid var(--fh-border); border-radius: 11px; overflow: hidden; }
.g-item .g-thumb { height: 170px; background: var(--fh-thumb-bg); display: flex; align-items: center; justify-content: center; }
.g-item .g-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-item .g-meta { padding: 9px 12px; font-size: 12.5px; color: var(--fh-muted); display: flex; justify-content: space-between; align-items: center; }

/* 首页 hero */
.hero { text-align: center; padding: 46px 16px 34px; }
.hero h1 { font-size: 30px; margin: 0 0 12px; }
.hero p { color: var(--fh-muted-3); max-width: 560px; margin: 0 auto 22px; }
.feature { text-align: center; padding: 14px 6px; }
.feature .fi { font-size: 26px; }
.feature b { display: block; margin: 6px 0 3px; }
.feature span { font-size: 13px; color: var(--fh-muted); }

/* 图表 */
.chart { width: 100%; height: auto; }
.chart-wrap { border: 1px solid var(--fh-border-soft); border-radius: 9px; padding: 10px; background: var(--fh-input-bg-alt); }
.catbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 8px 0; }

/* 举报/详情 */
.report-file { display: flex; gap: 14px; align-items: flex-start; }
.report-file img, .report-file .icon-holder { width: 130px; height: 130px; object-fit: cover; border-radius: 10px; background: var(--fh-thumb-bg); display: flex; align-items: center; justify-content: center; color: var(--fh-muted-2); }

/* 标签 */
.file-tags { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag-chip { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 20px; background: var(--fh-tag-bg); color: var(--fh-tag-fg); border: 1px solid var(--fh-tag-border); text-decoration: none; }
.tag-chip:hover { background: var(--fh-tag-bg-hover); text-decoration: none; }

/* 页脚 */
.footer { text-align: center; padding: 26px 16px 40px; color: var(--fh-muted-2); font-size: 13px; border-top: 1px solid var(--fh-footer-border); background: var(--fh-card-bg); }

/* 登录注册卡片 */
.auth-card { max-width: 420px; margin: 40px auto; }

/* 进度条 */
.qbar-big { height: 12px; background: var(--fh-bar-bg); border-radius: 7px; overflow: hidden; }
.qbar-big i { display: block; height: 100%; background: linear-gradient(90deg,var(--fh-accent-2),var(--fh-accent)); }

/* tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--fh-border); padding-bottom: 0; flex-wrap: wrap; }
.tabs a { padding: 8px 15px; border-radius: 8px 8px 0 0; color: var(--fh-fg-3); font-size: 14.5px; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--fh-accent); border-bottom-color: var(--fh-accent); font-weight: 600; background: var(--fh-hover-bg); }

/* ===== 瀑布流视图（阶段二 T07）===== */
.wf-grid { columns: 4; column-gap: 14px; }
@media (max-width: 1099px) { .wf-grid { columns: 3; } }
@media (max-width: 767px) { .wf-grid { columns: 2; column-gap: 10px; } }
.wf-item { break-inside: avoid; page-break-inside: avoid; -webkit-column-break-inside: avoid; position: relative; background: var(--fh-card-bg); border: 1px solid var(--fh-border); border-radius: 11px; padding: 8px; margin-bottom: 14px; overflow: hidden; }
.wf-item .fh-check { position: absolute; top: 6px; left: 6px; z-index: 2; }
.wf-media { background: var(--fh-thumb-bg); border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 64px; }
.wf-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wf-media .wf-icon { padding: 26px 0; color: var(--fh-muted-2); }
.wf-body { padding: 6px 2px 0; }
.wf-name { font-size: 13px; word-break: break-all; }
.wf-meta { font-size: 11.5px; color: var(--fh-muted); margin-top: 3px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }

/* ===== 行内改名（阶段二 T06）===== */
.fh-rename-btn { padding: 1px 6px; font-size: 12px; vertical-align: baseline; margin-left: 4px; }
.fh-rename-form { gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.fh-rename-form input[name=name] { width: 150px; padding: 4px 8px; font-size: 13px; }

/* ===== 短链展开层（阶段二 T08；阶段四保留兼容，亮色渲染不变）===== */
.fh-short-layer { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 6px; padding: 10px; background: var(--fh-panel-bg); border: 1px dashed var(--fh-dropzone-border); border-radius: 9px; }
.fh-short-layer .fh-short-url { flex: 1 1 200px; min-width: 180px; font-size: 12.5px; padding: 7px 9px; font-family: Consolas, monospace; }
.fh-short-layer .fh-short-qr { flex: 0 0 auto; }
.fh-short-layer .fh-short-qr img { border: 1px solid var(--fh-border); border-radius: 6px; background: #fff; }

/* ===== 水印九宫格位置选择（阶段二 T03）===== */
.wm-pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 320px; }
.wm-pos-grid label { margin: 0; padding: 6px 10px; border: 1px solid var(--fh-border); border-radius: 8px; background: var(--fh-input-bg-alt); display: flex; align-items: center; gap: 6px; font-size: 13px; }
.wm-pos-grid label:has(input:checked) { border-color: var(--fh-accent); background: var(--fh-accent-soft); }
.wm-pos-grid input { margin: 0; }

/* ===== Markdown 渲染区（阶段二 P1 T11）===== */
.md-body { font-size: 14.5px; }
.md-body .md-h1 { font-size: 21px; margin: 22px 0 12px; border-bottom: 2px solid var(--fh-border); padding-bottom: 8px; }
.md-body .md-h2 { font-size: 18px; margin: 20px 0 10px; }
.md-body .md-h3, .md-body .md-h4, .md-body .md-h5, .md-body .md-h6 { font-size: 15.5px; margin: 16px 0 8px; color: var(--fh-fg-2); }
.md-body .md-p { margin: 10px 0; line-height: 1.7; }
.md-body .md-hr { border: none; border-top: 1px solid var(--fh-border); margin: 18px 0; }
.md-body .md-pre { background: var(--fh-pre-bg); color: var(--fh-pre-fg); border-radius: 9px; padding: 13px 15px; overflow-x: auto; font-size: 13px; line-height: 1.6; margin: 12px 0; }
.md-body .md-pre code { background: none; padding: 0; color: inherit; }
.md-body .md-ul, .md-body .md-ol { margin: 10px 0; padding-left: 26px; line-height: 1.8; }
.md-body .md-table-wrap { overflow-x: auto; margin: 12px 0; }
.md-body .md-table { font-size: 13.5px; }
.md-body .md-table th { white-space: nowrap; }
.md-body code { background: var(--fh-code-bg); border-radius: 5px; padding: 1px 6px; font-size: 13px; font-family: Consolas, monospace; }

/* ===== 阶段三：分享展开层（T06）===== */
.share-panel { flex-basis: 100%; margin-top: 10px; padding: 14px; background: var(--fh-panel-bg); border: 1px dashed var(--fh-dropzone-border); border-radius: 10px; }
.share-panel .share-url-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.share-panel .share-url-row input { flex: 1 1 260px; min-width: 220px; font-size: 12.5px; padding: 7px 9px; font-family: Consolas, monospace; }
.share-panel .share-meta-row { margin-top: 6px; }
.share-panel .share-live { margin-bottom: 12px; }
.share-panel .share-qr { display: inline-block; padding: 8px; background: #fff; border: 1px solid var(--fh-border); border-radius: 8px; margin-top: 8px; text-align: center; }
.share-panel .share-qr svg { display: block; }
.share-panel .share-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--fh-border); }

/* ===== 分享页瀑布流/密码门（T06）===== */
.share-grid { margin-top: 14px; }
.dmca-sworn { background: var(--fh-sworn-bg); border: 1px solid var(--fh-sworn-border); border-radius: 8px; padding: 10px 12px; }

/* ===== 申诉徽章/表单（T07）===== */
.fh-appeal-form { display: none; gap: 6px; align-items: center; flex-wrap: wrap; }
.fh-appeal-form input[name=reason] { width: 220px; padding: 5px 9px; font-size: 13px; }

/* ===== 自检页三态（T05）===== */
.health-summary { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.health-table td, .health-table th { padding: 8px 10px; }

/* ===== 2FA 卡（T03/T04/T11）===== */
.twofa-setup { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin: 12px 0; }
.twofa-qr { padding: 10px; background: #fff; border: 1px solid var(--fh-border); border-radius: 10px; }
.twofa-qr svg { display: block; }
.recovery-codes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.recovery-codes code { display: block; background: var(--fh-pre-bg); color: var(--fh-pre-fg); border-radius: 7px; padding: 8px 10px; font-size: 14px; text-align: center; letter-spacing: 2px; font-family: Consolas, monospace; }
@media (max-width: 620px) { .recovery-codes { grid-template-columns: repeat(2, 1fr); } }

/* ===== 语义工具类（阶段四 T03：模板内联色等价替换专用）===== */
.text-danger { color: var(--fh-danger); }
.text-danger-2 { color: var(--fh-danger-2); }
.text-warn { color: var(--fh-warn); }
.text-ok { color: var(--fh-ok); }
.text-muted-2 { color: var(--fh-muted-2); }
.text-muted-3 { color: var(--fh-muted-3); }
.bg-thumb { background: var(--fh-thumb-bg); }
.dashed-box { border: 1px dashed var(--fh-input-border); background: var(--fh-panel-bg); }
.sep-dashed { border-bottom: 1px dashed var(--fh-border-soft); }

/* ===== 阶段四 T08：暗色模式（手动 [data-theme=dark] + 系统跟随双通道；亮色缺省=现状） ===== */
html[data-theme="dark"] {
  --fh-bg: #0f1420;
  --fh-fg: #e5e7eb;
  --fh-card-bg: #161d2c;
  --fh-border: #2a3448;
  --fh-border-soft: #232c40;
  --fh-accent: #60a5fa;
  --fh-accent-2: #3b82f6;
  --fh-accent-hover: #1c2740;
  --fh-accent-soft: #1a2740;
  --fh-hover-bg: #182238;
  --fh-hover-row: #1a2336;
  --fh-muted: #94a3b8;
  --fh-muted-2: #8493ab;
  --fh-muted-3: #9aa5b8;
  --fh-fg-2: #d1d5db;
  --fh-fg-3: #c2c9d6;
  --fh-brand: #f3f4f6;
  --fh-input-bg: #1c2434;
  --fh-input-border: #3a4560;
  --fh-input-bg-alt: #1a2233;
  --fh-focus-ring: #24447a;
  --fh-focus-border: #93c5fd;
  --fh-btn-bg: #273046;
  --fh-bar-bg: #273046;
  --fh-danger: #f87171;
  --fh-danger-2: #f87171;
  --fh-danger-bg: #3b1d1d;
  --fh-ok: #34d399;
  --fh-ok-bg: #14322a;
  --fh-warn: #fbbf24;
  --fh-warn-2: #fbbf24;
  --fh-warn-bg: #3a2c12;
  --fh-off-bg: #2c3448;
  --fh-tag-bg: #222b4a;
  --fh-tag-bg-hover: #2b3560;
  --fh-tag-border: #33406b;
  --fh-tag-fg: #a5b4fc;
  --fh-code-bg: #232c40;
  --fh-pre-bg: #0b1220;
  --fh-pre-fg: #e2e8f0;
  --fh-shadow: 0 1px 2px rgba(0,0,0,.3);
  --fh-dropzone-border: #3a4560;
  --fh-dropzone-bg: #161d2c;
  --fh-thumb-bg: #1a2233;
  --fh-panel-bg: #131a29;
  --fh-flash-ok-bg: #14322a;
  --fh-flash-ok-border: #1e5c46;
  --fh-flash-err-bg: #3b1d1d;
  --fh-flash-err-border: #6b2b2b;
  --fh-sworn-bg: #3a2c12;
  --fh-sworn-border: #6b5416;
  --fh-footer-border: #232c40;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not([data-theme="dark"]) {
    --fh-bg: #0f1420;
    --fh-fg: #e5e7eb;
    --fh-card-bg: #161d2c;
    --fh-border: #2a3448;
    --fh-border-soft: #232c40;
    --fh-accent: #60a5fa;
    --fh-accent-2: #3b82f6;
    --fh-accent-hover: #1c2740;
    --fh-accent-soft: #1a2740;
    --fh-hover-bg: #182238;
    --fh-hover-row: #1a2336;
    --fh-muted: #94a3b8;
    --fh-muted-2: #8493ab;
    --fh-muted-3: #9aa5b8;
    --fh-fg-2: #d1d5db;
    --fh-fg-3: #c2c9d6;
    --fh-brand: #f3f4f6;
    --fh-input-bg: #1c2434;
    --fh-input-border: #3a4560;
    --fh-input-bg-alt: #1a2233;
    --fh-focus-ring: #24447a;
    --fh-focus-border: #93c5fd;
    --fh-btn-bg: #273046;
    --fh-bar-bg: #273046;
    --fh-danger: #f87171;
    --fh-danger-2: #f87171;
    --fh-danger-bg: #3b1d1d;
    --fh-ok: #34d399;
    --fh-ok-bg: #14322a;
    --fh-warn: #fbbf24;
    --fh-warn-2: #fbbf24;
    --fh-warn-bg: #3a2c12;
    --fh-off-bg: #2c3448;
    --fh-tag-bg: #222b4a;
    --fh-tag-bg-hover: #2b3560;
    --fh-tag-border: #33406b;
    --fh-tag-fg: #a5b4fc;
    --fh-code-bg: #232c40;
    --fh-pre-bg: #0b1220;
    --fh-pre-fg: #e2e8f0;
    --fh-shadow: 0 1px 2px rgba(0,0,0,.3);
    --fh-dropzone-border: #3a4560;
    --fh-dropzone-bg: #161d2c;
    --fh-thumb-bg: #1a2233;
    --fh-panel-bg: #131a29;
    --fh-flash-ok-bg: #14322a;
    --fh-flash-ok-border: #1e5c46;
    --fh-flash-err-bg: #3b1d1d;
    --fh-flash-err-border: #6b2b2b;
    --fh-sworn-bg: #3a2c12;
    --fh-sworn-border: #6b5416;
    --fh-footer-border: #232c40;
  }
}
/* SVG 图表文字暗色适配（CSS 规则优先级高于 SVG 展示属性；柱形数据色保持服务端配色） */
html[data-theme="dark"] .chart text { fill: var(--fh-muted); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]):not([data-theme="dark"]) .chart text { fill: var(--fh-muted); } }

/* 主题按钮 */
.fh-theme-btn { padding: 4px 9px; font-size: 15px; line-height: 1.2; }

/* ===== 阶段四 T04：信息面板 ===== */
.fh-panel-layer { position: fixed; inset: 0; z-index: 200; background: rgba(10,15,25,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.fh-panel-card { background: var(--fh-card-bg); border: 1px solid var(--fh-border); border-radius: 12px; box-shadow: var(--fh-shadow); max-width: 640px; width: 100%; max-height: 86vh; overflow-y: auto; padding: 16px 18px; }
.fh-panel-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fh-panel-name { word-break: break-all; margin-right: auto; }
.fh-panel-meta { margin-top: 6px; }
.fh-panel-links { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.fh-panel-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fh-panel-row .fh-panel-lbl { flex: 0 0 76px; font-size: 12.5px; color: var(--fh-muted); }
.fh-panel-row input { flex: 1 1 220px; min-width: 180px; font-size: 12.5px; padding: 6px 9px; font-family: Consolas, monospace; }
.fh-panel-short { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--fh-border); }
.fh-panel-short-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fh-panel-short-out { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.fh-panel-short-out input { flex: 1 1 240px; min-width: 200px; font-size: 12.5px; padding: 7px 9px; font-family: Consolas, monospace; }

/* ===== 阶段四 T05：灯箱 ===== */
html.fh-lb-open, html.fh-lb-open body { overflow: hidden; } /* body 滚动锁 */
.fh-lb { position: fixed; inset: 0; z-index: 100; background: rgba(8,12,20,.88); display: flex; align-items: center; justify-content: center; }
.fh-lb-stage { max-width: calc(100vw - 32px); max-height: calc(100vh - 72px); overflow: auto; display: flex; align-items: center; justify-content: center; margin: 0 auto;
  /* 透明 PNG 棋盘格底（16px 双色格；暗色经变量适配） */
  background:
    linear-gradient(45deg, var(--fh-thumb-bg) 25%, transparent 25%, transparent 75%, var(--fh-thumb-bg) 75%),
    linear-gradient(45deg, var(--fh-thumb-bg) 25%, transparent 25%, transparent 75%, var(--fh-thumb-bg) 75%);
  background-color: var(--fh-input-bg-alt);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
  border-radius: 8px; }
.fh-lb-stage img { max-width: calc(100vw - 64px); max-height: calc(100vh - 110px); object-fit: contain; cursor: zoom-in; }
.fh-lb-stage img.fh-lb-actual { max-width: none; max-height: none; width: auto; height: auto; cursor: zoom-out; }
.fh-lb-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--fh-card-bg); border-top: 1px solid var(--fh-border); color: var(--fh-fg); }
.fh-lb-name { font-weight: 600; word-break: break-all; margin-right: auto; max-width: 46vw; }
.fh-lb-close, .fh-lb-prev, .fh-lb-next { position: absolute; background: var(--fh-card-bg); border: 1px solid var(--fh-border); color: var(--fh-fg);
  border-radius: 8px; width: 36px; height: 36px; font-size: 20px; cursor: pointer; line-height: 1; }
.fh-lb-close:hover, .fh-lb-prev:hover, .fh-lb-next:hover { filter: brightness(1.1); }
.fh-lb-close { top: 14px; right: 14px; }
.fh-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.fh-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.fh-lb-hint { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 110; background: var(--fh-card-bg);
  border: 1px solid var(--fh-border); color: var(--fh-fg); border-radius: 20px; padding: 7px 16px; font-size: 13px;
  box-shadow: var(--fh-shadow); opacity: 1; transition: opacity .4s; }
.fh-lb-hint-out { opacity: 0; }

/* ===== 阶段四 T06：右键菜单 + 框选蒙层 ===== */
.fh-ctx { position: fixed; z-index: 300; min-width: 210px; background: var(--fh-card-bg); border: 1px solid var(--fh-border);
  border-radius: 10px; box-shadow: var(--fh-shadow); padding: 4px; }
.fh-ctx-title { padding: 6px 10px 4px; border-bottom: 1px solid var(--fh-border-soft); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.fh-ctx button { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--fh-fg);
  font-size: 13.5px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-family: inherit; }
.fh-ctx button:hover { background: var(--fh-accent-hover); }
.fh-marquee { position: fixed; z-index: 90; border: 1px solid var(--fh-accent); background: rgba(37,99,235,.12);
  border-radius: 2px; pointer-events: none; }

/* ===== 阶段四 T07：批量上传队列 ===== */
.batch-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--fh-fg-3); cursor: pointer; }
.batch-toggle input { width: auto; margin: 0; }
.fh-queue { margin-top: 12px; border: 1px dashed var(--fh-dropzone-border); border-radius: 10px; padding: 10px 12px; background: var(--fh-panel-bg); }
.fh-q-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; color: var(--fh-muted); }
.fh-q-item { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 5px 0; border-bottom: 1px dashed var(--fh-border-soft); font-size: 13px; }
.fh-q-item .fh-q-name { word-break: break-all; max-width: 40%; }
.fh-q-item .fh-q-state { margin-left: auto; }
.fh-q-item.st-failed .fh-q-state { color: var(--fh-danger); }
.fh-q-item.st-done .fh-q-state { color: var(--fh-ok); }

/* ===== 阶段四 T10：左树右表侧栏（≥900px 左栏；<900px 折叠横滑） ===== */
.side-tree { margin-bottom: 14px; }
.side-head { font-size: 12.5px; font-weight: 600; color: var(--fh-muted); padding: 4px 2px; }
.side-albums { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.side-link { flex: none; font-size: 13px; padding: 4px 12px; border-radius: 18px; border: 1px solid var(--fh-border);
  color: var(--fh-fg-2); text-decoration: none; white-space: nowrap; background: var(--fh-card-bg); }
.side-link:hover { background: var(--fh-accent-hover); text-decoration: none; }
.side-link.on { background: var(--fh-accent); border-color: var(--fh-accent); color: #fff; font-weight: 600; }
.side-tags { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.side-tags .tag-chip { flex: none; white-space: nowrap; }
.side-tags .tag-chip b { font-weight: 600; opacity: .75; margin-left: 2px; }
.side-tags .tag-chip.tag-on { background: var(--fh-accent); border-color: var(--fh-accent); color: #fff; }
@media (min-width: 900px) {
  /* 桌面：220px 侧栏 + 主区两栏布局（侧栏浮在筛选区上方，与列表区同宽并排） */
  .side-tree { float: none; }
  .side-albums, .side-tags { flex-wrap: wrap; overflow: visible; }
  .side-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
  .side-link { white-space: normal; text-align: center; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; }
}


/* ===== 阶段六：URL 转存行 / 回收站页 / 展示页（复用既有类为主，少量补充） ===== */
.fh-urlup-row input[type="url"] { padding: 6px 10px; border: 1px solid var(--fh-input-border); border-radius: 8px;
  background: var(--fh-input-bg); color: var(--fh-fg); }
.fh-urlup-row input[type="url"]:focus { outline: none; border-color: var(--fh-focus-border); box-shadow: 0 0 0 3px var(--fh-focus-ring); }

/* 展示页（T12）：暗色棋盘格舞台 + 自适应图 */
.fh-view-card { max-width: 920px; margin: 0 auto; }
.fh-view-head { margin-bottom: 12px; }
.fh-view-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.fh-view-title b { font-size: 16px; word-break: break-all; }
.fh-view-stage { display: flex; justify-content: center; align-items: center; background: repeating-conic-gradient(#e9edf4 0% 25%, #f7f9fc 0% 50%) 0 0 / 24px 24px;
  border: 1px solid var(--fh-border-soft); border-radius: 10px; padding: 16px; margin-bottom: 12px; min-height: 120px; }
[data-theme="dark"] .fh-view-stage { background: repeating-conic-gradient(#1d2433 0% 25%, #151a26 0% 50%) 0 0 / 24px 24px; }
.fh-view-stage img { max-width: 100%; max-height: 72vh; height: auto; border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.fh-view-links { display: flex; flex-direction: column; gap: 8px; }

/* 回收站行（复用 .file-list 布局；徽章沿用 badge-down/pend） */
.files-trash-empty { text-align: center; padding: 32px 0; }
