/* ==========================================================================
   海关研究资料库 · Apple 风格界面
   浅色、留白、系统字体、克制的蓝色强调色
   ========================================================================== */

:root {
  --bg: #f5f5f7;
  --bg-deep: #ececef;
  --paper: #ffffff;
  --paper-2: #fbfbfd;
  --ink: #1d1d1f;
  --ink-soft: #424245;
  --muted: #86868b;
  --muted-2: #a1a1a6;
  --line: #e5e5ea;
  --line-strong: #d2d2d7;
  --brand: #0071e3;
  --brand-hover: #0077ed;
  --brand-soft: #e8f2ff;
  --danger: #ff3b30;
  --danger-soft: #fff0ef;
  --ok: #34c759;
  --gold: #0071e3;
  --gold-soft: #e8f2ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .035);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, .075);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, .18);
  --radius: 16px;
  --radius-sm: 10px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "SimHei",
    "Noto Sans SC", sans-serif;
  --serif: var(--sans);
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  background: var(--bg);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }

::selection { background: rgba(0, 113, 227, .2); }

* { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .18);
  border: 3px solid transparent;
  border-radius: 10px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, .28); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible {
  outline: 3px solid rgba(0, 113, 227, .32);
  outline-offset: 2px;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1.2em;
  height: 1.2em;
  display: block;
  flex: none;
}

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   启动 / 门禁
   -------------------------------------------------------------------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink);
  background:
    radial-gradient(720px 420px at 50% 38%, rgba(0, 113, 227, .06), transparent 70%),
    var(--bg);
}

.boot-mark {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: linear-gradient(145deg, #2b8cff, #0071e3);
  box-shadow: 0 10px 30px rgba(0, 113, 227, .22);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 2.8s ease-in-out infinite;
}
.boot-mark svg { width: 40px; height: 40px; }
.boot-title {
  font-family: var(--sans);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.025em;
}
.boot-sub { color: var(--muted); font-size: 13px; letter-spacing: 0; }

.dots i { font-style: normal; animation: blink 1.4s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }

@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(800px 480px at 50% 20%, rgba(0, 113, 227, .055), transparent 70%),
    var(--bg);
}

.gate-card {
  width: min(540px, 100%);
  background: var(--paper);
  border: 1px solid rgba(0, 0, 0, .04);
  border-radius: 24px;
  padding: 40px 42px 36px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, .07);
}
.gate-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 24px;
  margin-bottom: 20px;
}
.gate-icon.warn { color: var(--danger); background: var(--danger-soft); }
.gate-card h1 {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -.025em;
}
.gate-card p { color: var(--ink-soft); margin: 0 0 14px; font-size: 14px; }
.gate-extra { color: var(--muted); font-size: 13px; }
.gate-extra ol { margin: 10px 0 0; padding-left: 20px; }
.gate-extra li { margin: 7px 0; }
.gate-extra code {
  background: var(--bg);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
  word-break: break-all;
}
.gate-extra a { color: var(--brand); text-decoration: none; }
.gate-extra a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   主体布局
   -------------------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 20px 14px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 7px 18px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(145deg, #2b8cff, #0071e3);
  box-shadow: 0 4px 12px rgba(0, 113, 227, .2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--ink);
  white-space: nowrap;
}
.brand-text span {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .04em;
  margin-top: 1px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background .14s ease, color .14s ease;
}
.nav-item .icon { font-size: 17px; color: var(--muted); transition: color .14s ease; }
.nav-item:hover { background: rgba(0, 0, 0, .045); color: var(--ink); }
.nav-item:hover .icon { color: var(--ink-soft); }
.nav-item.active {
  background: #e8e8ed;
  color: var(--ink);
  box-shadow: none;
}
.nav-item.active .icon { color: var(--brand); }

.nav-sep {
  height: 1px;
  margin: 9px 8px;
  background: var(--line);
}

.folder-nav {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 14px;
  flex: 1;
}
.folder-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
}
.folder-list {
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .14) transparent;
}
.folder-list::-webkit-scrollbar { width: 6px; }
.folder-list::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .12); border-radius: 3px; }

.folder-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  text-align: left;
  transition: background .14s ease, color .14s ease;
}
.folder-item .icon { width: 15px; height: 15px; color: var(--muted-2); }
.folder-item .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-item .fcount { font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.folder-item:hover { background: rgba(0, 0, 0, .045); color: var(--ink); }
.folder-item.active { background: var(--brand-soft); color: var(--brand); }
.folder-item.active .icon { color: var(--brand); }
.folder-item.root { font-weight: 500; color: var(--ink); }
.folder-empty-hint { padding: 6px 9px; font-size: 11.5px; color: var(--muted-2); }

.sidebar-foot { flex: none; padding-top: 12px; border-top: 1px solid var(--line); }

.storage { padding: 2px 8px 12px; }
.storage-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
}
.storage-head .icon { width: 14px; height: 14px; }
.storage-bar {
  height: 4px;
  margin: 8px 0 6px;
  border-radius: 4px;
  background: #e8e8ed;
  overflow: hidden;
}
.storage-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: var(--brand);
  transition: width .4s ease;
}
.storage-note { font-size: 10.5px; color: var(--muted-2); }

.user-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 12px;
  background: #f5f5f7;
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #2b8cff, #0071e3);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.user-meta strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-meta span {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-pill {
  flex: none;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  border: 0;
  color: var(--brand);
  background: var(--brand-soft);
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, .26);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.main {
  min-width: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 32px;
  background: rgba(245, 245, 247, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .07);
}

.menu-btn { display: none !important; }

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 560px;
}
.search-wrap .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  height: 36px;
  padding: 0 36px 0 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(0, 0, 0, .05);
  color: var(--ink);
  outline: none;
  font-size: 13.5px;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap input:hover { background: rgba(0, 0, 0, .065); }
.search-wrap input:focus {
  background: var(--paper);
  border-color: rgba(0, 113, 227, .55);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .12);
}
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.search-clear:hover { background: rgba(0, 0, 0, .07); color: var(--ink); }

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

.content {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 38px 36px 80px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  margin-bottom: 7px;
  font-size: 11.5px;
  color: var(--muted);
}
.breadcrumb button {
  border: 0;
  background: none;
  padding: 2px 4px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 11.5px;
}
.breadcrumb button:hover { color: var(--brand); background: rgba(0, 113, 227, .07); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .current { color: var(--ink-soft); font-weight: 500; padding: 2px 4px; }

.page-heading h1 {
  margin: 0;
  font-family: var(--sans);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.15;
  color: var(--ink);
}
.page-sub { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex: none; padding-bottom: 2px; }

/* --------------------------------------------------------------------------
   按钮 / 表单
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border-radius: 980px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .08s ease;
}
.btn:active { transform: scale(.975); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: none; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-outline { border-color: var(--line-strong); background: var(--paper); color: var(--ink); }
.btn-outline:hover { border-color: var(--muted-2); background: #fafafa; color: var(--ink); }
.btn-ghost { color: var(--brand); }
.btn-ghost:hover { background: rgba(0, 113, 227, .08); color: var(--brand); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger-soft); color: #d70015; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e0352b; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: background .14s ease, color .14s ease;
}
.icon-btn:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.icon-btn.tiny { width: 24px; height: 24px; color: var(--muted); }
.icon-btn.tiny:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.icon-btn.tiny .icon { width: 14px; height: 14px; }

.text-input, .member-form input, .member-form select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f5f5f7;
  color: var(--ink);
  outline: none;
  font-size: 13.5px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.text-input::placeholder, .member-form input::placeholder { color: var(--muted); }
.text-input:hover, .member-form input:hover, .member-form select:hover { background: #efeff2; }
.text-input:focus, .member-form input:focus, .member-form select:focus {
  background: var(--paper);
  border-color: rgba(0, 113, 227, .55);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .12);
}
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   文件夹卡片
   -------------------------------------------------------------------------- */

.folders-section { margin-bottom: 30px; }
.section-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--muted);
  text-transform: none;
}
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.folder-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.folder-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.folder-card-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  background: var(--brand-soft);
}
.folder-card-icon .icon { width: 19px; height: 19px; }
.folder-card-meta { min-width: 0; flex: 1; }
.folder-card-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-card-meta span { font-size: 11px; color: var(--muted); }
.folder-card .icon-chevron { color: var(--muted-2); width: 14px; height: 14px; }

/* --------------------------------------------------------------------------
   文件表格
   -------------------------------------------------------------------------- */

.files-section { position: relative; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.section-tools { display: flex; align-items: center; gap: 10px; }
.hint { color: var(--muted); font-size: 11.5px; }

.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(0, 113, 227, .1);
  border-radius: 12px;
  background: var(--brand-soft);
  color: #0055b3;
  font-size: 12.5px;
}
.batch-actions { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.batch-bar .btn-ghost { color: #0066cc; }
.batch-bar .btn-ghost:hover { background: rgba(0, 113, 227, .1); color: #0055b3; }
.batch-bar .btn-ghost.danger { color: var(--danger); }

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.file-table th {
  padding: 11px 10px;
  background: #fbfbfd;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .01em;
  text-align: left;
  white-space: nowrap;
}
.file-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f0f0f2;
  vertical-align: middle;
}
.file-table tbody tr { transition: background .12s ease; }
.file-table tbody tr:hover { background: #fafafa; }
.file-table tbody tr.selected { background: var(--brand-soft); }
.file-table tbody tr:last-child td { border-bottom: 0; }

.col-check { width: 42px; padding-left: 14px !important; }
.col-size { width: 92px; }
.col-user { width: 130px; }
.col-time { width: 142px; }
.col-actions { width: 126px; text-align: right !important; padding-right: 14px !important; }

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
  vertical-align: middle;
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.file-badge {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #6e6e73;
  background: #f2f2f7;
  text-transform: uppercase;
  box-shadow: none;
}
.file-badge.pdf { color: #d70015; background: #fff0ef; }
.file-badge.doc, .file-badge.docx { color: #0066cc; background: #eaf3ff; }
.file-badge.xls, .file-badge.xlsx, .file-badge.csv { color: #1d7a3a; background: #eaf8ee; }
.file-badge.ppt, .file-badge.pptx { color: #b25000; background: #fff4e8; }
.file-badge.img { color: #6e3fb5; background: #f5efff; }
.file-badge.zip, .file-badge.rar, .file-badge.\37z { color: #8a6d1d; background: #f7f2e5; }
.file-badge.txt, .file-badge.md { color: #48484a; background: #f2f2f7; }

.file-text { min-width: 0; flex: 1; }
.file-link {
  display: block;
  max-width: 100%;
  border: 0;
  padding: 0;
  background: none;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-link:hover { color: var(--brand); text-decoration: none; }
.file-link:disabled { cursor: default; color: var(--ink); }
.file-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--muted);
}
.file-sub .tag {
  padding: 0 5px;
  border-radius: 4px;
  background: #f2f2f7;
  color: var(--muted);
}
.deleted-mark { color: var(--danger); }

.cell-muted { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mini-avatar {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 600;
}
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1px;
  opacity: .45;
  transition: opacity .15s ease;
}
.file-table tr:hover .row-actions { opacity: 1; }
.row-actions .icon-btn { width: 28px; height: 28px; border-radius: 7px; }
.row-actions .icon-btn .icon { width: 15px; height: 15px; }
.row-actions .icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.empty-state {
  padding: 64px 20px 58px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}
.empty-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 26px;
}
.empty-state h3 {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.015em;
}
.empty-state p { margin: 0 0 18px; color: var(--muted); font-size: 12.5px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   管理面板
   -------------------------------------------------------------------------- */

.panel-section { animation: fadeUp .2s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.member-form {
  display: grid;
  grid-template-columns: minmax(210px, 1.6fr) minmax(130px, 1fr) 150px auto;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.member-table td { font-size: 12.5px; }
.member-table .col-actions { width: 170px; }
.member-role-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 12px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  background: #eaf8ee;
  color: #1d7a3a;
}
.status-pill.pending { background: #fff4e8; color: #b25000; }
.status-pill.blocked { background: var(--danger-soft); color: var(--danger); }

.activity-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.activity-item {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f2;
  font-size: 12.5px;
}
.activity-item:last-child { border-bottom: 0; }
.activity-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.activity-main { min-width: 0; }
.activity-main strong { font-weight: 500; }
.activity-main span { color: var(--muted); }
.activity-badge {
  display: inline-block;
  min-width: 52px;
  padding: 1px 7px;
  margin-right: 6px;
  border-radius: 5px;
  background: #f2f2f7;
  color: var(--ink-soft);
  font-size: 10.5px;
  text-align: center;
}
.activity-target { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------------------
   弹窗
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(620px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.modal-sm { width: min(430px, 100%); }
.modal-upload { width: min(660px, 100%); }
.modal-preview { width: min(1000px, 100%); height: min(88vh, 900px); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
}
.modal-head h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.modal-sub { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.modal-body { padding: 6px 22px 20px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}
.modal-foot .btn { margin-left: 0; }
.modal-foot .hint { margin-right: auto; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 30px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: #fafafa;
  text-align: center;
  transition: border-color .16s ease, background .16s ease;
}
.dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone-icon { width: 26px; height: 26px; color: var(--brand); margin-bottom: 3px; }
.dropzone strong { font-size: 13.5px; font-weight: 500; }
.dropzone > span { color: var(--muted); font-size: 11px; }
.dropzone small { margin-top: 4px; color: var(--muted); font-size: 10.5px; }

.upload-queue { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.upload-item .file-badge { width: 28px; height: 28px; border-radius: 8px; font-size: 7px; }
.upload-info { flex: 1; min-width: 0; }
.upload-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-status { font-size: 10.5px; color: var(--muted); }
.upload-bar { height: 3px; margin-top: 4px; border-radius: 3px; background: #ececef; overflow: hidden; }
.upload-bar i { display: block; width: 0; height: 100%; background: var(--brand); transition: width .2s ease; }
.upload-item.done .upload-bar i { background: var(--ok); }
.upload-item.error .upload-bar i { background: var(--danger); }
.upload-item .icon { width: 16px; height: 16px; color: var(--ok); }
.upload-item.error .icon { color: var(--danger); }

.confirm-text { margin: 0; color: var(--ink-soft); font-size: 13.5px; line-height: 1.7; }

.preview-heading { min-width: 0; }
.preview-heading h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.preview-body {
  flex: 1;
  min-height: 0;
  padding: 0;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 14px; }
.preview-body video { max-width: 100%; max-height: 100%; }
.preview-body pre {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 22px;
  overflow: auto;
  background: #fff;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.preview-fallback {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
.preview-fallback .icon { width: 36px; height: 36px; margin: 0 auto 12px; color: var(--muted-2); }
.preview-fallback strong { display: block; color: var(--ink-soft); margin-bottom: 4px; }
.preview-loading { color: var(--muted); font-size: 12.5px; }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(370px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(29, 29, 31, .94);
  color: #fff;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
  font-size: 12.5px;
  line-height: 1.5;
  animation: toastIn .22s cubic-bezier(.2, .8, .3, 1);
}
.toast .icon { width: 16px; height: 16px; margin-top: 1px; color: #30d158; }
.toast.error { background: rgba(60, 12, 10, .96); }
.toast.error .icon { color: #ff6961; }
.toast.leaving { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1040px) {
  .app { grid-template-columns: 238px minmax(0, 1fr); }
  .content { padding: 32px 26px 70px; }
  .topbar { padding: 0 26px; }
  .col-user { width: 110px; }
}

@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform .24s cubic-bezier(.2, .8, .3, 1);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding-left: 12px; }
  .content { padding: 26px 20px 70px; }
  .page-heading h1 { font-size: 34px; }
  .hide-md { display: none !important; }
  .member-form { grid-template-columns: 1fr 1fr; }
  .member-form button { grid-column: 1 / -1; }
  .activity-item { grid-template-columns: 92px 1fr; }
  .activity-target { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .hide-sm { display: none !important; }
  .topbar { gap: 8px; height: 58px; padding: 0 12px; }
  .search-wrap input { height: 36px; }
  .topbar-actions .btn-primary { padding: 0 12px; }
  .topbar-actions .btn-primary span { display: none; }
  .topbar-actions .btn-primary { width: 36px; padding: 0; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 22px; }
  .page-heading h1 { font-size: 30px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .folder-grid { grid-template-columns: 1fr 1fr; }
  .folder-card { padding: 10px; }
  .folder-card-icon { width: 30px; height: 30px; border-radius: 8px; }
  .col-check { width: 36px; padding-left: 10px !important; }
  .col-size { width: 70px; }
  .col-time { display: none; }
  .col-actions { width: 96px; padding-right: 8px !important; }
  .file-table th, .file-table td { padding: 10px 6px; }
  .file-table th { font-size: 10px; }
  .file-badge { width: 29px; height: 29px; font-size: 7px; border-radius: 8px; }
  .file-link { font-size: 12.5px; }
  .row-actions { opacity: 1; }
  .row-actions .icon-btn { width: 25px; height: 25px; }
  .row-actions .icon-btn:nth-child(n+3) { display: none; }
  .batch-bar { padding: 7px 8px 7px 11px; }
  .batch-actions .btn span { display: none; }
  .batch-actions .btn { padding: 0 8px; }
  .member-form { grid-template-columns: 1fr; }
  .member-form button { grid-column: auto; }
  .modal-backdrop { padding: 8px; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-sm { width: 100%; }
  .modal-preview { height: 92vh; border-radius: 20px 20px 0 0; }
  .modal-head { padding: 16px 16px 12px; }
  .modal-body { padding: 4px 16px 16px; }
  .modal-foot { padding: 12px 16px; }
  .activity-item { grid-template-columns: 1fr; gap: 2px; }
  .activity-time { order: 2; }
  .toast-wrap { right: 12px; bottom: 12px; }
  .gate-card { padding: 30px 24px; border-radius: 20px; }
  .gate-card h1 { font-size: 24px; }
}

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