:root {
  --bg: #F6F8FC;
  --card: #FFFFFF;
  --line: #E8EDF5;
  --line-soft: #F0F3F8;
  --ink: #171A24;
  --body: #5A6172;
  --muted: #98A1B3;
  --brand: #3E6EF4;
  --brand-deep: #2F5CE0;
  --brand-soft: #EEF3FF;
  --mint: #34C88A;
  --mint-soft: #E9FAF2;
  --violet: #6A5AE0;
  --violet-soft: #F1EFFE;
  --orange: #F08A00;
  --orange-soft: #FFF6E6;
  --pink: #E85D8A;
  --pink-soft: #FDEEF4;
  --red: #E5484D;
  --red-soft: #FEECEC;
  --cyan: #1FA8B8;
  --cyan-soft: #E8F8FA;
  --gray: #7A8499;
  --gray-soft: #F1F4F9;
  --shadow-sm: 0 1px 2px rgba(23, 34, 84, .04), 0 8px 24px rgba(23, 34, 84, .05);
  --shadow-md: 0 18px 44px rgba(23, 34, 84, .12);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
body.no-scroll { overflow: hidden; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ============ Shell / sidebar ============ */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 40;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 0 14px 14px;
}
.brand-row { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px; flex: none; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: linear-gradient(145deg, #4C7BFF, #2F5CE0);
  display: grid; place-items: center; color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 8px 18px rgba(47, 92, 224, .25);
}
.brand-mark::after {
  content: ""; position: absolute; right: -7px; bottom: -7px;
  width: 19px; height: 19px; border-radius: 50%; background: rgba(107, 221, 159, .95);
}
.brand-mark .i { width: 20px; height: 20px; position: relative; z-index: 1; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 14.5px; letter-spacing: .01em; }
.brand-text small { font-size: 8px; letter-spacing: .16em; color: var(--muted); margin-top: 3px; font-weight: 700; }
.sidebar-close { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 3px; padding: 4px 2px 12px; border-bottom: 1px solid var(--line-soft); flex: none; }
.side-label {
  margin: 6px 0 3px; padding: 0 10px; font-size: 9px; font-weight: 700;
  letter-spacing: .16em; color: #AEB6C6;
}
.nav-link {
  width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 10px;
  background: none; color: var(--body); font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; text-align: left;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: #F5F7FC; color: var(--ink); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav-link .i { width: 17px; height: 17px; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #FFF1E0; color: #C47700;
  font-size: 9.5px; font-weight: 700; display: grid; place-items: center;
}
.nav-link.active .nav-badge { background: #fff; color: var(--brand); }
.side-spaces { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 13px; }
.side-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 10px 7px; font-size: 9px; font-weight: 700;
  letter-spacing: .16em; color: #AEB6C6;
}
.side-head-count { font-size: 9.5px; letter-spacing: 0; color: #A6AFBF; font-weight: 600; }
.space-list { overflow: auto; padding: 0 0 8px; min-height: 0; }
.space-list::-webkit-scrollbar, .folder-tree::-webkit-scrollbar, .drawer-body::-webkit-scrollbar, .matrix-wrap::-webkit-scrollbar { width: 5px; height: 5px; }
.space-list::-webkit-scrollbar-thumb, .folder-tree::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb, .matrix-wrap::-webkit-scrollbar-thumb { background: #DCE3EF; border-radius: 99px; }
.space-link {
  width: 100%; height: 38px; padding: 0 8px; border: 0; border-radius: 9px;
  background: none; display: flex; align-items: center; gap: 9px;
  color: var(--body); font-size: 12px; text-align: left; transition: background .15s;
}
.space-link:hover { background: #F5F7FC; }
.space-link.active { background: #F7FAFF; color: var(--brand); font-weight: 700; }
.space-dot {
  width: 25px; height: 25px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
}
.space-dot .i { width: 14px; height: 14px; }
.space-link .space-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-link .lock-mini { width: 12px; height: 12px; color: #B0B8C8; }
.space-empty { padding: 12px 10px; font-size: 10.5px; color: var(--muted); line-height: 1.6; }
.tone-blue { background: #EEF3FF; color: #3E6EF4; }
.tone-violet { background: #F1EFFE; color: #6A5AE0; }
.tone-mint { background: #E9FAF2; color: #22A86F; }
.tone-orange { background: #FFF6E6; color: #D68A00; }
.tone-pink { background: #FDEEF4; color: #D84E7C; }
.tone-cyan { background: #E8F8FA; color: #1B93A2; }
.tone-gray { background: #F1F4F9; color: #7A8499; }
.tone-red { background: #FEECEC; color: #D64545; }
.side-foot { flex: none; display: flex; flex-direction: column; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.storage-card { background: #F8FAFD; border: 1px solid #EEF2F8; border-radius: 11px; padding: 10px 11px; }
.storage-head { display: flex; justify-content: space-between; align-items: center; font-size: 9.5px; color: var(--muted); }
.storage-head strong { font-size: 9.5px; color: #5B6476; font-weight: 600; }
.bar { height: 5px; border-radius: 99px; background: #E8EDF6; margin: 7px 0 6px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5B8DEF, #34C88A); }
.storage-card p { margin: 0; font-size: 9px; color: #A3ABBA; }
.user-card {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 7px;
  border: 0; border-radius: 11px; background: transparent; text-align: left;
}
.user-card:hover { background: #F6F8FC; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(145deg, #4C7BFF, #2F5CE0); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(47, 92, 224, .2);
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.user-meta strong { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-chip {
  font-size: 8px; color: #8A93A5; background: #F2F5FA; border-radius: 5px;
  padding: 2px 5px; letter-spacing: .04em; flex: none;
}

/* ============ Topbar ============ */
.main { margin-left: 264px; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 64px; flex: none; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  position: sticky; top: 0; z-index: 30;
}
.menu-btn { display: none; }
.crumb-wrap { display: flex; align-items: center; gap: 7px; min-width: 0; }
.crumb-root { font-size: 14px; font-weight: 700; white-space: nowrap; }
.crumb-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.crumb-sub:not(:empty)::before { content: "/"; margin-right: 7px; color: #C5CDDC; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; min-width: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; display: grid; place-items: center; color: #5C6577; position: relative;
}
.icon-btn:hover { background: #F4F6FB; color: var(--ink); }
.search-wrap {
  position: relative; width: 300px; height: 38px; display: flex; align-items: center;
  gap: 8px; padding: 0 9px 0 10px; border: 1px solid var(--line); border-radius: 11px;
  background: #F8FAFD; color: var(--muted); transition: .15s;
}
.search-wrap:focus-within { background: #fff; border-color: #C9D7FF; box-shadow: 0 0 0 3px rgba(62, 110, 244, .1); }
.search-wrap input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 12.5px; color: var(--ink); }
.search-wrap input::placeholder { color: #A7B0C0; }
.search-wrap kbd {
  font-family: inherit; font-size: 9px; padding: 2px 5px; border: 1px solid #E1E7F0;
  border-radius: 5px; background: #fff; color: #9AA4B5; flex: none;
}
.search-ico { width: 16px; height: 16px; }
.search-pop {
  position: absolute; top: 46px; left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 6px; max-height: 370px; overflow: auto;
}
.search-result {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px;
  border: 0; border-radius: 9px; background: none; text-align: left;
}
.search-result:hover { background: #F5F8FF; }
.search-result-info { min-width: 0; flex: 1; }
.search-result-info strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-info span { display: block; font-size: 9.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.search-empty { padding: 22px 12px; text-align: center; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.search-foot { padding: 7px 10px; border-top: 1px solid var(--line-soft); font-size: 9.5px; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.search-foot .i { width: 12px; height: 12px; color: var(--brand); }
.role-switch {
  position: relative; display: flex; align-items: center; gap: 7px; height: 38px;
  padding: 0 9px 0 10px; border: 1px solid var(--line); border-radius: 11px;
  background: #fff; color: var(--body); flex: none;
}
.role-switch:hover { border-color: #D5DEF0; }
.role-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); flex: none; }
.role-switch select {
  appearance: none; border: 0; background: transparent; outline: none;
  font-size: 11.5px; font-weight: 600; color: var(--ink); padding-right: 16px;
  cursor: pointer; max-width: 190px;
}
.role-switch .chev { position: absolute; right: 7px; width: 13px; height: 13px; color: var(--muted); pointer-events: none; }
.bell-dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #F04438; border: 1.5px solid #fff; }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; flex: none; }

/* ============ Common ============ */
.content { padding: 24px 28px 48px; width: 100%; max-width: 1480px; margin: 0 auto; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head.compact { align-items: center; margin-bottom: 16px; }
.eyebrow { margin: 0 0 7px; font-size: 9.5px; letter-spacing: .18em; color: var(--brand); font-weight: 800; }
.page-title { margin: 0; font-size: 24px; line-height: 1.3; letter-spacing: -.015em; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.page-title.small { font-size: 20px; }
.page-sub { margin: 7px 0 0; font-size: 12.5px; color: var(--body); max-width: 760px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: #465066; display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { background: #FAFBFE; border-color: #D7E0F0; }
.btn-primary {
  background: linear-gradient(135deg, #4C7BFF, #2F5CE0); color: #fff; border-color: transparent;
  box-shadow: 0 8px 18px rgba(47, 92, 224, .2);
}
.btn-primary:hover { background: linear-gradient(135deg, #4677FF, #2854D6); border-color: transparent; }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn-soft:hover { background: #E5ECFF; border-color: transparent; }
.btn-danger-ghost { color: #C43D3D; border-color: #F3DADA; background: #FFF8F8; }
.btn-danger-ghost:hover { background: #FFF1F1; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn .i { width: 15px; height: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { background: #fff; border-color: var(--line); }
.level-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 6px; font-size: 9.5px; font-weight: 800; letter-spacing: .03em; white-space: nowrap;
}
.level-L1 { background: #E9FAF2; color: #1F9D68; }
.level-L2 { background: #EEF3FF; color: #3E6EF4; }
.level-L3 { background: #FFF6E6; color: #B77900; }
.level-L4 { background: #FEECEC; color: #C43D3D; }
.status-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: 6px; font-size: 9.5px; font-weight: 700; white-space: nowrap;
}
.status-published { background: #E9FAF2; color: #1F9D68; }
.status-pending { background: #FFF6E6; color: #B77900; }
.status-rejected { background: #FEECEC; color: #C43D3D; }
.status-draft { background: #F1F4F9; color: #6F7A8E; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.panel-title { margin: 0; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-title .i { color: var(--brand); }
.panel-sub { margin: 3px 0 0; font-size: 10.5px; color: var(--muted); }
.panel-body { padding: 18px; }
.notice {
  display: flex; gap: 9px; padding: 11px 13px; border-radius: 11px;
  font-size: 11px; line-height: 1.6; margin-bottom: 12px;
  background: #F1F6FF; color: #43506B; border: 1px solid #DFE9FF;
}
.notice .i { color: var(--brand); margin-top: 1px; }
.notice.warn { background: #FFF8EC; border-color: #FBE7C2; color: #7A5B1E; }
.notice.warn .i { color: #D68A00; }
.notice.danger { background: #FFF1F1; border-color: #FAD9D9; color: #8A3B3B; }
.notice.danger .i { color: #D64545; }
.notice.mint { background: #F0FBF6; border-color: #D6F2E5; color: #256A4B; }
.notice.mint .i { color: #22A86F; }

/* ============ Spaces ============ */
.overview {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px; align-items: center; padding: 20px 22px; margin-bottom: 18px;
  background: linear-gradient(120deg, #F1F5FF 0%, #F8FBFF 52%, #F0FBF7 100%);
  border: 1px solid #E3EBFA; border-radius: 18px;
}
.overview::after {
  content: ""; position: absolute; right: -70px; top: -90px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(107, 221, 159, .2), transparent 66%);
}
.overview-copy { position: relative; z-index: 1; }
.overview h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.overview p { margin: 6px 0 0; font-size: 11.5px; color: #667086; max-width: 560px; line-height: 1.65; }
.overview-stats { position: relative; z-index: 1; display: flex; gap: 26px; padding-right: 4px; }
.ov-stat { display: flex; flex-direction: column; gap: 2px; }
.ov-stat strong { font-size: 22px; letter-spacing: -.03em; line-height: 1.2; }
.ov-stat span { font-size: 9.5px; color: #7C8699; white-space: nowrap; }
.space-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(295px, 1fr)); gap: 14px; }
.space-card {
  display: flex; flex-direction: column; gap: 12px; padding: 18px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
  text-align: left; min-width: 0;
}
.space-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(23, 34, 84, .09); border-color: #D9E3F5; }
.space-top { display: flex; gap: 12px; align-items: flex-start; }
.space-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.space-icon .i { width: 21px; height: 21px; }
.space-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.space-title h3 { margin: 0; font-size: 14px; font-weight: 700; }
.space-desc {
  margin: 5px 0 0; font-size: 11.5px; color: var(--body); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.space-stats { display: flex; gap: 14px; font-size: 10px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 11px; }
.space-stats strong { color: var(--ink); font-size: 12px; margin-right: 2px; }
.access-line {
  display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: #6B7488;
  background: #F7F9FC; border-radius: 8px; padding: 7px 9px;
}
.access-line .i { width: 13px; height: 13px; color: var(--brand); }
.space-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.space-enter { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--brand); font-weight: 700; }
.space-enter .i { width: 13px; height: 13px; }
.space-owner { font-size: 9.5px; color: #A3ABBA; }
.gov-card {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gov-item { display: flex; gap: 10px; padding: 15px 18px; border-right: 1px solid var(--line-soft); min-width: 0; }
.gov-item:last-child { border: 0; }
.gov-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.gov-ico .i { width: 15px; height: 15px; }
.gov-item strong { display: block; font-size: 11.5px; margin-bottom: 2px; }
.gov-item p { margin: 0; font-size: 10px; color: var(--muted); line-height: 1.55; }
.auditor-banner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 54px 24px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.auditor-banner .lock-orb { margin-bottom: 14px; }
.auditor-banner h2 { font-size: 18px; margin: 0 0 7px; }
.auditor-banner p { margin: 0 0 18px; font-size: 11.5px; color: var(--body); max-width: 460px; line-height: 1.7; }

/* ============ Library ============ */
.library-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 14px; align-items: start; }
.folder-panel {
  position: sticky; top: 88px; max-height: calc(100vh - 106px);
  display: flex; flex-direction: column; overflow: hidden;
}
.folder-head { padding: 13px 15px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.folder-head strong { font-size: 11.5px; }
.folder-head span { font-size: 9.5px; color: var(--muted); }
.folder-tree { overflow: auto; padding: 7px; }
.tree-item { display: block; }
.tree-row {
  width: 100%; height: 34px; padding: 0 8px; border: 0; border-radius: 8px;
  background: none; color: var(--body); font-size: 11.5px; display: flex;
  align-items: center; gap: 6px; text-align: left; transition: background .12s;
}
.tree-row:hover { background: #F5F8FD; }
.tree-row.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.tree-row.locked { color: #8C95A7; }
.tree-caret { width: 13px; height: 13px; color: #AAB3C3; transition: transform .15s; flex: none; }
.tree-caret.blank { visibility: hidden; }
.tree-item.open > .tree-row .tree-caret { transform: rotate(90deg); }
.tree-row .folder-ico { width: 15px; height: 15px; color: #7C93C9; flex: none; }
.tree-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-lock { width: 11px; height: 11px; color: #B0B8C8; flex: none; }
.tree-caret, .folder-ico, .tree-lock, .lock-mini {
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.tree-count { font-size: 9px; color: #A6AFBF; flex: none; }
.tree-children { display: none; padding-left: 14px; }
.tree-item.open > .tree-children { display: block; }
.tree-root { margin-bottom: 2px; }
.file-panel { min-width: 0; overflow: hidden; }
.file-panel .panel-head { padding: 14px 17px; }
.file-tools { display: flex; align-items: center; gap: 6px; }
.file-count { font-size: 10px; color: var(--muted); }
.file-table { width: 100%; border-collapse: collapse; }
.file-table th {
  padding: 9px 14px; background: #FAFBFD; border-bottom: 1px solid var(--line-soft);
  font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: #98A1B3;
  font-weight: 700; text-align: left; white-space: nowrap;
}
.file-table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); font-size: 11px; color: var(--body); vertical-align: middle; }
.file-table tbody tr { cursor: pointer; transition: background .12s; }
.file-table tbody tr:hover { background: #F8FAFF; }
.file-table tbody tr:last-child td { border-bottom: 0; }
.cell-name { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.file-ico {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff;
  font-size: 8px; font-weight: 800; letter-spacing: .02em;
}
.ext-docx { background: linear-gradient(145deg, #5B8DEF, #3E6EF4); }
.ext-pdf { background: linear-gradient(145deg, #FF8A8E, #E5484D); }
.ext-xlsx { background: linear-gradient(145deg, #54D6A2, #22A86F); }
.ext-pptx { background: linear-gradient(145deg, #FFB55C, #F08A00); }
.ext-mp4 { background: linear-gradient(145deg, #A78BFA, #6A5AE0); }
.ext-default { background: linear-gradient(145deg, #9AA9C4, #6F7F9D); }
.file-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.file-name strong { font-size: 11.5px; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name span { font-size: 9.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 1px; justify-content: flex-end; }
.icon-action {
  width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent;
  display: grid; place-items: center; color: #8993A6;
}
.icon-action:hover { background: #EFF3FB; color: var(--brand); }
.icon-action:disabled { opacity: .32; cursor: not-allowed; }
.icon-action:disabled:hover { background: transparent; color: #8993A6; }
.file-empty { padding: 54px 20px; text-align: center; color: var(--muted); font-size: 11.5px; }
.file-empty .i { width: 28px; height: 28px; color: #C6CFDF; margin-bottom: 7px; }
.file-empty strong { display: block; color: var(--ink); font-size: 13px; margin: 5px 0 4px; }
.file-foot { padding: 10px 16px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 9.5px; color: var(--muted); }
.file-foot span { display: inline-flex; align-items: center; gap: 5px; }
.file-foot .i { width: 12px; height: 12px; color: #8FB0FF; }
.subfolders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 14px 2px; }
.subfolder-card {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: #FBFCFE; text-align: left; transition: border-color .15s, background .15s;
}
.subfolder-card:hover { border-color: #C9D8FF; background: #F5F8FF; }
.subfolder-card.locked { opacity: .72; }
.sf-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: #EEF3FF; color: var(--brand);
}
.sf-ico .i { width: 15px; height: 15px; }
.sf-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.sf-body strong { font-size: 11.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-body small { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.sf-arrow { width: 13px; height: 13px; color: #AAB3C3; flex: none; }
.inbox-banner { margin: 12px 16px 0; }

/* ============ File preview ============ */
.preview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 16px; align-items: start; }
.doc-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); overflow: hidden; }
.doc-page {
  position: relative; max-width: 780px; margin: 0 auto; background: #fff;
  padding: 44px 54px 56px; border: 1px solid #EEF1F7;
  box-shadow: 0 10px 30px rgba(23, 34, 84, .06); border-radius: 4px;
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  color: #2A2F3A; overflow: hidden;
}
.doc-brand {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: -apple-system, "PingFang SC", sans-serif; font-size: 8.5px;
  letter-spacing: .14em; color: #8C94A6; border-bottom: 1px solid #E8EBF2; padding-bottom: 11px;
}
.doc-title { margin: 30px 0 9px; font-size: 25px; line-height: 1.42; text-align: center; font-weight: 700; letter-spacing: .02em; }
.doc-meta { margin: 0 0 26px; text-align: center; font-size: 9.5px; color: #8A92A3; font-family: -apple-system, "PingFang SC", sans-serif; }
.doc-h2 {
  display: flex; align-items: center; gap: 7px; margin: 22px 0 7px;
  font-family: -apple-system, "PingFang SC", sans-serif; font-size: 13.5px; font-weight: 700;
}
.doc-h2::before { content: ""; width: 4px; height: 13px; border-radius: 2px; background: var(--brand); opacity: .65; }
.doc-p { margin: 0 0 9px; font-size: 12.5px; line-height: 2; text-align: justify; }
.doc-list { margin: 5px 0 11px; padding-left: 20px; font-size: 12.5px; line-height: 2; }
.doc-table { width: 100%; border-collapse: collapse; margin: 9px 0 14px; font-family: -apple-system, "PingFang SC", sans-serif; font-size: 10.5px; }
.doc-table th, .doc-table td { border: 1px solid #E3E7EF; padding: 7px 9px; text-align: left; }
.doc-table th { background: #F7F9FC; font-weight: 600; color: #5A6272; }
.doc-sign { margin-top: 32px; text-align: right; font-size: 11px; color: #6D7585; line-height: 1.9; }
.doc-seal {
  display: inline-grid; place-items: center; width: 78px; height: 78px; margin-top: 8px;
  border: 2px solid rgba(214, 69, 69, .5); border-radius: 50%; color: rgba(214, 69, 69, .68);
  font-family: -apple-system, "PingFang SC", sans-serif; font-size: 9px; transform: rotate(-12deg);
  text-align: center; line-height: 1.5;
}
.watermark {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 70px 18px; padding: 48px 18px;
  transform: rotate(-18deg) scale(1.16); opacity: .075;
}
.watermark span { font-family: -apple-system, "PingFang SC", sans-serif; font-size: 11px; color: #D64545; text-align: center; white-space: nowrap; }
.meta-panel { display: flex; flex-direction: column; gap: 12px; }
.meta-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px; box-shadow: var(--shadow-sm); }
.meta-card h3 { margin: 0 0 9px; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.meta-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 10.5px; border-bottom: 1px dashed #EFF2F7; }
.meta-row:last-child { border: 0; }
.meta-row > span { color: var(--muted); flex: none; }
.meta-row strong { font-weight: 600; color: #3C4558; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.perm-summary { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 10px; }
.perm-tag { font-size: 9.5px; padding: 3px 7px; border-radius: 6px; font-weight: 700; }
.perm-tag.ok { background: #E9FAF2; color: #1F9D68; }
.perm-tag.no { background: #F4F5F8; color: #8A93A5; }
.perm-tag.warn { background: #FFF6E6; color: #B77900; }
.perm-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font-size: 10.5px; color: var(--brand); font-weight: 600; }
.perm-link .i { width: 12px; height: 12px; }
.version-item { display: flex; gap: 8px; padding: 7px 0; font-size: 10px; color: var(--body); border-bottom: 1px dashed #EFF2F7; }
.version-item:last-child { border: 0; }
.version-dot { width: 6px; height: 6px; border-radius: 50%; background: #C9D2E2; margin-top: 5px; flex: none; }
.version-item.current .version-dot { background: var(--brand); }
.version-item strong { display: block; font-size: 10.5px; color: var(--ink); }
.version-item span { display: block; color: var(--muted); font-size: 9.5px; }

/* ============ Permissions ============ */
.acl-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); gap: 16px; align-items: start; }
.acl-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.acl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.acl-card-head h2 { margin: 0; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.acl-card-head .i { width: 15px; height: 15px; color: var(--brand); }
.acl-body { padding: 16px 18px 18px; }
.inherit-bar {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; margin-bottom: 14px;
  border: 1px solid #E4EBF7; border-radius: 11px; background: #F8FAFF;
}
.inherit-bar > .i { color: var(--brand); width: 16px; height: 16px; }
.inherit-bar strong { font-size: 11.5px; }
.inherit-bar p { margin: 2px 0 0; font-size: 9.5px; color: var(--muted); line-height: 1.5; }
.switch { position: relative; width: 36px; height: 20px; flex: none; margin-left: auto; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: #DCE2EC; transition: .16s; }
.switch .slider::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); transition: .16s;
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::after { transform: translateX(16px); }
.switch input:disabled + .slider { opacity: .55; }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.preset-card {
  position: relative; min-height: 72px; padding: 10px 11px; border: 1px solid var(--line);
  border-radius: 11px; background: #fff; text-align: left; transition: .15s;
}
.preset-card:hover { border-color: #C9D7FF; background: #FAFCFF; }
.preset-card.active { border-color: var(--brand); background: #F5F8FF; box-shadow: 0 0 0 3px rgba(62, 110, 244, .08); }
.preset-card.disabled { opacity: .48; pointer-events: none; }
.preset-card strong { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink); }
.preset-card p { margin: 4px 0 0; font-size: 9.5px; line-height: 1.5; color: var(--muted); }
.preset-card .checkmark {
  position: absolute; right: 8px; top: 8px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--brand); color: #fff;
  display: none; place-items: center; font-size: 9px; font-weight: 800;
}
.preset-card.active .checkmark { display: grid; }
.acl-note {
  display: flex; gap: 7px; padding: 9px 11px; margin-top: 12px; border-radius: 10px;
  background: #FFFBF0; border: 1px solid #F6E7C3; font-size: 10px; line-height: 1.55; color: #866321;
}
.acl-note .i { width: 13px; height: 13px; margin-top: 1px; color: #C58B13; }
.acl-note.danger { background: #FFF4F4; border-color: #F6DADA; color: #8A3B3B; }
.acl-note.danger .i { color: #D64545; }
.member-list { display: flex; flex-direction: column; }
.member-row {
  display: grid; grid-template-columns: minmax(0, 1.35fr) 76px minmax(0, 1.05fr) 26px;
  gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.member-row:last-child { border-bottom: 0; }
.member-subject { display: flex; align-items: center; gap: 8px; min-width: 0; }
.member-avatar {
  width: 27px; height: 27px; border-radius: 50%; flex: none; background: #EEF3FF;
  color: var(--brand); display: grid; place-items: center; font-size: 9.5px; font-weight: 800;
}
.member-subject strong { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-subject span { display: block; font-size: 9px; color: var(--muted); }
.member-type { font-size: 9.5px; color: var(--muted); }
.perm-select { width: 100%; height: 27px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 0 5px; font-size: 10px; color: #4C5568; }
.member-remove { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: #A6AFBF; display: grid; place-items: center; }
.member-remove:hover { background: #FFF1F1; color: #D64545; }
.member-remove .i { width: 13px; height: 13px; }
.member-empty { padding: 18px 0; font-size: 10.5px; color: var(--muted); text-align: center; }
.add-member { display: none; grid-template-columns: 88px minmax(0, 1fr) 105px auto; gap: 6px; padding-top: 11px; }
.add-member.open { display: grid; }
.add-member input, .add-member select {
  height: 31px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
  padding: 0 7px; font-size: 10px; min-width: 0; outline: none;
}
.add-member input:focus, .add-member select:focus { border-color: #B9CCFF; box-shadow: 0 0 0 2px rgba(62, 110, 244, .08); }
.readonly-banner {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 14px;
  background: #F5F7FC; border: 1px solid #E8EDF5; border-radius: 10px; font-size: 10.5px; color: #667086;
}
.readonly-banner .i { width: 14px; height: 14px; color: #8A93A5; }
.member-perm { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.deny-toggle {
  display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; color: var(--muted);
  white-space: nowrap; cursor: pointer; line-height: 1.2;
}
.deny-toggle input { width: 11px; height: 11px; margin: 0; accent-color: #D64545; cursor: pointer; }
.member-row.is-self .deny-toggle { opacity: .6; }
.add-member .deny-toggle { font-size: 9px; padding-top: 2px; }
.add-member select:disabled, .perm-select:disabled, .deny-toggle input:disabled { cursor: not-allowed; }
@media (max-width: 700px) {
  .member-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 26px; }
  .member-type { display: none; }
  .add-member { grid-template-columns: 1fr 1fr; }
  .add-member .deny-toggle { grid-column: span 2; }
}

/* ============ Review ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; box-shadow: var(--shadow-sm); }
.stat-card > span { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--muted); }
.stat-card .i { width: 13px; height: 13px; color: #8FB0FF; }
.stat-card strong { display: block; margin-top: 5px; font-size: 22px; letter-spacing: -.03em; line-height: 1.2; }
.stat-card em { font-style: normal; font-size: 9px; color: var(--muted); margin-left: 5px; }
.tabs { display: flex; gap: 3px; width: max-content; padding: 3px; margin-bottom: 13px; background: #F1F4F9; border-radius: 10px; }
.tab {
  display: flex; align-items: center; gap: 6px; height: 29px; padding: 0 12px;
  border: 0; border-radius: 7px; background: transparent; color: var(--body);
  font-size: 11px; font-weight: 600;
}
.tab.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(23, 34, 84, .08); }
.tab b { font-size: 8.5px; padding: 1px 5px; border-radius: 999px; background: #EEF3FF; color: var(--brand); }
.review-list { overflow: hidden; }
.review-item {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) 84px 76px;
  gap: 12px; align-items: center; padding: 13px 17px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .12s;
}
.review-item:hover { background: #F8FAFF; }
.review-item:last-child { border-bottom: 0; }
.review-doc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.review-info { min-width: 0; }
.review-info strong { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-info span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--muted); }
.review-target { display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: var(--body); min-width: 0; }
.review-target small { font-size: 9px; color: var(--muted); }
.review-target span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-time { font-size: 9.5px; color: var(--muted); }
.review-state { justify-self: end; }
.review-disabled { font-size: 9px; color: #B77900; background: #FFF6E6; padding: 2px 5px; border-radius: 5px; }
.review-detail-doc { border: 1px solid var(--line-soft); border-radius: 12px; background: #FAFBFD; padding: 15px; margin-bottom: 14px; }
.review-detail-doc h4 { margin: 0 0 6px; font-size: 13px; }
.review-detail-doc p { margin: 0; font-size: 10.5px; line-height: 1.7; color: var(--body); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-head p { margin: 4px 0 0; font-size: 10.5px; color: var(--muted); }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line-soft); }
.review-note { width: 100%; height: 78px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; font-size: 11px; resize: vertical; outline: none; }
.review-note:focus { border-color: #B9CCFF; box-shadow: 0 0 0 3px rgba(62, 110, 244, .08); }

/* ============ Audit ============ */
.audit-toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-chip { height: 29px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--body); font-size: 10.5px; }
.filter-chip.active { background: var(--brand-soft); border-color: #D5E2FF; color: var(--brand); font-weight: 700; }
.audit-search {
  margin-left: auto; display: flex; align-items: center; gap: 6px; height: 31px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted);
}
.audit-search input { width: 170px; border: 0; outline: none; background: transparent; font-size: 10.5px; }
.audit-search .i { width: 14px; height: 14px; }
.audit-table { width: 100%; border-collapse: collapse; }
.audit-table th { padding: 9px 14px; background: #FAFBFD; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 9px; letter-spacing: .08em; color: #98A1B3; font-weight: 700; white-space: nowrap; }
.audit-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 10.5px; color: var(--body); vertical-align: middle; }
.audit-table tr:last-child td { border-bottom: 0; }
.audit-action { font-weight: 600; color: #3D4659; }
.audit-user { display: flex; align-items: center; gap: 7px; }
.audit-avatar { width: 24px; height: 24px; border-radius: 50%; background: #EEF3FF; color: var(--brand); display: grid; place-items: center; font-size: 9px; font-weight: 800; flex: none; }
.result-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: #1F9D68; background: #E9FAF2; border-radius: 5px; padding: 2px 6px; }
.result-warn { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: #B77900; background: #FFF6E6; border-radius: 5px; padding: 2px 6px; }
.result-deny { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: #C43D3D; background: #FEECEC; border-radius: 5px; padding: 2px 6px; }
.mono { font-variant-numeric: tabular-nums; font-family: "SF Mono", "Menlo", monospace; font-size: 9.5px; }

/* ============ Matrix ============ */
.matrix-wrap {
  overflow: auto; max-height: calc(100vh - 230px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.matrix-table { width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 0; font-size: 10.5px; }
.matrix-table th {
  position: sticky; top: 0; z-index: 2; padding: 10px 8px; background: #F8FAFD;
  border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap;
  font-size: 9px; letter-spacing: .05em; color: #8A94A6; font-weight: 800;
}
.matrix-table th:first-child {
  left: 0; z-index: 3; min-width: 188px; padding-left: 16px; text-align: left;
}
.matrix-table td {
  padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: center; vertical-align: middle;
}
.matrix-table td:first-child {
  position: sticky; left: 0; z-index: 1; min-width: 188px; padding-left: 16px;
  text-align: left; background: #fff;
}
.matrix-table tr.current td { background: #F7FAFF; }
.matrix-table tr.current td:first-child { background: #F7FAFF; }
.matrix-table tr:last-child td { border-bottom: 0; }
.matrix-role { display: flex; flex-direction: column; gap: 1px; }
.matrix-role strong { font-size: 11px; line-height: 1.4; }
.matrix-role span { font-size: 9px; color: var(--muted); }
.current-chip { display: inline-flex; width: max-content; margin-top: 2px; padding: 1px 5px; border-radius: 4px; background: var(--brand); color: #fff; font-size: 8px; font-weight: 700; }
.cell-yes { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: #E9FAF2; color: #1F9D68; font-size: 11px; font-weight: 800; }
.cell-scope { display: inline-block; max-width: 84px; font-size: 9px; color: #5A6376; line-height: 1.35; }
.cell-special { display: inline-block; padding: 2px 5px; border-radius: 5px; background: #FFF6E6; color: #B77900; font-size: 9px; line-height: 1.35; }
.cell-none { color: #C3CAD7; font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 13px; margin: 9px 2px 0; font-size: 9.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.matrix-bottom { display: grid; grid-template-columns: 1.08fr .92fr; gap: 16px; margin-top: 16px; }
.preset-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.preset-mini { padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.preset-mini strong { display: flex; align-items: center; gap: 5px; font-size: 10.5px; }
.preset-mini p { margin: 3px 0 0; font-size: 9px; line-height: 1.5; color: var(--muted); }
.rule-list { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.rule-list li { display: flex; gap: 7px; font-size: 10.3px; line-height: 1.6; color: var(--body); }
.rule-list .i { width: 13px; height: 13px; flex: none; margin-top: 2px; color: var(--brand); }
.redline { margin-top: 12px; padding: 10px 11px; border-radius: 10px; background: #FFF4F4; border: 1px solid #F6DADA; font-size: 9.8px; line-height: 1.6; color: #8A3B3B; }
.redline strong { display: block; font-size: 10px; margin-bottom: 2px; }

/* ============ No access / modal / drawer / toast ============ */
.no-access { min-height: 54vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; }
.lock-orb {
  width: 76px; height: 76px; margin-bottom: 18px; border-radius: 24px;
  background: linear-gradient(145deg, #EEF3FF, #E6FBF2); color: var(--brand);
  display: grid; place-items: center; box-shadow: 0 12px 30px rgba(62, 110, 244, .12);
}
.lock-orb .i { width: 32px; height: 32px; }
.no-access h2 { margin: 0 0 8px; font-size: 20px; }
.no-access p { max-width: 470px; margin: 0 0 18px; font-size: 11.5px; line-height: 1.75; color: var(--body); }
.overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(18, 26, 48, .42);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: 480px; max-width: 96vw;
  background: #fff; box-shadow: -20px 0 60px rgba(18, 26, 48, .18);
  transform: translateX(102%); transition: transform .22s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.modal-wrap {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(18, 26, 48, .44); opacity: 0; pointer-events: none; transition: .18s;
}
.modal-wrap.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(520px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(18, 26, 48, .28);
  transform: translateY(10px) scale(.98); transition: .18s; overflow: hidden;
}
.modal-wrap.open .modal { transform: none; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-head p { margin: 4px 0 0; font-size: 10.5px; color: var(--muted); }
.modal-body { padding: 17px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line-soft); }
.modal-close { width: 28px; height: 28px; border: 0; border-radius: 7px; background: #F5F7FC; color: #7A8499; display: grid; place-items: center; flex: none; }
.modal-close .i { width: 14px; height: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 10.5px; font-weight: 600; color: #5D6678; }
.field input, .field select, .field textarea {
  width: 100%; height: 37px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; padding: 0 10px; font-size: 11.5px; outline: none;
}
.field textarea { height: 80px; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #B9CCFF; box-shadow: 0 0 0 3px rgba(62, 110, 244, .08); }
.field .hint { font-size: 9.5px; color: var(--muted); line-height: 1.5; }
.dropzone {
  display: block; margin-bottom: 12px; padding: 22px 16px; border: 1.5px dashed #C8D7F5;
  border-radius: 12px; background: #F8FAFF; text-align: center; cursor: pointer;
}
.dropzone:hover { background: #F3F7FF; border-color: #AFC6F7; }
.dropzone .i { width: 23px; height: 23px; color: var(--brand); margin-bottom: 5px; }
.dropzone strong { display: block; font-size: 11.5px; }
.dropzone span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--muted); }
.dropzone input { display: none; }
.toast-stack {
  position: fixed; left: 50%; bottom: 26px; z-index: 200; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; max-width: 90vw;
  background: #1D2433; color: #fff; border-radius: 10px; font-size: 11.5px;
  box-shadow: 0 12px 30px rgba(18, 26, 48, .28); opacity: 0; transform: translateY(8px);
  transition: .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast .i { width: 14px; height: 14px; color: #7EE2B0; }

/* ============ Responsive ============ */
@media (max-width: 1280px) {
  .sidebar { width: 248px; }
  .main { margin-left: 248px; }
  .search-wrap { width: 240px; }
  .role-switch select { max-width: 160px; }
  .content { padding: 22px 24px 44px; }
}
@media (max-width: 1120px) {
  .search-wrap { width: 205px; }
  .search-wrap kbd { display: none; }
  .overview { grid-template-columns: 1fr; gap: 14px; }
  .overview-stats { padding-right: 0; }
  .preview-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .doc-page { padding: 38px 40px 48px; }
}
@media (max-width: 980px) {
  .sidebar {
    width: 272px; z-index: 95; transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: 20px 0 60px rgba(18, 26, 48, .14);
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .sidebar-close { display: grid; }
  .topbar { padding: 0 16px; height: 60px; }
  .content { padding: 20px 18px 40px; }
  .preview-layout { grid-template-columns: 1fr; }
  .meta-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acl-layout { grid-template-columns: 1fr; }
  .library-layout { grid-template-columns: 1fr; }
  .folder-panel { position: static; max-height: 230px; }
  .folder-tree { max-height: 186px; }
  .matrix-bottom { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .gov-card { grid-template-columns: 1fr; }
  .gov-item { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .gov-item:last-child { border-bottom: 0; }
}
@media (max-width: 820px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head.compact { align-items: flex-start; }
  .head-actions { width: 100%; }
  .search-wrap { width: 180px; }
  .role-switch select { max-width: 140px; }
  .space-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .review-item { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 74px; }
  .review-time { display: none; }
  .subfolders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-table th:nth-child(5), .file-table td:nth-child(5) { display: none; }
  .doc-page { padding: 32px 30px 42px; }
  .doc-title { font-size: 21px; }
  .meta-panel { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .search-wrap { display: none; }
  .topbar { gap: 8px; }
  .crumb-wrap { flex: 1 1 auto; overflow: hidden; }
  .crumb-root { flex: none; }
  .crumb-sub { max-width: 104px; min-width: 0; }
  .topbar-right { flex: none; gap: 5px; }
  .role-switch { padding: 0 8px; }
  .role-switch select { max-width: 104px; font-size: 10.5px; }
  .role-dot { display: none; }
  .crumb-sub { max-width: 150px; }
  .space-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .subfolders { grid-template-columns: 1fr; padding-top: 10px; }
  .preset-grid { grid-template-columns: 1fr; }
  .add-member { grid-template-columns: 1fr 1fr; }
  .add-member .btn { grid-column: span 2; }
  .file-table th:nth-child(3), .file-table td:nth-child(3),
  .file-table th:nth-child(4), .file-table td:nth-child(4) { display: none; }
  .file-table th, .file-table td { padding: 10px 10px; }
  .cell-name { min-width: 0; }
  .file-name strong { max-width: 190px; }
  .doc-page { padding: 26px 20px 36px; }
  .doc-title { font-size: 18px; }
  .doc-p, .doc-list { font-size: 11.5px; }
  .review-item { grid-template-columns: minmax(0, 1fr) 70px; }
  .review-target { display: none; }
  .overview-stats { gap: 18px; flex-wrap: wrap; }
  .audit-search { margin-left: 0; width: 100%; }
  .audit-search input { width: 100%; }
  .matrix-table { min-width: 980px; }
}
@media (max-width: 520px) {
  .content { padding: 16px 12px 36px; }
  .topbar { padding: 0 10px; gap: 6px; }
  .crumb-sub { display: none; }
  .avatar-btn { display: none; }
  .page-title { font-size: 21px; }
  .page-title.small { font-size: 18px; }
  .head-actions .btn { flex: 1; }
  .btn { padding: 0 10px; }
  .sidebar { width: 86vw; }
  .modal { border-radius: 16px; }
  .drawer { width: 100%; max-width: 100%; }
  .file-name strong { max-width: 150px; }
  .stat-card strong { font-size: 19px; }
  .doc-brand { font-size: 7px; letter-spacing: .08em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .overlay, .drawer, .modal-wrap, .toast-stack, .print-hide { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .page-head { margin-bottom: 12px; }
  .matrix-wrap { max-height: none; overflow: visible; border: 0; box-shadow: none; }
  .matrix-table { min-width: 0; font-size: 8.5px; }
  .matrix-table th, .matrix-table td { padding: 6px 4px; }
  .matrix-table th:first-child, .matrix-table td:first-child { position: static; min-width: 150px; }
  .matrix-table th { position: static; }
  .matrix-bottom { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
  .preset-mini-grid { grid-template-columns: repeat(3, 1fr); }
  .panel, .matrix-wrap, .preset-mini { box-shadow: none; }
  .rule-list li { font-size: 8.5px; }
}

/* ============ Login ============ */
.login-screen {
  min-height: 100vh; padding: 30px;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(76, 123, 255, .16), transparent 62%),
    radial-gradient(760px 520px at 100% 108%, rgba(52, 200, 138, .14), transparent 60%),
    #F3F6FC;
}
.login-shell {
  width: min(1120px, 100%); display: grid; grid-template-columns: 1.06fr .94fr;
  background: #fff; border: 1px solid rgba(232, 237, 245, .9); border-radius: 26px;
  overflow: hidden; box-shadow: 0 36px 90px rgba(23, 34, 84, .16);
}
.login-story {
  position: relative; overflow: hidden; color: #fff; padding: 40px 44px 32px;
  display: flex; flex-direction: column;
  background: linear-gradient(152deg, #142A66 0%, #2F5CE0 58%, #4C7BFF 100%);
}
.login-story::before {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  right: -190px; top: -170px; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 68%);
}
.login-story::after {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  left: -140px; bottom: -160px; background: radial-gradient(circle, rgba(52, 200, 138, .32), transparent 68%);
}
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; }
.login-brand .brand-text strong { color: #fff; }
.login-brand .brand-text small { color: rgba(255, 255, 255, .55); }
.login-copy { position: relative; z-index: 1; margin: auto 0; padding: 46px 0 34px; }
.login-copy .eyebrow { color: #A8C4FF; }
.login-copy h1 { margin: 0 0 16px; font-size: 37px; line-height: 1.34; letter-spacing: -.02em; }
.login-copy > p { margin: 0; max-width: 440px; font-size: 12.5px; line-height: 1.95; color: rgba(255, 255, 255, .74); }
.login-points { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.login-points li { display: flex; align-items: center; gap: 11px; }
.login-points li > span {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: rgba(255, 255, 255, .11); border: 1px solid rgba(255, 255, 255, .16);
}
.login-points .i { width: 16px; height: 16px; }
.login-points strong { display: block; font-size: 12px; }
.login-points small { display: block; font-size: 10px; color: rgba(255, 255, 255, .58); margin-top: 1px; }
.login-story-foot {
  position: relative; z-index: 1; margin: 0; display: flex; align-items: center; gap: 7px;
  font-size: 9.5px; color: rgba(255, 255, 255, .58);
}
.login-story-foot .i { width: 13px; height: 13px; }
.login-card { padding: 42px 46px 30px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.login-card-head .eyebrow { margin-bottom: 8px; }
.login-card-head h2 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.login-card-head > p:last-child { margin: 8px 0 24px; font-size: 11.5px; line-height: 1.7; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 13px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field > span { font-size: 10.5px; font-weight: 700; color: #5D6678; }
.login-field input {
  height: 44px; border: 1px solid var(--line); border-radius: 11px; background: #F9FBFE;
  padding: 0 13px; font-size: 13px; outline: none; transition: .15s;
}
.login-field input:focus { background: #fff; border-color: #B9CCFF; box-shadow: 0 0 0 3px rgba(62, 110, 244, .1); }
.login-error {
  margin: 0; padding: 9px 11px; border-radius: 9px; font-size: 11px;
  background: #FFF1F1; border: 1px solid #F6DADA; color: #B23B3B;
}
.login-submit { height: 44px; margin-top: 3px; font-size: 13.5px; }
.login-submit.loading { pointer-events: none; opacity: .72; }
.login-sso { display: flex; flex-direction: column; gap: 9px; margin-bottom: 17px; }
.login-sso-btn { height: 44px; justify-content: center; font-size: 13.5px; text-decoration: none; }
.login-sso-note { margin: 0; font-size: 9.5px; line-height: 1.6; color: var(--muted); text-align: center; }
.login-divider { position: relative; text-align: center; margin-top: 5px; }
.login-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #E7ECF5; }
.login-divider span { position: relative; padding: 0 10px; background: #fff; font-size: 9.5px; color: #9AA3B5; letter-spacing: .04em; }
.login-demo { margin-top: 24px; padding-top: 19px; border-top: 1px dashed #E3E9F3; }
.login-demo-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.login-demo-head strong { font-size: 10.5px; letter-spacing: .08em; color: #6A7385; }
.login-demo-head span { font-size: 9.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.demo-account {
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  text-align: left; transition: .15s; min-width: 0;
}
.demo-account:hover { border-color: #B9CCFF; background: #F7FAFF; }
.demo-account strong { display: block; font-size: 11px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-account small { display: block; margin-top: 2px; font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-demo-note { margin: 10px 0 0; font-size: 9px; line-height: 1.6; color: #A0A8B8; }
.login-card-foot {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 14px;
  border-top: 1px solid var(--line-soft); font-size: 9px; color: #A3ABBA;
}
.login-card-foot span { display: inline-flex; align-items: center; gap: 5px; }
.login-card-foot .i { width: 12px; height: 12px; }

/* ============ Account / topbar avatar ============ */
.avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; flex: none;
  background: linear-gradient(145deg, #4C7BFF, #2F5CE0); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(47, 92, 224, .22);
}
.avatar-btn:hover { filter: brightness(1.05); }
.account-box { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #F9FBFE; }
.account-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, #4C7BFF, #2F5CE0); color: #fff; font-size: 16px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(47, 92, 224, .25);
}
.account-box strong { display: block; font-size: 14px; }
.account-box small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.account-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.account-tags span { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: #EEF3FF; color: var(--brand); }
.account-tags span.mint { background: #E9FAF2; color: #1F9D68; }
.account-tags span.gray { background: #F2F4F8; color: #7A8499; }
.account-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.account-actions .btn { flex: 1; min-width: 120px; }
.account-note { margin: 14px 0 0; font-size: 9.5px; line-height: 1.65; color: var(--muted); }

/* ============ Download requests ============ */
.request-list { display: flex; flex-direction: column; }
.request-row {
  display: flex; align-items: flex-start; gap: 13px; padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.request-row:last-child { border-bottom: 0; }
.request-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: #FFF6E6; color: #C58B13;
}
.request-icon .i { width: 17px; height: 17px; }
.request-main { flex: 1; min-width: 0; }
.request-main strong { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-main > span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.request-reason {
  margin-top: 7px; padding: 8px 10px; border-radius: 8px; background: #F8FAFD;
  border: 1px solid #EEF2F8; font-size: 10.5px; line-height: 1.6; color: #626B7D;
}
.request-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex: none; }
.request-side .btn { height: 29px; font-size: 10.5px; }
.request-actions { display: flex; gap: 6px; }
.request-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 11px; }
.request-section-title { margin: 22px 2px 9px; font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 800; }
.request-status { font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.request-status.pending { background: #FFF6E6; color: #B77900; }
.request-status.approved { background: #E9FAF2; color: #1F9D68; }
.request-status.rejected { background: #FEECEC; color: #C43D3D; }

/* ============ Preview content ============ */
.preview-loading {
  min-height: 380px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 11.5px;
}
.spinner {
  width: 26px; height: 26px; margin: 0 auto 10px; border-radius: 50%;
  border: 2.5px solid #E4EAF6; border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.doc-text { margin: 0; font-family: "Songti SC", "Noto Serif SC", Georgia, serif; font-size: 12.5px; line-height: 2.05; color: #343B49; white-space: pre-wrap; word-break: break-word; }
.preview-media { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 4px; position: relative; z-index: 3; }
.preview-frame { width: 100%; height: 72vh; border: 0; border-radius: 4px; background: #fff; position: relative; z-index: 1; }
.preview-video { display: block; width: 100%; max-height: 68vh; background: #000; border-radius: 4px; position: relative; z-index: 3; }
.preview-fallback { padding: 30px 10px 20px; text-align: center; color: var(--body); position: relative; z-index: 3; }
.preview-fallback .file-ico { margin: 0 auto 12px; width: 54px; height: 54px; border-radius: 14px; font-size: 10px; }
.preview-fallback strong { display: block; font-size: 13px; margin-bottom: 6px; }
.preview-fallback p { margin: 0 auto; max-width: 420px; font-size: 11px; line-height: 1.75; color: var(--muted); }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 0 2px; font-size: 9.5px; color: var(--muted); }
.preview-toolbar span { display: inline-flex; align-items: center; gap: 5px; }
.preview-toolbar .i { width: 12px; height: 12px; }

/* ============ Misc ============ */
.member-self { font-size: 8.5px; color: #B77900; background: #FFF6E6; border-radius: 4px; padding: 1px 5px; margin-left: 5px; }
.member-row.is-self .perm-select { opacity: .65; }
.review-preview-link { margin-top: 10px; }
.detail-note { margin: 10px 0 0; font-size: 9.5px; color: var(--muted); line-height: 1.6; }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; max-width: 560px; }
  .login-story { padding: 30px 32px 24px; }
  .login-copy { padding: 26px 0 18px; }
  .login-copy h1 { font-size: 28px; }
  .login-copy > p { font-size: 11.5px; }
  .login-points { display: none; }
  .login-card { padding: 32px 32px 24px; }
}
@media (max-width: 680px) {
  .login-screen { padding: 0; align-items: stretch; }
  .login-shell { border-radius: 0; border: 0; min-height: 100vh; max-width: none; }
  .login-story { padding: 24px 22px 18px; }
  .login-copy { padding: 18px 0 8px; }
  .login-copy h1 { font-size: 24px; }
  .login-copy > p { display: none; }
  .login-card { padding: 26px 22px 20px; justify-content: flex-start; }
  .login-card-head > p:last-child { margin-bottom: 18px; }
  .demo-grid { grid-template-columns: 1fr; }
  .login-card-foot { flex-direction: column; gap: 4px; }
  .request-row { flex-wrap: wrap; }
  .request-side { width: 100%; flex-direction: row; justify-content: flex-end; }
}
