* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  /* 膜登时代品牌主题：深棕 #3A2410 + 香槟金 #C6A15B + 暖纸白 #FAF7F2 */
  --bg: #FAF7F2;
  --panel: #FFFFFF;
  --panel-2: #F7F2EA;
  --text: #2A2018;
  --muted: #8A7D6C;
  --muted-2: #A99C8A;
  --line: #EDE5D8;
  --line-soft: #F4EEE4;
  --brand: #3A2410;
  --brand-2: #7A5A32;
  --brand-soft: #F4EDE1;
  --gold: #C6A15B;
  --gold-deep: #9A7738;
  --gold-wash: #F6EFE2;
  --danger: #C0473D;
  --danger-soft: #FBEDEB;
  --green: #3E8E6E;
  --shadow-sm: 0 1px 2px rgba(58, 36, 16, .05), 0 8px 24px -14px rgba(58, 36, 16, .18);
  --shadow-lg: 0 24px 60px -24px rgba(58, 36, 16, .3);
  --radius: 14px;
  /* 品牌：强调按钮用香槟金渐变，主色深棕用于导航/文字 */
  --accent: linear-gradient(100deg, #4A3018, #3A2410);
  --accent-gold: linear-gradient(100deg, #C6A15B, #A8843F);
}

[data-theme="dark"] {
  --bg: #17110B;
  --panel: #211A12;
  --panel-2: #2A2118;
  --text: #F4EADA;
  --muted: #A89984;
  --muted-2: #7E6F5D;
  --line: #3A2E22;
  --line-soft: #32281E;
  --brand: #D8B571;
  --brand-2: #C6A15B;
  --brand-soft: #332817;
  --gold: #D8B571;
  --gold-deep: #C6A15B;
  --gold-wash: #2C2317;
  --danger: #E06A5F;
  --danger-soft: #3A201D;
  --green: #4FB98E;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .85);
  --accent: linear-gradient(100deg, #5A3E22, #3A2410);
  --accent-gold: linear-gradient(100deg, #D8B571, #B8934A);
}

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(120, 132, 160, .28); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 132, 160, .45); }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 布局 ============ */
.app { display: flex; height: 100vh; }

.sidebar {
  width: 238px;
  flex: 0 0 238px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand .logo { width: 30px; height: 30px; color: var(--brand); display: inline-flex; }
.brand .logo svg { width: 100%; height: 100%; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: .08em; }

.nav { display: grid; gap: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 42px; padding: 0 12px;
  border: 0; border-radius: 10px;
  background: none; color: var(--muted);
  font-size: 14px; cursor: pointer; text-align: left;
  transition: background .16s, color .16s;
}
.nav-item svg { width: 19px; height: 19px; flex: 0 0 19px; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }

.storage-card {
  margin-top: auto;
  background: var(--panel-2);
  border-radius: 12px;
  padding: 14px;
}
.storage-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); }
.storage-head span:last-child { font-size: 11px; color: var(--muted-2); }
.progress { height: 6px; border-radius: 6px; background: rgba(120,132,160,.18); margin: 10px 0 8px; overflow: hidden; }
.progress span {
  display: block; height: 100%; width: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .5s cubic-bezier(.2,.7,.2,1);
}
.storage-tip { font-size: 11px; color: var(--muted-2); }

.user-card { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 6px 4px; }
.avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 14px; font-weight: 600;
  text-transform: uppercase;
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--line);
}
.user-meta { min-width: 0; flex: 1; }
.user-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sub { font-size: 11px; color: var(--muted-2); margin-top: 1px; }

.icon-btn {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 9px;
  background: none; color: var(--muted);
  cursor: pointer;
  transition: background .16s, color .16s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.light { color: rgba(255,255,255,.78); }
.icon-btn.light:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ============ 主区域 ============ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px; flex: 0 0 64px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  backdrop-filter: blur(12px);
  position: relative; z-index: 10;
}
.menu-btn { display: none; }

.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1; overflow: hidden; }
.crumb {
  border: 0; background: none; color: var(--muted);
  font-size: 13.5px; cursor: pointer; padding: 5px 7px; border-radius: 7px;
  white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
.crumb:hover { background: var(--panel-2); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 500; }
.crumb-sep { color: var(--muted-2); font-size: 12px; padding: 0 1px; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.search {
  display: flex; align-items: center; gap: 8px;
  height: 36px; width: 210px;
  border: 1px solid transparent;
  background: var(--panel-2);
  border-radius: 10px;
  padding: 0 11px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--brand) 38%, transparent); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent); }
.search svg { width: 16px; height: 16px; color: var(--muted-2); flex: none; }
.search input { border: 0; outline: 0; background: none; width: 100%; font-size: 13px; color: var(--text); }
.search input::placeholder { color: var(--muted-2); }

#themeBtn .moon { display: none; }
[data-theme="dark"] #themeBtn .sun { display: none; }
[data-theme="dark"] #themeBtn .moon { display: block; }

.scroll-area { flex: 1; overflow: auto; padding: 30px 30px 60px; }
.view { max-width: 1180px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { font-size: 25px; font-weight: 600; letter-spacing: .01em; }
.page-desc { color: var(--muted); font-size: 13px; margin-top: 7px; }

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

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px; cursor: pointer;
  white-space: nowrap;
  transition: transform .16s, box-shadow .16s, background .16s, border-color .16s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--brand) 65%, transparent);
}
.btn.primary:hover { box-shadow: 0 12px 24px -9px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn.danger { color: #fff; background: var(--danger); border-color: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ============ 工具栏 ============ */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sort-group { display: flex; align-items: center; gap: 4px; }
.chip {
  border: 0; background: none; color: var(--muted);
  font-size: 12.5px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  transition: background .15s, color .15s;
}
.chip:hover { background: var(--panel-2); color: var(--text); }
.chip.active { background: var(--panel); color: var(--text); font-weight: 500; box-shadow: var(--shadow-sm); }
.sort-dir { border: 0; background: none; color: var(--muted); width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; border-radius: 7px; }
.sort-dir:hover { background: var(--panel-2); }
.sort-dir svg { width: 16px; height: 16px; transition: transform .2s; }
.sort-dir.asc svg { transform: rotate(180deg); }

.view-toggle { display: flex; gap: 2px; background: var(--panel-2); padding: 3px; border-radius: 9px; }
.view-toggle button {
  width: 30px; height: 28px; border: 0; background: none; border-radius: 7px;
  color: var(--muted-2); display: grid; place-items: center; cursor: pointer;
}
.view-toggle button svg { width: 16px; height: 16px; }
.view-toggle button.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(20,30,60,.1); }

/* ============ 文件视图 ============ */
.dropzone { position: relative; min-height: 320px; border-radius: var(--radius); }

.file-view.list { display: flex; flex-direction: column; }

.file-head, .file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 150px 116px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}
.file-head {
  height: 38px; font-size: 12px; color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: -30px; background: var(--bg); z-index: 2;
}
.file-row {
  height: 58px; border-radius: 10px; cursor: default;
  transition: background .13s;
  border-bottom: 1px solid var(--line-soft);
}
.file-row:hover { background: var(--panel); box-shadow: var(--shadow-sm); border-bottom-color: transparent; }
.file-row.selected { background: var(--brand-soft); }

.col-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.name-wrap { min-width: 0; }
.fname { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpath { display: block; font-size: 11px; color: var(--muted-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fowner { font-size: 11px; color: var(--brand); margin-top: 2px; }
/* 文件夹备注（小红书笔记归档内） */
.dir-note { display: block; max-width: 100%; margin-top: 3px; padding: 0; border: 0; background: none; font-size: 11.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: var(--muted); }
.dir-note:hover { color: var(--brand); text-decoration: underline; }
.dir-note.has-note { color: color-mix(in srgb, var(--brand) 82%, var(--muted)); }
.dir-note.note-empty { color: var(--muted-2); opacity: .7; font-size: 11px; }
.dir-note.note-readonly { cursor: default; }
.dir-note.note-readonly:hover { color: var(--muted); text-decoration: none; }
.dir-note.note-readonly.has-note:hover { color: color-mix(in srgb, var(--brand) 82%, var(--muted)); }
.file-card .dir-note { margin-top: 5px; }
.note-input { resize: vertical; min-height: 104px; line-height: 1.55; }
.note-count { text-align: right; font-size: 11px; color: var(--muted-2); margin-top: 4px; }
.col-size { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.col-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.col-ops { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity .15s; }
.file-row:hover .col-ops { opacity: 1; }
.col-ops .icon-btn { width: 30px; height: 30px; }
.col-ops .icon-btn svg { width: 16.5px; height: 16.5px; }

/* 文件类型图标 */
.ftype {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(140deg, #8a94ad, #6c7690);
  user-select: none;
}
.ftype svg { width: 20px; height: 20px; }
.ftype.folder { background: linear-gradient(140deg, #6d8bff, #4f6ef7); }
.ftype.image { background: linear-gradient(140deg, #34d399, #0ea371); }
.ftype.video { background: linear-gradient(140deg, #fbbf24, #f59e0b); }
.ftype.audio { background: linear-gradient(140deg, #f472b6, #db2777); }
.ftype.pdf { background: linear-gradient(140deg, #fb7185, #e11d48); }
.ftype.doc { background: linear-gradient(140deg, #60a5fa, #2563eb); }
.ftype.sheet { background: linear-gradient(140deg, #34d399, #059669); }
.ftype.slide { background: linear-gradient(140deg, #fb923c, #ea580c); }
.ftype.archive { background: linear-gradient(140deg, #a78bfa, #7c3aed); }
.ftype.code { background: linear-gradient(140deg, #22d3ee, #0891b2); }
.ftype.text { background: linear-gradient(140deg, #94a3b8, #64748b); }

/* 网格视图 */
.file-view.grid {
  display: block;
  padding: 4px 2px;
}
.file-view.grid .folder-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.file-view.grid .folder-list .file-row {
  height: 54px;
}
.file-grid {
  column-count: 4;
  column-gap: 14px;
}
.file-grid .file-card {
  display: inline-block;
  width: 100%;
  margin-bottom: 14px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.file-grid .file-card .thumb {
  height: auto;
}
.file-grid .file-card .thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
@media (max-width: 1024px) {
  .file-grid { column-count: 3; }
}
@media (max-width: 820px) {
  .file-grid { column-count: 2; }
}
.file-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  padding: 14px 12px 12px;
  cursor: default;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  overflow: hidden;
}
.file-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--line); }
.file-card .thumb {
  height: 122px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--panel-2);
  margin-bottom: 11px; overflow: hidden;
}
.file-card .thumb .ftype { width: 46px; height: 46px; flex: none; border-radius: 11px; font-size: 11px; }
.file-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.card-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-ops { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.file-card:hover .card-ops { opacity: 1; }
.card-ops .icon-btn { width: 28px; height: 28px; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(6px); box-shadow: 0 1px 4px rgba(20,30,60,.14); }
.card-ops .icon-btn svg { width: 15px; height: 15px; }

/* 拖放提示 */
.drop-hint {
  position: absolute; inset: 0; z-index: 5;
  border: 2px dashed var(--brand);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 7%, var(--bg));
  display: none; place-items: center;
  pointer-events: none;
}
.dropzone.dragover .drop-hint { display: grid; }
.drop-hint-inner {
  padding: 14px 26px; border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow-lg);
  color: var(--brand); font-weight: 500;
}

/* 空状态 */
.empty { text-align: center; padding: 70px 20px 40px; }
.empty-art { width: 96px; height: 96px; margin: 0 auto 18px; color: var(--brand); opacity: .55; }
.empty-art svg { width: 100%; height: 100%; }
.empty h3 { font-size: 15.5px; font-weight: 500; }
.empty p { font-size: 13px; color: var(--muted); margin-top: 7px; }

/* ============ 下载记录 ============ */
.dl-filter { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.dl-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.dl-select-all { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.dl-select-all input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.chip { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12.5px; cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.dl-row { display: grid; grid-template-columns: 36px minmax(0,1fr) 88px minmax(140px,1fr) 116px; align-items: center; gap: 12px; padding: 0 14px; height: 62px; border-bottom: 1px solid var(--line-soft); border-radius: 10px; }
.dl-row:hover { background: var(--panel); }
.dl-head { height: 36px; font-size: 12px; color: var(--muted-2); border-bottom: 1px solid var(--line); grid-template-columns: 36px minmax(0,1fr) 88px minmax(140px,1fr) 116px; }
.col-check { display: flex; align-items: center; justify-content: center; }
.col-check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.dl-ic { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.dl-ic svg { width: 18px; height: 18px; }
.dl-row.done .dl-ic { background: rgba(40,167,107,.12); color: var(--green); }
.dl-row.err .dl-ic { background: rgba(224,66,66,.12); color: var(--danger); }
.col-status { font-size: 12.5px; }
.dl-status { padding: 3px 10px; border-radius: 6px; font-size: 12px; }
.st-downloading { background: var(--brand-soft); color: var(--brand); }
.st-completed { background: rgba(40,167,107,.12); color: var(--green); }
.st-failed { background: rgba(224,66,66,.12); color: var(--danger); }
.st-canceled { background: var(--panel-2); color: var(--muted); }
.col-prog { display: flex; align-items: center; gap: 8px; }
.dl-bar { flex: 1; height: 6px; border-radius: 6px; background: rgba(120,132,160,.18); overflow: hidden; }
.dl-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .25s; }
.dl-row.done .dl-bar span { background: var(--green); }
.dl-row.err .dl-bar span { background: var(--danger); }
.dl-pct { font-size: 12px; color: var(--muted-2); width: 34px; text-align: right; flex: none; }
.dl-row .col-ops { display: flex; justify-content: flex-end; gap: 2px; opacity: 1; }
.dl-row .col-ops .icon-btn { width: 30px; height: 30px; }
.dl-row .col-ops .icon-btn svg { width: 16.5px; height: 16.5px; }
@media (max-width: 720px) {
  /* 下载记录两行布局：放开固定高度，避免内容溢出 */
  .dl-row { grid-template-columns: 32px minmax(0,1fr) 70px; grid-template-rows: auto auto; row-gap: 6px; height: auto; min-height: 62px; padding: 10px 12px; }
  .col-check { grid-row: 1; grid-column: 1; }
  .col-status { grid-column: 3; grid-row: 1; justify-self: end; }
  .col-prog { grid-column: 2; grid-row: 2; }
  .col-ops { grid-column: 3; grid-row: 2; justify-self: end; }
  .dl-tools { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* 骨架/加载 */
.skeleton-row { height: 58px; border-radius: 10px; background: linear-gradient(90deg, var(--panel-2) 25%, var(--line-soft) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============ 分享列表 ============ */
.share-list { display: grid; gap: 10px; }
.share-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 14px 16px;
  transition: box-shadow .16s, border-color .16s;
}
.share-item:hover { box-shadow: var(--shadow-sm); border-color: var(--line); }
.share-info { flex: 1; min-width: 0; }
.share-name { font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.share-name .tag { font-size: 10.5px; font-weight: 500; color: var(--brand); background: var(--brand-soft); padding: 2px 7px; border-radius: 5px; }
.share-meta { font-size: 11.5px; color: var(--muted-2); margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.share-actions { display: flex; gap: 6px; flex: none; }

/* ============ 右键菜单 ============ */
.context-menu {
  position: fixed; z-index: 200;
  min-width: 168px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: pop .13s ease-out;
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-3px); } }
.ctx-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; height: 34px; padding: 0 10px;
  border: 0; background: none; border-radius: 7px;
  color: var(--text); font-size: 13px; text-align: left; cursor: pointer;
}
.ctx-item svg { width: 16px; height: 16px; color: var(--muted); }
.ctx-item:hover { background: var(--panel-2); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger svg { color: var(--danger); }
.ctx-sep { height: 1px; background: var(--line); margin: 5px 6px; }

/* ============ 模态 ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(14, 18, 32, .42);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fade .16s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 400px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: modalIn .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal h3 { font-size: 16.5px; font-weight: 600; }
.modal .modal-desc { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.modal .input {
  width: 100%; height: 44px; margin-top: 18px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); color: var(--text);
  padding: 0 13px; font-size: 14px; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.modal .input:focus { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.modal .select { width: 100%; height: 44px; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); padding: 0 10px; font-size: 13.5px; outline: none; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin: 16px 0 -6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.move-toolbar { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
.move-path { font-size: 12px; color: var(--muted-2); word-break: break-all; }
.move-owner {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  max-width: 42%;
  cursor: pointer;
}
.move-owner:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.move-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 280px;
  overflow: auto;
  background: var(--panel-2);
}
.move-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line-soft);
  background: transparent; color: var(--text); font-size: 13px;
  cursor: pointer; text-align: left;
}
.move-item:last-child { border-bottom: 0; }
.move-item:hover { background: var(--panel); }
.move-item svg { width: 18px; height: 18px; color: var(--brand); flex: 0 0 auto; }
.move-loading { padding: 16px; text-align: center; font-size: 12px; color: var(--muted-2); }
.modal-error { font-size: 12.5px; color: var(--danger); min-height: 17px; margin-top: 10px; }
.delete-warning {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.6;
}
.describe-block { margin-top: 16px; }
.describe-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.describe-label em { font-style: normal; font-size: 11px; font-weight: 400; color: var(--danger); }
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel);
  font-size: 12.5px; color: var(--text);
  cursor: pointer; user-select: none;
  transition: border-color .15s, background .15s, color .15s;
}
.choice input { width: 15px; height: 15px; accent-color: var(--brand); }
.choice:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--brand-soft); color: var(--brand); }
.modal .describe-textarea { width: 100%; height: 84px; margin-top: 0; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.describe-hint { margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.modal-file { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px; background: var(--panel-2); border-radius: 11px; }
.modal-file .fname { font-size: 13px; }
.modal-file .fpath { font-size: 11px; }

.share-link-box { display: flex; gap: 8px; margin-top: 10px; }
.share-link-box input { flex: 1; height: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--text); padding: 0 11px; font-size: 12.5px; outline: none; }
.share-result-tip { display: flex; align-items: center; gap: 7px; margin-top: 16px; font-size: 12.5px; color: var(--green); }
.share-result-tip svg { width: 16px; height: 16px; }

/* 分享二维码：白底卡片，保证暗色主题下也能被微信正常识别 */
.share-qr {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  margin-top: 16px; padding: 14px 14px 12px;
  background: #fff; border-radius: 12px; border: 1px solid var(--line);
}
.share-qr[hidden] { display: none; }
.share-qr-img img { display: block; width: 168px; height: 168px; border-radius: 6px; }
.share-qr-tip { font-size: 11.5px; line-height: 1.5; color: #7a7a7a; text-align: center; }

/* ============ 上传队列 ============ */
.upload-dock {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 330px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: dockIn .25s cubic-bezier(.2,.8,.3,1);
}
@keyframes dockIn { from { opacity: 0; transform: translateY(16px); } }
.dock-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px 11px;
  border-bottom: 1px solid var(--line-soft);
}
.dock-title { font-size: 13px; font-weight: 500; }
.dock-sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.dock-body { max-height: 220px; overflow: auto; padding: 8px; }
.dock-item { padding: 7px; border-radius: 8px; }
.dock-item:hover { background: var(--panel-2); }
.dock-item-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.dock-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.dock-item-pct { color: var(--muted-2); flex: none; }
.dock-bar { height: 4px; border-radius: 4px; background: rgba(120,132,160,.18); margin-top: 6px; overflow: hidden; }
.dock-bar span { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .2s; }
.dock-item.done .dock-bar span { background: var(--green); }
.dock-item.error .dock-bar span { background: var(--danger); }

/* ============ Toast ============ */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  background: rgba(24, 30, 48, .92); color: #fff;
  font-size: 13px; box-shadow: var(--shadow-lg);
  animation: toastIn .25s cubic-bezier(.2,.8,.3,1);
}
.toast.error { background: rgba(196, 42, 48, .95); }
.toast svg { width: 16px; height: 16px; flex: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ============ 预览 ============ */
.preview-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(8, 10, 18, .92);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column;
  animation: fade .18s ease-out;
}
.preview-head {
  height: 60px; flex: 0 0 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; color: #fff;
}
.preview-name { font-size: 13.5px; color: rgba(255,255,255,.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-tools { display: flex; gap: 6px; flex: none; }
.preview-body { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding: 0; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.preview-body video { max-width: 100%; max-height: 100%; border-radius: 8px; background: #000; }
.preview-body audio { width: min(520px, 100%); }
.preview-body iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; background: #fff; }
.preview-body pre {
  width: min(900px, 100%); max-height: 100%; overflow: auto;
  background: rgba(255,255,255,.06); color: #dfe5f5;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 20px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  user-select: text; -webkit-user-select: text;
}
.preview-text-wrap { width: min(900px, 100%); max-height: 100%; display: flex; flex-direction: column; min-height: 0; }
.preview-text-bar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; flex: none; }
.preview-copy {
  height: 30px; padding: 0 13px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 7px;
  background: rgba(255,255,255,.08); color: #dfe5f5;
  font-family: inherit; font-size: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.preview-copy:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); }
.preview-copy:active { transform: scale(.97); }
.preview-text-wrap pre { width: 100%; margin: 0; max-height: calc(100vh - 160px); }
.preview-editor {
  width: 100%; margin: 0; height: min(62vh, calc(100vh - 190px)); max-height: calc(100vh - 170px);
  resize: none; outline: none; padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 10px;
  background: rgba(0,0,0,.32); color: #e8edf9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7;
  white-space: pre-wrap; overflow: auto;
  box-sizing: border-box;
}
.preview-editor:focus { border-color: rgba(255,255,255,.42); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.preview-save-status { margin-right: auto; align-self: center; font-size: 12px; color: rgba(255,255,255,.62); }
.preview-save { background: var(--brand); border-color: var(--brand); color: #fff; }
.preview-save:hover { background: color-mix(in srgb, var(--brand) 86%, #fff); border-color: color-mix(in srgb, var(--brand) 86%, #fff); }
.preview-fallback { text-align: center; color: rgba(255,255,255,.75); }
.preview-fallback svg { width: 72px; height: 72px; opacity: .5; margin-bottom: 14px; }
.preview-fallback p { font-size: 13px; margin-bottom: 16px; }
.preview-fallback a {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 9px;
  background: #fff; color: #151b34; font-size: 13px;
}

/* ============ 拍照 / 上传选择 ============ */
.camera-btn { display: none; }

.upload-sheet { position: fixed; inset: 0; z-index: 210; }
.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 24, .45);
  backdrop-filter: blur(2px);
  animation: fade .18s ease-out;
}
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--panel);
  border-radius: 18px 18px 0 0;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  animation: sheetUp .26s cubic-bezier(.2, .8, .3, 1);
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-title {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  padding: 8px 0 12px;
}
.sheet-item {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14.5px;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.sheet-item:active { background: var(--brand-soft); border-color: var(--brand); }
.sheet-item svg { width: 21px; height: 21px; color: var(--brand); flex: none; }
.sheet-cancel {
  width: 100%;
  height: 48px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

@media (max-width: 820px) {
  .camera-btn { display: inline-flex; }
}

/* ============ 批次上传 ============ */
.batch-dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 95;
  width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: dockIn .25s cubic-bezier(.2, .8, .3, 1);
}
.batch-thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 12px;
  max-height: 150px;
  overflow: auto;
}
.batch-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
}
.batch-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.batch-item .vinmark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 22px;
  background: rgba(10, 14, 24, .68);
  color: #fff;
  font-size: 10.5px;
  cursor: pointer;
}
.batch-item .vinmark input {
  width: 12px;
  height: 12px;
  accent-color: var(--brand);
  cursor: pointer;
}
.batch-item .vinmark:has(input:checked) {
  background: rgba(79, 110, 247, .92);
}
.batch-vin-tip {
  padding: 10px 14px 0;
  font-size: 11.5px;
  color: var(--muted-2);
}
.batch-vin-check {
  margin: 8px 12px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.batch-vin-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.batch-vin-check img {
  width: 44px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 auto;
  background: var(--panel);
}
.batch-vin-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.35;
}
.batch-vin-meta strong { font-size: 12px; color: var(--text); }
.batch-vin-hint {
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted-2);
  line-height: 1.3;
}
.batch-vin-check .btn { flex: 0 0 auto; padding-left: 10px; padding-right: 10px; }
.batch-type-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 0;
  font-size: 11.5px;
  color: var(--muted-2);
}
.batch-type-row select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  outline: none;
}
.batch-actions { display: flex; gap: 8px; padding: 10px 12px 12px; }
.batch-actions .btn { flex: 1; justify-content: center; }

/* ============ 批量选择 ============ */
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.row-check {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  flex: none;
  accent-color: var(--brand);
  cursor: pointer;
}
.card-check {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 4;
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
}
.select-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 96;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.select-bar span { font-size: 13px; white-space: nowrap; }
.select-actions { display: flex; gap: 8px; }
#selectModeBtn.active { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

@media (max-width: 720px) {
  .select-bar { left: 12px; right: 12px; transform: none; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .select-bar span { font-size: 12px; white-space: nowrap; }
  .select-actions { flex-wrap: wrap; gap: 6px; }
  .select-actions .btn.small { padding: 0 10px; font-size: 12px; height: 30px; }
  .toolbar-right { gap: 6px; }
}
.batch-tip { padding: 0 14px 10px; font-size: 11.5px; color: var(--muted-2); }

/* ============ 上传统计 ============ */
.stat-range {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--panel);
  color: var(--text);
  padding: 0 34px 0 12px;
  font-size: 13px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237a8299' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.stat-table { display: flex; flex-direction: column; }
.stat-row {
  display: grid;
  grid-template-columns: 110px 68px 50px 50px 70px 70px 62px minmax(0, 1.7fr) 104px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.stat-row:nth-child(even) { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.stat-head {
  font-size: 12px;
  color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  padding-top: 4px;
  padding-bottom: 10px;
}
.stat-num-cell { font-weight: 600; }

@media (max-width: 720px) {
  .batch-dock { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .stat-row { grid-template-columns: 90px 38px 46px 46px 40px minmax(0, 1.4fr); gap: 6px; }
  .stat-row:not(.stat-head) > span:nth-child(2), .stat-head > span:nth-child(2) { display: none; }
}

/* ============ 用户管理 ============ */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
  line-height: 1;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
}
.stat-num { font-size: 24px; font-weight: 600; letter-spacing: .01em; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 5px; }

.admin-block { margin-bottom: 28px; }
.admin-desc { font-size: 12.5px; color: var(--muted-2); line-height: 1.65; margin: -4px 0 10px; }
.tmpl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tmpl-chip {
  height: 26px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel-2); color: var(--muted);
  font-family: inherit; font-size: 11.5px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tmpl-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.tmpl-editor {
  width: 100%; min-height: 280px; resize: vertical;
  padding: 14px 16px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.tmpl-editor:focus {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.tmpl-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.tmpl-status { margin-right: auto; font-size: 12px; color: var(--muted-2); }
.wb-row { display: flex; gap: 8px; align-items: center; }
.wb-input {
  flex: 1 1 auto; height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); color: var(--text);
  font-size: 13.5px; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.wb-input:focus {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.admin-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.admin-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 500;
  display: inline-grid;
  place-items: center;
}
.admin-list { display: grid; gap: 8px; }

.admin-user {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px 14px;
  transition: box-shadow .16s, border-color .16s;
}
.admin-user:hover { box-shadow: var(--shadow-sm); border-color: var(--line); }

.admin-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.admin-info { flex: 1; min-width: 0; }
.admin-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 500; }
.admin-meta { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 7px; flex: none; justify-content: flex-end; }

.role-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--brand);
  background: var(--brand-soft);
}
.status-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 500;
}
.status-tag.pending { color: #b45309; background: #fef3c7; }
.status-tag.active { color: #0b7a5a; background: #e3f7ef; }
.status-tag.rejected { color: #c62a2f; background: #fdeeee; }
.status-tag.disabled { color: #5b6478; background: #eef1f6; }

[data-theme="dark"] .status-tag.pending { color: #fbbf24; background: rgba(251, 191, 36, .14); }
[data-theme="dark"] .status-tag.active { color: #2dd4a0; background: rgba(45, 212, 160, .14); }
[data-theme="dark"] .status-tag.rejected { color: #ff6b70; background: rgba(255, 107, 112, .14); }
[data-theme="dark"] .status-tag.disabled { color: #9aa6bd; background: rgba(148, 163, 184, .14); }

.admin-empty {
  padding: 26px 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted-2);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* 文件夹权限 */
.perm-mode { display: grid; gap: 8px; margin-top: 16px; }
.perm-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.perm-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.perm-option input { accent-color: var(--brand); }
.perm-option span { font-size: 13px; }

.perm-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  max-height: 190px;
  overflow: auto;
}
.perm-folder {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
}
.perm-folder input { accent-color: var(--brand); }
.perm-folder:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.perm-folders.readonly { opacity: .55; }
.perm-empty { font-size: 12.5px; color: var(--muted-2); }

@media (max-width: 720px) {
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-user { flex-wrap: wrap; }
  .admin-actions { width: 100%; padding-left: 50px; }
}

/* ============ 响应式 ============ */
.sidebar-mask { display: none; }

@media (max-width: 1024px) {
  .search { width: 160px; }
  .file-head:not(.dl-head), .file-row { grid-template-columns: minmax(0,1fr) 84px 128px 96px; }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.2,.8,.3,1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .sidebar-mask { display: block; position: fixed; inset: 0; background: rgba(10,14,24,.4); z-index: 15; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sidebar-mask.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; }
  .scroll-area { padding: 22px 16px 50px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .search { width: 36px; padding: 0; justify-content: center; background: none; }
  .search svg { margin: auto; }
  .search input { display: none; }
  .search.open { position: absolute; left: 14px; right: 14px; top: 13px; width: auto; background: var(--panel); border-color: var(--line); padding: 0 11px; justify-content: flex-start; z-index: 3; }
  .search.open input { display: block; }
  .page-head { flex-direction: column; align-items: stretch; gap: 16px; }
  .head-actions { justify-content: flex-start; }
  .file-head { display: none; }
  /* 以下 grid-area 规则只作用于文件列表行：
     下载记录行（.dl-row）复用了 col-name/col-ops 类，但有自己的网格布局，
     若被这里的命名区域波及会把文件名/按钮挤到隐式网格线上导致错乱溢出 */
  .file-row { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "name ops" "meta ops"; height: auto; padding: 12px 8px; gap: 4px 10px; }
  .file-row .col-name { grid-area: name; }
  .file-row .col-size { grid-area: meta; padding-left: 50px; }
  .file-row .col-time { display: none; }
  .file-row .col-ops { grid-area: ops; opacity: 1; }
  .file-row .col-ops .icon-btn[data-act="download"], .file-row .col-ops .icon-btn[data-act="share"] { display: none; }
  .upload-dock { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .preview-body { padding: 0; }
  .search.open ~ #themeBtn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
/* 图片预览缩放 */
.preview-zoom {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.preview-zoom img {
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: calc(100vh - 60px);
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  transition: transform .12s ease-out;
  -webkit-user-drag: none;
  cursor: grab;
}
.preview-zoom.dragging img {
  transition: none;
  cursor: grabbing;
}

.upload-rules {
  margin: 16px 0 4px;
  padding-left: 20px;
  display: grid;
  gap: 9px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}
.upload-rules li::marker { color: var(--brand); font-weight: 600; }

.dept-table { display: flex; flex-direction: column; margin-bottom: 20px; }
.dept-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 56px 84px 84px 72px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.dept-head { font-size: 12px; color: var(--muted-2); border-bottom: 1px solid var(--line); }
@media (max-width: 720px) {
  .dept-row { grid-template-columns: minmax(0, 1fr) 44px 50px 70px 70px 60px; gap: 6px; padding: 9px 8px; }
}

.missing-block { margin-bottom: 22px; }
.missing-list { display: flex; flex-direction: column; gap: 8px; }
.missing-row {
  display: grid;
  grid-template-columns: 140px 90px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  font-size: 13px;
}
.missing-user { font-weight: 500; }
.missing-dept { color: var(--muted-2); }
.missing-dates { color: var(--danger); font-size: 12.5px; }
@media (max-width: 720px) {
  .missing-row { grid-template-columns: 100px minmax(0, 1fr); }
  .missing-dept { display: none; }
}

.stat-filters { flex-wrap: wrap; }
.stat-date {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  padding: 0 8px;
  font-size: 12.5px;
  outline: none;
}
.stat-date-sep { font-size: 12px; color: var(--muted-2); }
@media (max-width: 820px) {
  .stat-filters { gap: 6px; }
  .stat-date { flex: 1; min-width: 118px; }
}

.missing-list { display: flex; flex-direction: column; gap: 10px; }
.missing-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px 14px;
}
.missing-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 8px;
}
.missing-name { font-weight: 500; }
.missing-count { color: var(--danger); font-size: 12.5px; white-space: nowrap; }
.missing-date-list { display: flex; flex-wrap: wrap; gap: 6px; }
.missing-date {
  font-size: 11.5px;
  color: var(--danger);
  background: var(--danger-soft);
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.stat-status { font-size: 11px; padding: 2px 7px; border-radius: 5px; justify-self: center; white-space: nowrap; }
.stat-status.ok { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.stat-status.miss { color: var(--danger); background: var(--danger-soft); }

.miss-cell { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.miss-date {
  font-size: 11px;
  color: var(--danger);
  background: var(--danger-soft);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.stat-miss-count { color: var(--danger); }

/* ============ 上传统计 · 视觉升级 ============ */
#view-stats .page-head { align-items: flex-start; margin-bottom: 20px; }
#view-stats .page-desc { max-width: 62ch; }

.stat-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 7px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.stat-dates {
  display: flex; align-items: center; gap: 4px;
  padding: 3px;
  background: var(--panel-2);
  border-radius: 10px;
}
.stat-toolbar .stat-date {
  height: 34px; min-width: 118px;
  border: 0; border-radius: 8px;
  background: transparent;
  font-size: 12.5px;
  padding: 0 8px;
}
.stat-toolbar .stat-date:hover { background: color-mix(in srgb, var(--panel) 72%, transparent); }
.stat-toolbar .stat-date:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 0; }
.stat-date-sep { font-size: 11.5px; color: var(--muted-2); padding: 0 1px; }
.stat-toolbar .stat-range { height: 36px; border-color: transparent; background-color: transparent; }
.stat-toolbar .stat-range:hover { background-color: var(--panel-2); }
.stat-toolbar .stat-range:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 0; }
.stat-export {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px;
}
.stat-export svg { width: 15px; height: 15px; }
.stat-export:active { transform: scale(.98); }

/* KPI 非对称卡片 */
.stat-kpi {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-auto-rows: minmax(100px, auto);
  gap: 12px;
  margin-bottom: 6px;
}
.stat-kpi .stat-card {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(22, 32, 64, .03);
  transition: transform .28s cubic-bezier(.16, 1, .3, 1), box-shadow .28s, border-color .2s;
}
.stat-kpi .stat-card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: var(--shadow-sm); }
.stat-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.stat-icon {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-hint { font-size: 11px; color: var(--muted-2); letter-spacing: .02em; }
.stat-kpi .stat-num {
  margin-top: auto;
  font-size: 28px; font-weight: 650;
  letter-spacing: -.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-kpi .stat-label { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.stat-kpi .stat-card.is-primary {
  grid-column: 1; grid-row: 1 / span 2;
  justify-content: center;
  padding: 22px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 13%, var(--panel)), var(--panel) 58%);
  border-color: color-mix(in srgb, var(--brand) 20%, var(--line-soft));
}
.stat-kpi .stat-card.is-primary .stat-icon { width: 34px; height: 34px; border-radius: 11px; }
.stat-kpi .stat-card.is-primary .stat-icon svg { width: 19px; height: 19px; }
.stat-kpi .stat-card.is-primary .stat-num { font-size: 42px; color: var(--brand); }
.stat-kpi .stat-card.is-primary .stat-label { font-size: 13px; color: var(--muted); }
.stat-kpi .stat-card.is-danger .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat-kpi .stat-card.is-danger .stat-num { color: var(--danger); }

/* 骨架 */
.stat-skeleton { pointer-events: none; }
.stat-skeleton:hover { transform: none; box-shadow: 0 1px 2px rgba(22, 32, 64, .03); border-color: var(--line-soft); }
.sk-line {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--line-soft) 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.sk-hint { width: 28px; height: 28px; border-radius: 9px; }
.sk-num { width: 64%; height: 24px; margin-top: 12px; }
.sk-label { width: 46%; height: 11px; margin-top: 8px; }
.stat-card.is-primary .sk-num { height: 36px; }
.sk-table { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; }
.sk-table-row {
  height: 46px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(90deg, transparent 25%, color-mix(in srgb, var(--panel-2) 85%, transparent) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.sk-table-row:last-child { border-bottom: 0; }

/* 区块标题 */
.stat-section-head { display: flex; align-items: baseline; gap: 10px; margin: 22px 2px 10px; }
.stat-section-head h2 { font-size: 14.5px; font-weight: 600; letter-spacing: .01em; }
.stat-section-head p { font-size: 12px; color: var(--muted); }

/* 部门合计 */
.dept-table {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 4px;
}
.dept-row {
  grid-template-columns: minmax(0, 1.4fr) 64px 64px 96px 96px 84px;
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  transition: background .15s;
}
.dept-row:last-child { border-bottom: 0; }
.dept-row:not(.dept-head):hover { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.dept-head { background: var(--panel-2); color: color-mix(in srgb, var(--text) 68%, var(--muted)); padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 11.5px; letter-spacing: .02em; }
.dept-badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px;
  border-radius: 6px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.dept-row .stat-num-cell { justify-self: end; font-variant-numeric: tabular-nums; color: var(--text); }
.dept-row .stat-num-cell.is-miss { color: var(--danger); font-weight: 600; }
.dept-head span:not(:first-child) { justify-self: end; }

/* 人员明细 */
.stat-table {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
}
.stat-row {
  grid-template-columns: 150px 86px 56px 56px 78px 78px 74px minmax(0, 1.7fr) 108px;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.stat-row:last-child { border-bottom: 0; }
.stat-head { background: var(--panel-2); color: color-mix(in srgb, var(--text) 68%, var(--muted)); padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 11.5px; letter-spacing: .02em; }
/* 暗色下 panel-2 比卡片表面亮一截，整条表头会显得突兀：压回贴近卡片底色 */
[data-theme="dark"] .dept-head,
[data-theme="dark"] .stat-head {
  background: color-mix(in srgb, var(--panel-2) 45%, var(--panel));
  border-bottom-color: var(--line-soft);
  color: color-mix(in srgb, var(--text) 60%, var(--muted));
}
.stat-row:not(.stat-head) { animation: statRowIn .36s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i, 0) * 26ms); }
.stat-row:not(.stat-head):hover { background: color-mix(in srgb, var(--brand) 4%, transparent); }
@keyframes statRowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.stat-user-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.stat-avatar {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12.5px; font-weight: 600;
}
.stat-username { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dept-mini { display: none; }
.stat-dept-cell { min-width: 0; }
.stat-row .stat-num-cell { justify-self: end; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-row .stat-miss-cell { color: var(--muted-2); }
.stat-row .stat-miss-cell.is-miss { color: var(--danger); font-weight: 600; }
.stat-last-cell { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.stat-head > span:nth-child(n + 3) { text-align: right; }

/* 漏传日期折叠 */
.miss-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 4px; min-width: 0; }
.miss-list { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.miss-date {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 7px;
  border-radius: 5px;
  background: var(--danger-soft); color: var(--danger);
  font-size: 11px; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.miss-date.is-extra { display: none; }
.miss-list.is-open .miss-date.is-extra { display: inline-flex; }
.miss-toggle {
  flex: none; height: 20px; padding: 0 8px;
  border: 1px dashed color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 5px;
  background: transparent; color: var(--muted);
  font-size: 11px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.miss-toggle:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-soft); }
.miss-toggle:active { transform: scale(.96); }
.miss-none { color: var(--muted-2); }

#statEmpty { padding: 44px 20px 30px; }
#statEmpty .empty-art { width: 72px; height: 72px; margin-bottom: 14px; opacity: .38; }

@media (max-width: 1100px) {
  .stat-kpi { grid-template-columns: 1.2fr 1fr 1fr; }
  .stat-row { grid-template-columns: 132px 78px 52px 52px 72px 72px 66px minmax(0, 1.5fr) 96px; gap: 8px; padding: 11px 12px; }
}

@media (max-width: 920px) {
  .stat-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-kpi .stat-card.is-primary { grid-column: 1 / -1; grid-row: auto; padding: 18px; }
  .stat-kpi .stat-card.is-primary .stat-num { font-size: 36px; }
  .stat-toolbar { width: 100%; }
  .stat-dates { flex: 1 1 100%; }
  .stat-toolbar .stat-date { flex: 1; min-width: 0; }
  .stat-toolbar .stat-range { flex: 1 1 auto; }
  .stat-export { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 720px) {
  .stat-section-head { flex-direction: column; align-items: flex-start; gap: 3px; margin-top: 20px; }
  .stat-section-head p { font-size: 11.5px; }

  .dept-table { border-radius: 12px; }
  .dept-row { grid-template-columns: minmax(0, 1fr) 42px 56px 56px 52px; gap: 4px; padding: 10px 12px; font-size: 12px; }
  .dept-row > span:nth-child(3) { display: none; }
  .dept-head { font-size: 11px; }
  .dept-badge { height: 20px; padding: 0 7px; font-size: 11.5px; }

  .stat-table { border-radius: 12px; }
  .stat-head { display: none; }
  .stat-row:not(.stat-head) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 14px;
    align-items: start;
    animation: none;
  }
  .stat-row:not(.stat-head) > span,
  .stat-row:not(.stat-head) > .miss-cell {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; min-width: 0;
    justify-self: stretch;
  }
  .stat-row:not(.stat-head) > span::before,
  .stat-row:not(.stat-head) > .miss-cell::before {
    content: attr(data-label);
    flex: none;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 400;
  }
  .stat-user-cell { grid-column: 1 / -1; gap: 10px; }
  .stat-user-cell::before { content: none !important; }
  .stat-username { font-size: 14px; }
  .user-dept-mini {
    display: inline-flex; align-items: center;
    margin-left: auto; height: 20px; padding: 0 8px;
    border-radius: 5px;
    background: var(--brand-soft); color: var(--brand);
    font-size: 11px;
  }
  .stat-dept-cell { display: none !important; }
  .stat-miss-cell { grid-column: 1 / -1; color: var(--muted-2); }
  .stat-miss-cell.is-miss { color: var(--danger); }
  .miss-cell { grid-column: 1 / -1; flex-direction: column; align-items: flex-start; gap: 6px; }
  .miss-cell > .miss-list { width: 100%; }
  .stat-last-cell { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .stat-row:not(.stat-head), .sk-line, .sk-table-row { animation: none; }
  .stat-kpi .stat-card { transition: none; }
}

/* ============ 回收站 ============ */
.trash-actions { align-items: center; gap: 8px; }
.trash-actions .stat-range { height: 36px; }
.trash-note {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding: 10px 14px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
}
.trash-note svg { width: 17px; height: 17px; flex: none; }
.trash-list { display: flex; flex-direction: column; gap: 8px; }
.trash-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  transition: border-color .16s, box-shadow .16s;
}
.trash-item:hover { border-color: var(--line); box-shadow: var(--shadow-sm); }
.trash-icon {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
}
.trash-icon.folder { background: var(--brand-soft); color: var(--brand); }
.trash-icon.folder svg { width: 22px; height: 22px; }
.trash-info { flex: 1; min-width: 0; }
.trash-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trash-meta { margin-top: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trash-sub { margin-top: 3px; font-size: 11px; color: var(--muted-2); }
.trash-days {
  flex: none;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 11.5px; white-space: nowrap;
}
.trash-days.urgent { background: var(--danger-soft); color: var(--danger); }
.trash-btns { display: flex; gap: 6px; flex: none; }
.btn.danger-text { color: var(--danger); }
.btn.danger-text:hover { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); color: var(--danger); }

/* ============ 全局搜索 ============ */
.search-list { display: flex; flex-direction: column; gap: 8px; }
.search-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.search-row:hover { border-color: var(--line); box-shadow: var(--shadow-sm); }
.search-row:active { transform: scale(.995); }
.search-icon {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 10.5px; font-weight: 600;
}
.search-icon.folder { background: var(--brand-soft); color: var(--brand); }
.search-icon.folder svg { width: 20px; height: 20px; }
.search-info { flex: 1; min-width: 0; }
.search-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-meta { margin-top: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-chevron { color: var(--muted-2); font-size: 20px; line-height: 1; flex: none; }

/* ============ 操作日志 ============ */
.log-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px; margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.log-toolbar .stat-date { height: 34px; border: 0; background: var(--panel-2); border-radius: 8px; }
.log-toolbar .stat-range { height: 34px; border-color: var(--line); }
.log-input {
  height: 34px; min-width: 150px; flex: 1 1 150px;
  padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--text);
  font-size: 12.5px; outline: none;
}
.log-input:focus { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
.log-table {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
}
.log-row {
  display: grid;
  grid-template-columns: 138px 100px 92px minmax(0, 1.1fr) minmax(0, 1.4fr) 112px;
  gap: 10px; align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.log-row:last-child { border-bottom: 0; }
.log-head { background: var(--panel-2); color: color-mix(in srgb, var(--text) 68%, var(--muted)); font-size: 11.5px; letter-spacing: .02em; }
.log-row:not(.log-head):hover { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.log-time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-user { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 5px; font-size: 11px; white-space: nowrap; }
.log-badge.is-info { color: var(--brand); background: var(--brand-soft); }
.log-badge.is-ok { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.log-badge.is-danger { color: var(--danger); background: var(--danger-soft); }
.log-badge.is-warn { color: #a96206; background: rgba(245, 158, 11, .15); }
[data-theme="dark"] .log-badge.is-warn { color: #f0b24a; background: rgba(240, 178, 74, .16); }
.log-object, .log-detail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-object { color: var(--muted); }
.log-detail { color: var(--text); }
.log-ip { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.log-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 2px 24px; font-size: 12px; color: var(--muted); }
.log-pager-btns { display: flex; align-items: center; gap: 8px; }
.log-page { font-variant-numeric: tabular-nums; }
.log-pager .btn[disabled] { opacity: .5; }

@media (max-width: 720px) {
  .trash-item { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .trash-info { flex: 1 1 calc(100% - 86px); }
  .trash-btns { margin-left: auto; }
  .trash-check { align-self: flex-start; margin-top: 11px; }
  .trash-selbar { padding: 9px 12px; }
  .trash-batch-btns { margin-left: 0; width: 100%; }
  .trash-batch-btns .btn { flex: 1; }
  .log-toolbar .stat-date { flex: 1 1 118px; }
  .log-input { flex: 1 1 100%; }
  .log-head { display: none; }
  .log-row:not(.log-head) { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 14px; }
  .log-time { grid-column: 1; grid-row: 1; }
  .log-action { grid-column: 2; grid-row: 1; justify-self: end; }
  .log-user { grid-column: 1 / -1; grid-row: 2; font-size: 13px; }
  .log-object, .log-detail { grid-column: 1 / -1; white-space: normal; overflow: visible; }
  .log-object::before { content: '对象：'; color: var(--muted-2); }
  .log-detail::before { content: '详情：'; color: var(--muted-2); }
  .log-ip { display: none; }
  .log-pager { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ============ 底部 Tab 导航（仅移动端） ============ */
.tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar[hidden] { display: none !important; }
.tabbar .tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tabbar .tab-item svg { width: 22px; height: 22px; }
.tabbar .tab-item.active { color: var(--brand); }
.tab-upload-btn {
  width: 40px; height: 40px;
  margin-top: -16px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent);
}
.tab-upload-btn svg { width: 20px; height: 20px; }

@media (max-width: 820px) {
  .tabbar:not([hidden]) { display: flex; }
  .menu-btn { display: none; } /* 底部「更多」已覆盖抽屉入口 */
  .scroll-area { padding-bottom: 76px; }
  .upload-dock, .batch-dock { bottom: 66px; }
  .select-bar { bottom: 66px; }
  .page-head .head-actions { flex-wrap: wrap; }
}

/* ============ 首页快捷入口 ============ */
.quick-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  scrollbar-width: none;
}
.quick-cards::-webkit-scrollbar { display: none; }
.qc-card {
  flex: none;
  min-width: 118px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  cursor: pointer;
  transition: transform .16s, box-shadow .16s, border-color .16s;
  -webkit-tap-highlight-color: transparent;
}
.qc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line); }
.qc-card.has-today { border-color: color-mix(in srgb, var(--brand) 35%, var(--line-soft)); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 7%, var(--panel)), var(--panel)); }
.qc-store { font-size: 13px; font-weight: 600; color: var(--text); }
.qc-sub { font-size: 11.5px; color: var(--muted-2); }
.qc-card.has-today .qc-sub { color: var(--brand); }
.qc-loading { font-size: 12.5px; color: var(--muted-2); padding: 6px 2px; }

/* ============ 列表分页加载更多 ============ */
.load-more {
  text-align: center;
  padding: 14px 0 6px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ============ 上传面板重试按钮 ============ */
.dock-footer { padding: 0 14px 12px; }
#dockRetryAll { width: 100%; }
.dock-item { position: relative; padding-right: 34px; }
.dock-item .dock-retry {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
}
.dock-item .dock-retry svg { width: 15px; height: 15px; }

/* 移动端工具栏防挤压 */
@media (max-width: 820px) {
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .sort-group { flex-wrap: nowrap; min-width: 0; }
  .toolbar .chip { white-space: nowrap; flex: none; }
  .toolbar-right { flex: none; }
  .page-head { gap: 10px; }
  .page-head h1 { font-size: 20px; }
}

/* ============ 品牌标识（膜登时代 MDSD） ============ */
.brand-logo {
  width: 96px;
  height: auto;
  display: block;
  flex: none;
}
.brand .brand-name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--muted);
  white-space: nowrap;
}

/* 文件选择 input：离屏但保持可渲染。
   不能用 display:none（hidden 属性）——iOS PWA 独立模式和部分
   Android WebView 里对 display:none 的 file input 调 .click() 不弹选择器 */
.ghost-input {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
  z-index: -1;
}

/* ==================================================================
   膜登时代品牌主题层
   原则：保持现有结构 / 文件夹 / 交互不变，只做视觉美化
   简约大方 · 操作方便 —— 不新增元素、不改信息层级
   ================================================================== */

/* 主按钮：香槟金实色（不用彩虹渐变），深棕文字，稳重无过量阴影 */
.btn.primary,
button.btn.primary {
  background: var(--gold) !important;
  color: #2A1B08 !important;
  border-color: transparent !important;
  font-weight: 600 !important;
}
.btn.primary:hover { background: var(--gold-deep) !important; color: #FFF7EA !important; }

/* 品牌名：深棕字，暗色下用香槟金；不用渐变文字特效 */
.brand-name { font-weight: 700 !important; letter-spacing: .01em; }
[data-theme="dark"] .brand-name { color: var(--gold) !important; }

/* 侧栏激活项：浅棕底 + 深棕字，去掉粗左边框，保持原本的干净形态 */
.nav-item.active {
  background: var(--brand-soft) !important;
  color: var(--gold-deep) !important;
}
[data-theme="dark"] .nav-item.active { color: var(--gold) !important; }

/* 存储进度条：香槟金 */
.progress span,
.storage-card .progress > span { background: var(--gold) !important; }

/* 快捷入口卡：保持原尺寸与排布，仅统一描边与轻量 hover */
.qc-card { border-radius: 13px !important; }
.qc-card:hover { border-color: var(--gold) !important; }
.qc-store { font-weight: 600 !important; }

/* 批次浮层：车架号勾选状态用香槟金，仅状态色 */
.batch-item .vinmark:has(input:checked) {
  border-color: var(--gold) !important;
  background: var(--gold-wash) !important;
}
.batch-item .vinmark input { accent-color: var(--gold-deep) !important; }

/* chip / 排序激活态 */
.chip.active { background: var(--brand) !important; border-color: var(--brand) !important; }
[data-theme="dark"] .chip.active { color: #1A1208 !important; }

/* 搜索聚焦：柔和金色焦点环 */
.search:focus-within {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(198,161,91,.14) !important;
}

/* 图标按钮悬浮 */
.icon-btn:hover { background: var(--gold-wash) !important; color: var(--gold-deep) !important; }

/* ============ 一步上传入口（选完即自动按部门归档） ============ */
.one-step {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; margin-bottom: 18px;
  border-radius: var(--radius);
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  box-shadow: var(--shadow-sm);
  color: #F5EADA;
}
.one-step-icon {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(198,161,91,.16);
  border: 1px solid rgba(198,161,91,.35);
  color: var(--gold);
}
.one-step-icon svg { width: 23px; height: 23px; }
.one-step-text { flex: 1; min-width: 0; }
.one-step-text strong {
  display: block; font-size: 14px; font-weight: 600;
  color: #FBF3E4; margin-bottom: 4px;
}
.one-step-text span { font-size: 12px; color: #CBB79B; line-height: 1.5; }
.one-step-text b { color: var(--gold); font-weight: 600; }
.one-step-btn { flex: none; white-space: nowrap; }
@media (max-width: 820px) {
  .one-step { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
  .one-step-icon { width: 40px; height: 40px; }
  .one-step-text { flex-basis: calc(100% - 52px); }
  .one-step-btn { width: 100%; }
}

/* ==================================================================
   APP 排版温和精修层 · 2026-11-28
   原则：不改 HTML 结构 / 不新增元素 / 不动交互 / 沿用深棕+香槟金品牌
   仅统一圆角标度、间距节奏、移动端可读性与触控区、视觉焦点
   ================================================================== */
:root {
  /* 统一圆角标度：sm / md / lg 三级，替换此前 9/10/11/13/14 混用 */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  /* 触控最小尺寸（Apple HIG 44pt） */
  --tap: 44px;
}

/* 1) 视觉焦点：页面标题与描述拉开层级，行高更舒适 */
.page-head h1 { font-size: 24px !important; font-weight: 600 !important; letter-spacing: .015em !important; }
.page-desc { font-size: 13.5px !important; line-height: 1.55 !important; }

/* 2) 圆角标度统一（按钮 / chip / 卡片 / 缩略图） */
.btn { border-radius: var(--r-sm) !important; }
.btn.small { border-radius: 8px !important; }
.chip { border-radius: var(--r-sm) !important; }
.file-row { border-radius: var(--r-sm) !important; }
.file-card { border-radius: var(--r-md) !important; }
.file-card .thumb { border-radius: var(--r-sm) !important; }
.storage-card, .one-step { border-radius: var(--r-md) !important; }
.qc-card { border-radius: var(--r-md) !important; }

/* 3) 阴影克制：统一为品牌色的一层柔和阴影，去掉过重的深色描边感 */
.file-card:hover { box-shadow: 0 1px 2px rgba(58,36,16,.05), 0 10px 26px -14px rgba(58,36,16,.26) !important; }
.btn.primary { box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 60%, transparent) !important; }

/* 4) 桌面端触控与可读性：正文 icon 按钮保持精致，但保证 ≥36px */
.icon-btn { transition: background .16s, color .16s, transform .12s !important; }
.icon-btn:active { transform: scale(.94) !important; }

/* 5) 移动端（≤820px）：字号 / 触控区 / 间距精修 */
@media (max-width: 820px) {
  /* 底部导航：10.5px → 11.5px，图标略放大，标签更清晰 */
  .tabbar .tab-item { font-size: 11.5px !important; gap: 3px !important; }
  .tabbar .tab-item svg { width: 23px !important; height: 23px !important; }
  .tabbar .tab-item.active { font-weight: 600 !important; }

  /* 列表行：正文字号提升，副标题更清楚 */
  .page-head h1 { font-size: 21px !important; }
  .page-desc { font-size: 13.5px !important; }
  .fname { font-size: 14.5px !important; }
  .fpath { font-size: 11.5px !important; }
  .card-name { font-size: 14px !important; }
  .card-meta { font-size: 12px !important; }
  .dir-note { font-size: 12px !important; }

  /* 触控区：主操作按钮/图标按钮保证 ≥44px */
  .head-actions .btn, .page-head .btn { min-height: 40px !important; }
  .file-row .col-ops .icon-btn,
  .file-card .card-ops .icon-btn {
    min-width: 38px !important; min-height: 38px !important;
    width: 38px !important; height: 38px !important;
  }
  .icon-btn { min-width: 40px !important; min-height: 40px !important; }

  /* 列表行左右呼吸感 */
  .file-row { padding-left: 12px !important; padding-right: 12px !important; }

  /* 卡片网格间距更均匀 */
  .file-grid { column-gap: 12px !important; }

  /* 一步上传卡：移动端标题稍放大，按钮高度达标 */
  .one-step-text strong { font-size: 15px !important; }
  .one-step-btn { min-height: 44px !important; }
}

/* 6) 焦点环无障碍：所有可点元素键盘聚焦有清晰金色环 */
button:focus-visible, input:focus-visible, .qc-card:focus-visible, .file-card:focus-visible {
  outline: 2px solid var(--gold) !important;
  outline-offset: 2px !important;
}

/* 7) 轻按压反馈：卡片类元素点击回弹 */
.qc-card:active, .file-card:active { transform: scale(.985) !important; }

/* ==================================================================
   首页「我的上传统计」卡片 · 2026-11-28
   仅新增独立组件样式，不改既有规则；沿用深棕+香槟金品牌
   ================================================================== */
.my-stats {
  margin-bottom: 16px;
  padding: 16px 18px 14px;
  border-radius: var(--r-md, 14px) !important;
  border: 1px solid var(--line-soft);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 8%, var(--panel)), var(--panel) 55%);
  box-shadow: 0 1px 2px rgba(58,36,16,.04);
}
.my-stats[hidden] { display: none !important; }
.ms-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.ms-title { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 650; color: var(--text); }
.ms-title svg { width: 17px; height: 17px; color: var(--brand); flex: none; }
.ms-title em { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.ms-who { font-size: 11.5px; color: var(--muted); padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); }
.ms-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; }
.ms-cell {
  min-width: 0; padding: 12px 12px 11px; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--line-soft);
}
.ms-num { font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-num i { font-style: normal; font-size: 12px; font-weight: 500; margin-left: 2px; color: var(--muted); }
.ms-cell.is-alert .ms-num { color: var(--danger, #B4482F); }
.ms-label { margin-top: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-dates { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line-soft); }
.ms-dates-k { flex: none; font-size: 11.5px; color: var(--muted); }
.ms-dates-v { min-width: 0; font-size: 12px; color: var(--muted-2); line-height: 1.5; word-break: break-all; }
.ms-dates-v.has-miss { color: var(--danger, #B4482F); }
@media (max-width: 820px) {
  .my-stats { padding: 14px 14px 12px; }
  .ms-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ms-cell:first-child { grid-column: 1 / -1; }
  .ms-num { font-size: 20px; }
  .ms-cell:first-child .ms-num { font-size: 26px; }
}
