/* ===== 图床样式（阶段四 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-ico-action: #0f9d90;       /* 行内动作图标（下载/面板/申诉）：青绿 */
  --fh-ico-action-hover: #0b8578; /* 行内动作图标 hover：加深同色 */
  --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; }
/* 独立图片上传工作台入口（up.php）：主操作给一点视觉权重，不改其余链接 */
.nav-links a.nav-up { color: var(--fh-accent); font-weight: 600; }
/* 「↑」在 600 字重下与数字 1 几乎不可分（视觉实测），换更粗的箭头字形并缩小一号 */
.nav-links a.nav-up::before { content: "⬆"; font-size: 0.82em; margin-right: 4px; vertical-align: 1px; }
.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); }
/* 中性提示（如游客上传说明）：沿用主色浅底，不引入新色相 */
.flash-info { background: var(--fh-accent-soft); border: 1px solid var(--fh-focus-ring); color: var(--fh-fg-2); }
.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); }
/* v15：广场公开标记（与外链公开正交；沿用主色浅底不引入新色相） */
.badge-gal { background: var(--fh-accent-soft); color: var(--fh-accent); }

/* 上传区 */
.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.is-disabled { cursor: not-allowed; opacity: .65; }
.dropzone.is-disabled:hover { border-color: var(--fh-dropzone-border); background: var(--fh-dropzone-bg); }
.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; }
.up-links .btn { flex: none; }
/* 上传结果项缩略图：尺寸对齐「我的文件」紧凑行，视觉同源 */
.up-item .fl-thumb { box-shadow: inset 0 0 0 1px var(--fh-border-soft); }

/* 文件列表 */
.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; }
/* v13：网格密度（后台默认 / 工具栏按人切换，列数由 --fh-cols 驱动；0=沿用上面的自适应） */
#fh-view[data-cols] .file-grid { grid-template-columns: repeat(var(--fh-cols, 4), minmax(0, 1fr)); }
.fh-cols-pick { width: auto; padding: 4px 6px; font-size: 12.5px; border-radius: 7px; }
@media (max-width: 900px) { #fh-view[data-cols] .file-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { #fh-view[data-cols] .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.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); position: relative; }
.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; align-items: center; }

/* 视图切换控件（阶段一） */
.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; align-items: center; }

/* v17b：列表视图的文件夹行 —— 与文件行同栅格混排（网盘经典形态）
   文件夹名加粗以区分类别；缩略图位用文件夹图标（或封面图）；右侧「>」提示可进入。 */
.fl-row-folder { text-decoration: none; color: var(--fh-fg); }
.fl-row-folder:hover { background: var(--fh-hover-row); text-decoration: none; }
.fl-thumb-folder { background: var(--fh-accent-soft); color: var(--fh-accent); }
.fl-thumb-folder img { width: 100%; height: 100%; object-fit: cover; }
.fl-folder-glyph { display: inline-flex; align-items: center; justify-content: center; }
.fl-name-folder { font-weight: 600; color: var(--fh-fg); }
.fl-folder-go { color: var(--fh-muted); display: inline-flex; align-items: center; justify-content: center; }
.fl-row-folder:hover .fl-folder-go { color: var(--fh-accent); }

/* v17b：网格视图的文件夹卡片（与文件卡片同栅格，排在文件之前） */
.file-card-folder { text-decoration: none; color: var(--fh-fg); }
.file-card-folder:hover { text-decoration: none; }
.file-thumb-folder { background: var(--fh-accent-soft); color: var(--fh-accent); align-items: center; justify-content: center; }
.file-folder-glyph { display: inline-flex; align-items: center; justify-content: center; }
.file-folder-badge { position: absolute; left: 8px; bottom: 8px; font-size: 10px; line-height: 1.6; padding: 0 6px;
  border-radius: 8px; background: var(--fh-accent); color: #fff; }
.file-name-folder { font-weight: 600; color: var(--fh-fg); }

/* v17b：瀑布流视图的文件夹条目（4:3 占位，与非图片卡同比例） */
/* v17c 修复：wf-item 默认 overflow:hidden 会裁掉「⋮」弹出的操作菜单；
   folder 卡片放开溢出（封面图由 .wf-media 自带圆角与裁剪，视觉不受影响）。 */
.wf-item-folder { text-decoration: none; color: var(--fh-fg); overflow: visible; }
.wf-item-folder:hover { text-decoration: none; }
.wf-media-folder { background: var(--fh-accent-soft); color: var(--fh-accent); align-items: center; justify-content: center; }
.wf-folder-glyph { color: var(--fh-accent); }
.wf-folder-badge { position: absolute; left: 8px; bottom: 8px; font-size: 10px; line-height: 1.6; padding: 0 6px;
  border-radius: 8px; background: var(--fh-accent); color: #fff; }
.wf-name-folder { font-weight: 600; color: var(--fh-fg); }

/* v17c：文件夹操作菜单（复制/剪切/移动/分享/打包/上移/下移/改名/删除）
   按钮在文件夹行尾；菜单为绝对定位浮层，点击外部或 Esc 关闭。 */
.fh-fmenu-wrap { position: relative; display: inline-flex; }
.fh-fmenu-btn { color: var(--fh-muted); }
.fh-fmenu-btn:hover, .fh-fmenu-btn[aria-expanded="true"] { color: var(--fh-accent); background: var(--fh-accent-hover); }
.fh-fmenu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; min-width: 186px;
  background: var(--fh-card-bg); border: 1px solid var(--fh-border); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(16,24,40,.14); padding: 5px; display: flex; flex-direction: column; gap: 1px;
}
.fh-fmenu[hidden] { display: none; }
.fh-fmenu .inline-form { display: contents; }
.fh-fmenu-item {
  display: flex; align-items: center; gap: 7px; width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 7px; padding: 7px 10px;
  font: inherit; font-size: 13px; color: var(--fh-fg); cursor: pointer; white-space: nowrap;
}
.fh-fmenu-item:hover { background: var(--fh-accent-hover); color: var(--fh-accent); }
.fh-fmenu-item.danger { color: var(--fh-danger); }
.fh-fmenu-item.danger:hover { background: var(--fh-danger-bg); color: var(--fh-danger); }
.fh-fmenu-select, .fh-fmenu-input {
  width: 100%; margin: 2px 0; padding: 5px 8px; font: inherit; font-size: 12.5px;
  border: 1px solid var(--fh-input-border); border-radius: 7px;
  background: var(--fh-input-bg); color: var(--fh-fg);
}
.fh-fmenu-select:focus, .fh-fmenu-input:focus { outline: none; border-color: var(--fh-focus-border); box-shadow: 0 0 0 3px var(--fh-focus-ring); }
/* 分享层嵌在菜单内 */
.fh-fmenu-share { padding: 6px; margin-top: 4px; border-top: 1px solid var(--fh-border-soft); }
.fh-fmenu-share[hidden] { display: none; }
.fh-fmenu-share .share-url-row { display: flex; gap: 6px; align-items: center; }
.fh-fmenu-share .share-url-row input { flex: 1; min-width: 0; font-size: 12px; padding: 4px 7px; }
/* 网格/瀑布流里的菜单槽位：绝对定位在卡片右上角 */
.file-fmenu-slot, .wf-fmenu-slot { position: absolute; top: 6px; right: 6px; z-index: 3; }
.fh-fmenu-share + .inline-form, .fh-fmenu-share .share-form { margin-top: 6px; }

/* v17c：「显示文件夹」开关（工具栏右端）+ 隐藏态 */
.fh-show-folder { margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--fh-fg-3); white-space: nowrap; cursor: pointer; }
.fh-show-folder input { width: auto; margin: 0; cursor: pointer; }
html.fh-hide-folders .fh-folder-item { display: none !important; }

/* 行级操作区：一排紧凑线性图标（对齐竞品文件管理器的功能区；纯图标 + title/aria-label） */
.fh-quick-del { display: inline-flex; margin: 0; }
.fh-ico-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; flex: none;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--fh-ico-action);
  cursor: pointer; line-height: 1; vertical-align: middle;
}
.fh-ico-btn svg { width: 17px; height: 17px; display: block; }
.fh-ico-btn:hover { background: var(--fh-accent-hover); border-color: var(--fh-border); color: var(--fh-ico-action-hover); text-decoration: none; }
/* 删除：默认与整排同色（对齐竞品统一功能区），hover 才转危险红；
 * 危险语义仍由确认弹窗 + title/aria-label 承担 */
.fh-ico-btn.fh-ico-danger { color: var(--fh-ico-action); }
.fh-ico-btn.fh-ico-danger:hover { background: var(--fh-danger-bg); border-color: var(--fh-danger); color: var(--fh-danger); }
.fh-ico-btn:focus-visible { outline: 2px solid var(--fh-focus-border); outline-offset: 1px; }

/* 紧凑行 <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; position: relative; }
.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-ico-action: #2dd4bf;
  --fh-ico-action-hover: #5eead4;
  --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-ico-action: #2dd4bf;
    --fh-ico-action-hover: #5eead4;
    --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：信息面板 =====
   层级体系（v14 统一，避免浮层互相压盖）：
     90  框选遮罩 fh-marquee
     200 面板遮罩 fh-panel-layer
     210 灯箱 fh-lb（**必须高于面板**，否则「灯箱查看」会被面板压住）
     220 灯箱提示 fh-lb-hint
     300 右键菜单 fh-ctx
     9999 系统公告 */
.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; }

/* ===== v14：面板分区（参考竞品「文件详情」分组卡片） ===== */
.fh-panel-sec { margin-top: 14px; border: 1px solid var(--fh-border-soft); border-radius: 10px; overflow: hidden; }
.fh-panel-sec-h { display: flex; align-items: center; gap: 7px; margin: 0; padding: 8px 12px;
  font-size: 13px; font-weight: 600; color: var(--fh-fg-2);
  background: var(--fh-input-bg-alt); border-bottom: 1px solid var(--fh-border-soft); }
.fh-panel-sec-i { font-size: 13px; line-height: 1; }
.fh-panel-sec > .fh-panel-links { margin: 0; padding: 10px 12px; }
.fh-panel-sec > .fh-panel-info { padding: 4px 12px 8px; }
/* 信息行：label 定宽 + 值自适应（长值单行省略，标题挂完整值） */
.fh-panel-info-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--fh-border-soft); }
.fh-panel-info-row:last-child { border-bottom: none; }
.fh-panel-info-lbl { flex: 0 0 76px; font-size: 12.5px; color: var(--fh-muted); }
.fh-panel-info-val { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--fh-fg);
  word-break: break-all; line-height: 1.6; }
.fh-panel-info-val .fh-panel-cp { margin-left: 4px; padding: 0 6px; font-size: 11px; line-height: 1.6; vertical-align: middle; }
/* 预览图区：点击开灯箱 */
.fh-panel-preview { margin-top: 12px; border: 1px solid var(--fh-border-soft); border-radius: 10px;
  background: var(--fh-input-bg-alt); min-height: 150px; max-height: 280px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; cursor: zoom-in; position: relative; }
.fh-panel-preview:hover { border-color: var(--fh-accent); }
.fh-panel-preview:focus-visible { outline: 2px solid var(--fh-focus-border); outline-offset: 2px; }
.fh-panel-preview img { display: block; max-width: 100%; max-height: 280px; object-fit: contain; }
.fh-panel-preview-ph { font-size: 34px; opacity: .45; user-select: none; }

/* ===== 阶段四 T05：灯箱 =====
   v14：z-index 由 100 提到 **210**（高于面板遮罩 200）——
   此前「灯箱查看」从面板里打开时，灯箱层被面板整层压住，
   表现为「图片缩在弹窗背后 / 点不到」。 */
html.fh-lb-open, html.fh-lb-open body { overflow: hidden; } /* body 滚动锁 */
.fh-lb { position: fixed; inset: 0; z-index: 210; 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: 220; 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-folders { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; flex-direction: column; }
.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) {
  /* 桌面：侧栏与主区两栏并排 */
  .side-tree { float: none; }
  .side-folders, .side-tags { flex-wrap: wrap; overflow: visible; }
  .side-folders { display: grid; grid-template-columns: 1fr; gap: 2px; }
  .side-link { white-space: normal; text-align: left; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; }
}

/* ===== v17：网盘式目录树（.ft-tree）+ 面包屑 + 子文件夹卡片 ===== */
/* 左树右表两栏：≥900px 时侧栏独立成列；<900px 单栏堆叠（侧栏回到顶部横排） */
.fh-pane { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.fh-pane-main { min-width: 0; }
@media (min-width: 900px) {
  .fh-pane { grid-template-columns: 236px minmax(0, 1fr); gap: 22px; }
  .fh-pane > .side-tree { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto;
    margin-bottom: 0; padding-right: 6px; }
}
/* 树：<details>/<summary> 承载折叠 —— 无 JS 即可展开收起，且自带键盘与读屏可访问性。
   层级用「缩进 + 左侧竖线」表达，比纯 chips 网格更能看出父子关系。 */
.ft-tree { display: block; }
.ft-node { display: block; }
.ft-node > .ft-row, .ft-node > summary.ft-row { display: flex; align-items: center; gap: 2px; }
.ft-node > summary.ft-row { list-style: none; cursor: pointer; }
.ft-node > summary.ft-row::-webkit-details-marker { display: none; }
.ft-node > summary.ft-row::marker { content: ''; }
.ft-row { min-height: 30px; border-radius: 8px; }
.ft-row:hover { background: var(--fh-accent-hover); }
.ft-caret { flex: none; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--fh-muted); transition: transform .15s ease; }
.ft-caret::before { content: ''; width: 0; height: 0; border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent; margin-left: 2px; }
.ft-caret.blank::before { display: none; }
.ft-node[open] > summary.ft-row > .ft-caret { transform: rotate(90deg); }
.ft-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px 0;
  color: var(--fh-fg-2); text-decoration: none; font-size: 13px; border-radius: 8px; }
.ft-link:hover { color: var(--fh-accent); text-decoration: none; }
.ft-link.on { color: var(--fh-accent); font-weight: 600; }
.ft-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-count { flex: none; font-size: 11px; color: var(--fh-muted); font-variant-numeric: tabular-nums; }
/* 层级缩进：嵌套 details 自带缩进，另加竖线强化父子关系 */
.ft-tree details { margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--fh-border-soft); }
.ft-tree > .ft-node { margin-left: 0; padding-left: 0; border-left: none; }

/* 面包屑：网盘式位置条，逐级可点 */
.fh-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; font-size: 13.5px; }
.fh-crumb-link { color: var(--fh-fg-3); text-decoration: none; }
.fh-crumb-link:hover { color: var(--fh-accent); text-decoration: underline; }
.fh-crumb-cur { color: var(--fh-fg); font-weight: 600; }
.fh-crumb-sep { color: var(--fh-muted-2); }
.fh-crumb-up { margin-left: auto; font-size: 12.5px; color: var(--fh-muted); text-decoration: none; }
.fh-crumb-up:hover { color: var(--fh-accent); text-decoration: underline; }

/* 子文件夹卡片区：网盘惯例「文件夹在前、文件在后」 */
.fh-subfolders { margin: 14px 0 4px; }
.fh-subfolders-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600;
  color: var(--fh-muted); padding: 2px 2px 8px; }
.fh-subfolders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fh-subcard { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--fh-border);
  border-radius: 12px; background: var(--fh-card-bg); text-decoration: none; color: var(--fh-fg);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.fh-subcard:hover { text-decoration: none; border-color: var(--fh-accent); box-shadow: var(--fh-shadow); transform: translateY(-1px); }
.fh-subcard-thumb { width: 100%; aspect-ratio: 16 / 10; border-radius: 9px; overflow: hidden; background: var(--fh-thumb-bg);
  display: flex; align-items: center; justify-content: center; }
.fh-subcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fh-subcard-icon { font-size: 30px; line-height: 1; }
.fh-subcard-name { font-size: 13.5px; font-weight: 600; color: var(--fh-fg); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.fh-subcard-meta { font-size: 11.5px; color: var(--fh-muted); }


/* ===== 阶段六：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); }

/* ===== 三通道上传（本地 / URL / Base64）：tab 条 + 面板 ===== */
.fh-up-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--fh-border);
  margin: 0 0 14px; padding: 0; }
.fh-up-tab { appearance: none; border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0;
  background: transparent; color: var(--fh-fg-3); font: inherit; font-size: 13.5px; cursor: pointer;
  padding: 8px 14px; margin-bottom: -1px; transition: background .15s, color .15s; }
.fh-up-tab:hover { background: var(--fh-accent-hover); color: var(--fh-fg); }
.fh-up-tab.on { background: var(--fh-card-bg); color: var(--fh-accent); font-weight: 600;
  border-color: var(--fh-border); box-shadow: inset 0 2px 0 var(--fh-accent); }
.fh-up-tab:focus-visible { outline: none; box-shadow: inset 0 2px 0 var(--fh-accent), 0 0 0 3px var(--fh-focus-ring); }
.fh-up-pane[hidden] { display: none !important; }
.fh-b64-input { display: block; width: 100%; min-height: 132px; resize: vertical; box-sizing: border-box;
  padding: 9px 11px; border: 1px solid var(--fh-input-border); border-radius: 8px;
  background: var(--fh-input-bg); color: var(--fh-fg); font: 12.5px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  word-break: break-all; }
.fh-b64-input:focus { outline: none; border-color: var(--fh-focus-border); box-shadow: 0 0 0 3px var(--fh-focus-ring); }
/* v14：URL 远程上传专用大框（一行一条 URL；比 Base64 框更高，等宽字体便于逐行核对） */
.fh-url-input { display: block; width: 100%; min-height: 210px; resize: vertical; box-sizing: border-box;
  padding: 11px 13px; border: 1px solid var(--fh-input-border); border-radius: 10px;
  background: var(--fh-input-bg); color: var(--fh-fg); font: 13px/1.85 ui-monospace, SFMono-Regular, Consolas, monospace;
  word-break: break-all; }
.fh-url-input:focus { outline: none; border-color: var(--fh-focus-border); box-shadow: 0 0 0 3px var(--fh-focus-ring); }
.fh-url-input::placeholder { color: var(--fh-muted); }

/* v14：文件夹管理折叠区（原独立管理页迁入「我的文件」页） */
.fh-folders-panel { padding: 0; }
.fh-folders-panel > summary { padding: 14px 16px; margin: 0; }
.fh-folders-panel > summary::-webkit-details-marker { display: none; }
.fh-folders-panel > summary::before { content: '▸'; display: inline-block; margin-right: 2px; transition: transform .15s; }
.fh-folders-panel[open] > summary::before { transform: rotate(90deg); }
.fh-folders-panel > summary:hover { color: var(--fh-accent); }
.fh-folders-panel[open] > summary { border-bottom: 1px solid var(--fh-border-soft); margin-bottom: 0; }
.fh-folders-panel .table-scroll { padding: 0 16px; }
.fh-folders-panel .table-scroll .table { margin: 12px 0; }
.fh-folders-panel > p { padding: 0 16px 14px; margin: 0; }
.fh-b64-row input[type="text"] { padding: 6px 10px; border: 1px solid var(--fh-input-border); border-radius: 8px;
  background: var(--fh-input-bg); color: var(--fh-fg); }
.fh-b64-row input[type="text"]:focus { outline: none; border-color: var(--fh-focus-border); box-shadow: 0 0 0 3px var(--fh-focus-ring); }
@media (max-width: 560px) {
  .fh-up-tab { padding: 7px 9px; font-size: 12.5px; }
}

/* 展示页（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; }

/* v11 系统公告弹窗 */
.fh-ann-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .55); padding: 16px; }
.fh-ann-overlay[hidden] { display: none; }
.fh-ann-panel { width: 480px; max-width: 100%; max-height: 82vh; overflow: auto; background: var(--fh-card-bg, #fff);
  color: var(--fh-text, #1a2332); border: 1px solid var(--fh-border-soft, #dde5ef); border-radius: 12px; padding: 18px 20px; }
[data-theme="dark"] .fh-ann-panel { background: #1d2433; color: #e6ebf5; border-color: #33405a; }
.fh-ann-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 16px; }
.fh-ann-meta { margin-bottom: 12px; }
.fh-ann-body { white-space: pre-wrap; word-break: break-word; line-height: 1.8; font-size: 14px;
  border-top: 1px solid var(--fh-border-soft, #dde5ef); border-bottom: 1px solid var(--fh-border-soft, #dde5ef);
  padding: 14px 0; margin-bottom: 14px; min-height: 40px; }
.fh-ann-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fh-ann-foot label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* v11 访问详情表格在窄屏可横向滚动 */
.table-scroll { overflow-x: auto; }

/* v16 图形验证码控件 */
.fh-captcha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.fh-captcha-img { border: 1px solid var(--fh-border-soft, #dde5ef); border-radius: 8px; background: #f6f6f8;
  cursor: pointer; display: block; max-width: 100%; height: auto; }
[data-theme="dark"] .fh-captcha-img { background: #1d2433; border-color: #33405a; }
.fh-captcha-input { width: 130px; max-width: 100%; text-transform: uppercase; letter-spacing: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.fh-captcha-note { white-space: nowrap; }
@media (max-width: 560px) {
  .fh-captcha-img { width: 140px; height: auto; }
}
