/* ==========================================================================
   海关研究资料库 · 样式
   ========================================================================== */

:root {
  --bg: #f5f3ec;
  --bg-deep: #ece9df;
  --paper: #fffefb;
  --ink: #1b2a25;
  --ink-soft: #3d4b45;
  --muted: #77827b;
  --line: #e5e1d5;
  --line-strong: #d5d0c1;
  --brand: #155e4d;
  --brand-hover: #0f4c3e;
  --forest: #123a32;
  --forest-2: #0d2c26;
  --gold: #c9a45f;
  --gold-soft: #f2e7cb;
  --danger: #ad4437;
  --danger-soft: #f8e6e2;
  --ok: #2c7a5b;
  --shadow-sm: 0 1px 2px rgba(27, 42, 37, .05), 0 4px 14px rgba(27, 42, 37, .04);
  --shadow-md: 0 12px 34px rgba(18, 58, 50, .12);
  --shadow-lg: 0 28px 70px rgba(9, 30, 25, .28);
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", Georgia, serif;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.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: 8px;
  color: #f6f2e8;
  background:
    radial-gradient(1000px 600px at 15% -10%, rgba(201, 164, 95, .18), transparent 60%),
    radial-gradient(900px 700px at 110% 110%, rgba(74, 128, 108, .25), transparent 55%),
    var(--forest);
}

.boot-mark {
  width: 66px;
  height: 66px;
  margin-bottom: 10px;
  animation: float 2.6s ease-in-out infinite;
}
.boot-mark svg { width: 100%; height: 100%; }
.boot-title {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: .12em;
}
.boot-sub { color: rgba(246, 242, 232, .64); font-size: 13px; letter-spacing: .04em; }

.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(-6px); } }

.gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(201, 164, 95, .12), transparent 60%),
    var(--bg);
}

.gate-card {
  width: min(560px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 38px 40px 34px;
  box-shadow: var(--shadow-md);
}
.gate-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  background: #eaf2ee;
  font-size: 24px;
  margin-bottom: 16px;
}
.gate-icon.warn { color: var(--danger); background: var(--danger-soft); }
.gate-card h1 {
  font-family: var(--serif);
  font-size: 26px;
  margin: 0 0 10px;
  letter-spacing: .02em;
}
.gate-card p { color: var(--ink-soft); margin: 0 0 14px; }
.gate-extra { color: var(--muted); font-size: 13px; }
.gate-extra ol { margin: 10px 0 0; padding-left: 20px; }
.gate-extra li { margin: 6px 0; }
.gate-extra code {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12px;
  word-break: break-all;
}
.gate-extra a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

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

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

.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 15px 16px;
  color: #e9e5d8;
  background:
    radial-gradient(600px 380px at 0% 0%, rgba(201, 164, 95, .12), transparent 70%),
    linear-gradient(170deg, var(--forest), var(--forest-2));
  border-right: 1px solid rgba(255, 255, 255, .05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 20px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #fbf8ef;
  white-space: nowrap;
}
.brand-text span { font-size: 11px; color: rgba(233, 229, 216, .52); letter-spacing: .18em; }

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(233, 229, 216, .72);
  font-size: 13.5px;
  text-align: left;
  transition: background .16s, color .16s;
}
.nav-item .icon { font-size: 17px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: rgba(201, 164, 95, .16);
  color: #f4e3bb;
  box-shadow: inset 2px 0 0 var(--gold);
}
.nav-item.active .icon { opacity: 1; }

.nav-sep {
  height: 1px;
  margin: 10px 10px;
  background: rgba(255, 255, 255, .08);
}

.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 10px 7px;
  font-size: 10.5px;
  letter-spacing: .2em;
  color: rgba(233, 229, 216, .38);
}
.folder-list {
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .16) transparent;
}
.folder-list::-webkit-scrollbar { width: 6px; }
.folder-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 3px; }

.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(233, 229, 216, .66);
  font-size: 12.5px;
  text-align: left;
  transition: background .15s, color .15s;
}
.folder-item .icon { width: 16px; height: 16px; opacity: .6; }
.folder-item .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-item .fcount { font-size: 10.5px; color: rgba(233, 229, 216, .34); }
.folder-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.folder-item.active { background: rgba(255, 255, 255, .09); color: #fff; }
.folder-item.active .icon { opacity: 1; color: var(--gold); }
.folder-item.root { font-weight: 600; color: rgba(255, 255, 255, .82); }
.folder-empty-hint { padding: 6px 10px; font-size: 11.5px; color: rgba(233, 229, 216, .32); }

.sidebar-foot { flex: none; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }

.storage { padding: 4px 8px 12px; }
.storage-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(233, 229, 216, .58);
  font-size: 11.5px;
}
.storage-head .icon { width: 14px; height: 14px; }
.storage-bar {
  height: 4px;
  margin: 8px 0 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.storage-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), #e6cd94);
  transition: width .4s ease;
}
.storage-note { font-size: 10.5px; color: rgba(233, 229, 216, .3); }

.user-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .05);
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold), #8d6f37);
  color: #1b2a25;
  font-size: 13px;
  font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.user-meta strong {
  font-size: 12.5px;
  color: #f6f2e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-meta span {
  font-size: 10.5px;
  color: rgba(233, 229, 216, .42);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-pill {
  flex: none;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid rgba(201, 164, 95, .36);
  color: var(--gold);
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(9, 30, 25, .45);
  backdrop-filter: blur(2px);
}

.main {
  min-width: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 34px;
  background: rgba(245, 243, 236, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(213, 208, 193, .55);
}

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

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.search-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  outline: none;
  font-size: 13.5px;
  transition: border-color .16s, box-shadow .16s;
}
.search-wrap input::placeholder { color: #a3aba5; }
.search-wrap input:focus {
  border-color: rgba(21, 94, 77, .45);
  box-shadow: 0 0 0 3px rgba(21, 94, 77, .09);
}
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.search-clear:hover { background: var(--bg-deep); }

.topbar-actions { display: flex; gap: 9px; margin-left: auto; }

.content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 30px 34px 70px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  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(21, 94, 77, .06); }
.breadcrumb .sep { opacity: .45; }
.breadcrumb .current { color: var(--ink-soft); font-weight: 600; padding: 2px 4px; }

.page-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.25;
}
.page-sub { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.page-actions { display: flex; gap: 8px; flex: none; padding-bottom: 3px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background .16s, border-color .16s, color .16s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(21, 94, 77, .2); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-outline { border-color: var(--line-strong); background: var(--paper); color: var(--ink-soft); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: var(--bg-deep); color: var(--ink); }
.btn-ghost.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #97372b; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover { background: var(--bg-deep); color: var(--ink); }
.icon-btn.tiny { width: 24px; height: 24px; color: rgba(233, 229, 216, .5); }
.icon-btn.tiny:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.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 var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  outline: none;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.text-input:focus, .member-form input:focus, .member-form select:focus {
  border-color: rgba(21, 94, 77, .5);
  box-shadow: 0 0 0 3px rgba(21, 94, 77, .08);
}
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

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

.folders-section { margin-bottom: 28px; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
}
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.folder-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.folder-card:hover {
  border-color: rgba(21, 94, 77, .35);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.folder-card-icon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9b7a37;
  background: var(--gold-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: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-card-meta span { font-size: 11px; color: var(--muted); }
.folder-card .icon-chevron { color: var(--line-strong); width: 15px; height: 15px; }

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

.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: 9px 12px;
  border: 1px solid #e8d9b6;
  border-radius: 11px;
  background: #fbf4e3;
  color: #6d5522;
  font-size: 12.5px;
}
.batch-actions { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.batch-bar .btn-ghost { color: #7a6028; }
.batch-bar .btn-ghost:hover { background: rgba(201, 164, 95, .16); color: #5c4719; }
.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: 10px 10px;
  background: #faf8f1;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-align: left;
  white-space: nowrap;
}
.file-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #f0ede4;
  vertical-align: middle;
}
.file-table tbody tr { transition: background .12s; }
.file-table tbody tr:hover { background: #fbfaf5; }
.file-table tbody tr.selected { background: #f4f8f5; }
.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: 38px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  background: #8b968f;
  text-transform: uppercase;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08);
}
.file-badge.pdf { background: #b4513f; }
.file-badge.doc, .file-badge.docx { background: #35618f; }
.file-badge.xls, .file-badge.xlsx, .file-badge.csv { background: #2f7650; }
.file-badge.ppt, .file-badge.pptx { background: #b06a33; }
.file-badge.img { background: #8a5a9e; }
.file-badge.zip, .file-badge.rar, .file-badge.\37z { background: #77683c; }
.file-badge.txt, .file-badge.md { background: #5b6660; }

.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: underline; text-underline-offset: 2px; }
.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: var(--bg-deep);
  color: #7c857f;
}
.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: #e7eee9;
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 700;
}
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1px;
  opacity: .55;
  transition: opacity .15s;
}
.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: 58px 20px 54px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 254, 251, .55);
}
.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #efece1;
  color: #9a927c;
  font-size: 26px;
}
.empty-state h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 19px; font-weight: 600; }
.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: 12px;
  background: var(--paper);
}
.member-table td { font-size: 12.5px; }
.member-table .col-actions { width: 170px; }
.member-role-select {
  height: 30px;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  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: #eaf3ec;
  color: var(--ok);
}
.status-pill.pending { background: #fbf1dc; color: #956e1f; }
.status-pill.blocked { background: var(--danger-soft); color: var(--danger); }

.activity-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}
.activity-item {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #f1eee5;
  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: 600; }
.activity-main span { color: var(--muted); }
.activity-badge {
  display: inline-block;
  min-width: 52px;
  padding: 1px 7px;
  margin-right: 6px;
  border-radius: 5px;
  background: var(--bg-deep);
  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(16, 33, 28, .48);
  backdrop-filter: blur(4px);
  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: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) 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: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .02em;
}
.modal-sub { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: #fbfaf5;
}
.modal-foot .btn { margin-left: auto; }
.modal-foot .hint { margin-right: auto; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 26px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: #fbfaf5;
  text-align: center;
  transition: border-color .16s, background .16s;
}
.dropzone.dragover { border-color: var(--brand); background: #f2f8f4; }
.dropzone-icon { width: 26px; height: 26px; color: var(--brand); margin-bottom: 3px; }
.dropzone strong { font-size: 13.5px; }
.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: 9px;
  background: #fff;
}
.upload-item .file-badge { width: 28px; height: 32px; font-size: 7.5px; }
.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: var(--bg-deep); overflow: hidden; }
.upload-bar i { display: block; width: 0; height: 100%; background: var(--brand); transition: width .2s; }
.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: #f0eee7;
  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: #a49c88; }
.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: 10px;
  background: #173d34;
  color: #f6f2e8;
  box-shadow: var(--shadow-md);
  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: #8fd3b8; }
.toast.error { background: #6f2a22; }
.toast.error .icon { color: #f3b0a6; }
.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: 232px minmax(0, 1fr); }
  .content { padding: 26px 24px 60px; }
  .topbar { padding: 13px 24px; }
  .col-user { width: 110px; }
}

@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 262px;
    transform: translateX(-102%);
    transition: transform .24s cubic-bezier(.2, .8, .3, 1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding-left: 12px; }
  .content { padding: 22px 18px 60px; }
  .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; padding: 10px 12px; }
  .search-wrap input { height: 38px; }
  .topbar-actions .btn-primary { padding: 0 11px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 25px; }
  .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; }
  .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: 9.5px; }
  .file-badge { width: 29px; height: 33px; font-size: 7px; }
  .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: 8px; }
  .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: 10px; align-items: flex-end; }
  .modal { border-radius: 16px; max-height: 92vh; }
  .modal-preview { height: 92vh; border-radius: 16px; }
  .modal-head { padding: 15px 16px 12px; }
  .modal-body { padding: 15px 16px; }
  .modal-foot { padding: 11px 16px; }
  .activity-item { grid-template-columns: 1fr; gap: 2px; }
  .activity-time { order: 2; }
  .toast-wrap { right: 12px; bottom: 12px; }
  .gate-card { padding: 28px 22px; }
  .gate-card h1 { font-size: 22px; }
}

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