:root {
  --bg:#f5f7f9;
  --line:#e4e9ee;
  --ink:#243341;
  --muted:#566674;
  --brand:#2563eb;
  --brand-soft:#e8f3ff;
  --brand-hover:#1d4ed8;
  --brand-border:#cbdaf2;
  --ok:#23714f;
  --ok-soft:#edf7f0;
  --warn:#95601a;
  --warn-soft:#fff5e6;
  --bad:#b3443e;
  --bad-soft:#fcf0ef;
  --radius:12px;
  --card:#ffffff;
  --color-text-primary:var(--ink);
  --color-text-secondary:var(--muted);
  --color-text-tertiary:var(--muted);
  --color-text-danger:var(--bad);
  --color-text-success:var(--ok);
  --color-text-warning:var(--warn);
  --color-border-primary:var(--line);
  --color-border-secondary:#d4dde5;
  --color-border-tertiary:var(--line);
  --color-background-info:#edf3fa;
  --color-text-info:#4d709f;
  --color-background-primary:#ffffff;
}


* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 0 28px; height: 56px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand-sub {
  margin-left: 6px; padding: 2px 6px; border-radius: 5px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 600;
}

.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.who form { margin: 0; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0; }
.link:hover { color: var(--bad); }

/* 布局 */
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px; }
.page-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--muted); font-size: 13px; }

/* 卡片与网格 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .g4, .g3, .g2 { grid-template-columns: 1fr 1fr; } }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px; height: 36px;
  align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer;
}
.nav-toggle:hover { background: #f0f1f4; }

.client-hits {
  display: none; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; margin: 0 0 10px; overflow: hidden;
}
.client-hits.on { display: block; }
.client-hits button {
  display: block; width: 100%; text-align: left; background: none;
  border: 0; border-bottom: 1px solid #f0f1f4; padding: 8px 12px;
  cursor: pointer; font: inherit;
}
.client-hits button:last-child { border-bottom: 0; }
.client-hits button:hover { background: #f5f6f8; }
.pager {
  display: flex; gap: 10px; align-items: center;
  margin-top: 12px; padding: 4px 12px 10px; font-size: 13px;
}

@media (max-width: 620px) {
  .wrap { padding: 16px; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }

}

.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }
.stat .value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* 进度 */
.bar { height: 6px; background: #eef0f3; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid #f0f1f4; vertical-align: middle; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* 徽标 */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-expiring { background: var(--warn-soft); color: var(--warn); }
.badge-expired { background: var(--bad-soft); color: var(--bad); }
.badge-missing { background: #f1f2f5; color: var(--muted); }
.s-gray { background: #f1f2f5; color: var(--muted); }
.s-blue { background: var(--brand-soft); color: var(--brand); }
.s-amber { background: var(--warn-soft); color: var(--warn); }
.s-indigo { background: #eef0ff; color: #4338ca; }
.s-green { background: var(--ok-soft); color: var(--ok); }
.s-red { background: var(--bad-soft); color: var(--bad); }

/* 筛选条 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.chip {
  padding: 6px 12px; border-radius: 99px; background: var(--card);
  border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500;
}
.chip:hover { border-color: #cfd3da; color: var(--ink); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip b { font-weight: 700; }

/* 表单 */
input[type=text], input[type=search], input[type=password], input[type=date], input[type=time], input[type=number],
input[type=url], input[type=tel], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d8dbe2; border-radius: 8px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-ghost { background: #fff; border-color: #d8dbe2; color: var(--ink); font-weight: 500; }
.btn-ghost:hover { background: #f7f8fa; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-danger { background: var(--bad); }

/* 提示 */
.flash {
  padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px;
}
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-bad { background: var(--bad-soft); color: var(--bad); }

.empty {
  padding: 44px 20px; text-align: center; color: var(--muted); font-size: 14px;
}
.section-title {
  font-size: 14px; font-weight: 600; color: var(--muted);
  margin: 26px 0 10px; letter-spacing: 0.02em;
}

/* 登录页 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* 项目详情头部 */
.detail-head {
  display: flex; justify-content: space-between; gap: 20px;
  align-items: flex-start; flex-wrap: wrap;
}
.detail-head h1 { line-height: 1.4; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.countdown { font-size: 13px; font-weight: 600; }
.countdown.bad { color: var(--bad); }
.countdown.warn { color: var(--warn); }

/* 状态下拉着色 */
select.st { padding: 4px 6px; font-size: 12.5px; font-weight: 600; }
select.st-ok { color: var(--ok); border-color: #b7e0cd; background: var(--ok-soft); }
select.st-bad { color: var(--bad); border-color: #f3c7c3; background: var(--bad-soft); }
select.st-warn { color: var(--warn); border-color: #f0d9b5; background: var(--warn-soft); }

/* 导航未读角标 */
.nav-badge {
  display: inline-block; min-width: 17px; padding: 0 5px; margin-left: 5px;
  background: var(--bad); color: #fff; border-radius: 99px;
  font-size: 12px; font-weight: 700; line-height: 17px; text-align: center;
}

/* 律所工作区及 Tabler 图标布局 */
html {
  scroll-padding-top:92px;
}

body {
  font-size:14px;
  line-height:1.65;
}

button,input,select,textarea {
  font:inherit;
}

button {
  cursor:pointer;
}

h1,h2,h3,p {
  overflow-wrap:anywhere;
}

h1,h2,h3 {
  line-height:1.45;
  font-weight:650;
  letter-spacing:-.025em;
}

h1 {
  font-size:25px;
}

h2 {
  font-size:18px;
}

h3 {
  font-size:15px;
}

p {
  margin:10px 0;
}

a:focus-visible,button:focus-visible,summary:focus-visible {
  outline:3px solid var(--brand);
  outline-offset:3px;
}

.icon {
  display:inline-block;
  flex:none;
  vertical-align:middle;
}

.skip-link {
  position:fixed;
  left:12px;
  top:-80px;
  z-index:100;
  padding:10px 18px;
  background:var(--ink);
  color:#fff;
  border-radius:8px;
}

.skip-link:focus {
  top:12px;
}

.sidebar {
  position:fixed;
  inset:0 auto 0 0;
  width:232px;
  z-index:30;
  background:#fff;
  border-right:1px solid var(--line);
  padding:30px 18px 22px;
  display:flex;
  flex-direction:column;
}

.brand {
  display:flex;
  gap:11px;
  align-items:center;
  padding:0 12px 29px;
  font-size:19px;
  font-weight:650;
  letter-spacing:.03em;
}

.brand-mark {
  display:block;
  flex:none;
  width:36px;
  height:40px;
  object-fit:contain;
}

.brand-sub {
  display:block;
  padding:0;
  border-radius:0;
  background:none;
  margin:1px 0 0;
  font-size:12px;
  font-weight:400;
  color:var(--muted);
  letter-spacing:.12em;
}

.nav {
  display:flex;
  flex:0 1 auto;
  flex-direction:column;
  gap:8px;
  overflow-y:auto;
}

.nav-group {
  display:grid;
  gap:2px;
}

.nav-home + .nav-group {
  border-top:1px solid var(--line);
  padding-top:6px;
}

.nav-label {
  padding:6px 13px 4px;
  font-size:12px;
  color:var(--muted);
  line-height:1.5;
  letter-spacing:.12em;
}

.nav a {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:40px;
  padding:8px 13px;
  border-radius:8px;
  color:#637383;
  font-weight:500;
}

.nav a:hover {
  background:#f5f8f8;
  color:var(--ink);
}

.nav a.on {
  background:var(--brand-soft);
  color:var(--brand);
  font-weight:650;
}

.nav a .icon {
  width:19px;
  height:19px;
}

.nav a:focus-visible {
  outline-offset:-2px;
}

.sidebar-footer {
  margin-top:auto;
  padding:24px 12px 0;
  display:flex;
  gap:10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.7;
}

.sidebar-footer small {
  color:var(--muted);
  font-size:12px;
}

.has-sidebar .workspace {
  margin-left:232px;
}

.workspace {
  min-height:100vh;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.topbar {
  height:76px;
  min-height:76px;
  flex-wrap:nowrap;
  position:sticky;
  top:0;
  z-index:20;
  background:#ffffffed;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:0 36px;
  backdrop-filter:blur(12px);
}

.breadcrumb {
  display:flex;
  align-items:center;
  gap:12px;
  font-size:12px;
  color:var(--muted);
}

.breadcrumb .icon {
  width:13px;
  height:13px;
}

.breadcrumb strong {
  color:#536575;
  font-weight:500;
}

.parent-nav { min-width: 0; gap: 8px; }
.parent-nav .parent-link, .parent-current { display: inline-flex; align-items: center; gap: 6px; }
.parent-link {
  min-height: 44px; min-width: 44px; max-width: 100%; border-radius: 4px;
  color: var(--brand-hover); font-size: 13px; font-weight: 550;
  text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere;
}
.parent-link:hover { color: var(--brand); }
.parent-nav .parent-link .icon, .parent-prefix { display: none; }
.parent-current { color: var(--muted); }

.who {
  gap:24px;
  font-size:12px;
}

.user-link {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:12px;
  line-height:1.5;
}

.user-link small {
  display:block;
  color:var(--muted);
  font-size:12px;
}

.avatar {
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:50%;
  color:var(--brand);
  background:var(--brand-soft);
  font-size:12px;
}

.wrap {
  width:100%;
  max-width:1440px;
  padding:32px 36px 44px;
  margin:0 auto;
  flex:1;
  min-width:0;
  outline:none;
}

.workspace-footer {
  padding:18px 36px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  font-size:12px;
  color:var(--muted);
}

.page-head {
  align-items:center;
  flex-wrap:wrap;
  gap:14px;
  margin-bottom:24px;
}

.page-head h1 {
  font-size:25px;
}

.page-head .sub {
  font-size:12px;
}

.page-heading p {
  margin:5px 0 0;
  color:var(--muted);
  font-size:13px;
}

.page-head .btn {
  margin-left:auto;
}

.eyebrow {
  font-size:12px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--muted);
  font-weight:600;
  margin-bottom:7px;
}

.card {
  padding:22px 24px;
  min-width:0;
  box-shadow:0 2px 3px #24334102;
}

.card-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:18px;
}

.card-head h2 {
  font-size:15px;
  letter-spacing:0;
}

.card-head a:not(.btn) {
  color:var(--muted);
  font-size:13px;
}

.card-head p {
  margin:3px 0 0;
  font-size:13px;
  color:var(--muted);
}

.grid {
  gap:18px;
  min-width:0;
}

.row2 {
  gap:16px;
}

.section-title {
  color:var(--ink);
  margin:22px 0 14px;
  letter-spacing:0;
}

.card>.section-title:first-child {
  margin-top:0;
}

.dashboard-stats {
  margin-bottom:24px;
}

.dashboard-stats-narrow {
  display:none;
}

.stat {
  position:relative;
  padding:22px;
}

.stat .label {
  font-size:13px;
}

.stat .value {
  font-size:32px;
  font-weight:600;
  line-height:1.3;
  letter-spacing:-.04em;
  margin-top:12px;
  font-variant-numeric:tabular-nums;
}

.stat .hint {
  font-size:12px;
  color:var(--muted);
  margin-top:8px;
}

.stat-icon {
  position:absolute;
  right:20px;
  top:22px;
  display:grid;
  place-items:center;
  border-radius:9px;
  width:32px;
  height:32px;
  background:#f4f7f8;
  color:var(--muted);
}

.stat.accent {
  border-bottom:2px solid var(--brand-border);
}

.stat.accent .stat-icon {
  background:var(--brand-soft);
  color:var(--brand);
}

.dashboard-grid {
  display:grid;
  grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr);
  gap:22px;
  align-items:start;
}

.dashboard-side {
  display:grid;
  gap:20px;
}

.quick-link {
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid #eff2f5;
}

.quick-link:last-child {
  border:0;
  padding-bottom:0;
}

.quick-icon {
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border:1px solid var(--line);
  border-radius:9px;
  color:var(--brand);
}

.quick-link strong {
  display:block;
  font-size:14px;
  font-weight:550;
}

.quick-link small {
  color:var(--muted);
  font-size:12px;
}

.quick-link>.icon {
  margin-left:auto;
  color:var(--muted);
  width:16px;
}

.quick-link:hover strong {
  color:var(--brand);
}

.deadline-item {
  display:flex;
  align-items:start;
  gap:12px;
  padding:14px 0;
  border-bottom:1px solid #eff2f5;
}

.deadline-item:last-child {
  border:0;
}

.deadline-item p {
  font-size:12px;
  margin:4px 0;
}

.deadline-item .link {
  font-size:12px;
  color:var(--brand);
}

.deadline-date {
  font-size:12px;
  color:var(--muted);
  margin:5px 0;
}

table {
  font-size:13px;
}

th {
  font-size:13px;
  font-weight:600;
  letter-spacing:.02em;
  color:var(--muted);
  background:#f9fafb;
  padding:13px 16px;
}

td {
  padding:16px;
  border-color:#edf1f4;
}

td b {
  font-weight:550;
}

td a:hover {
  color:var(--brand);
}

.table-scroll {
  overflow:auto;
  max-width:100%;
}

.table-scroll>table {
  min-width:520px;
}

.table-scroll:focus-visible {
  outline:2px solid var(--brand);
  outline-offset:2px;
}

.card:has(>.table-scroll) {
  overflow:hidden;
}

.table-card {
  padding:0;
}

.table-card .card-head {
  padding:21px 24px 0;
}

.small {
  font-size:12px;
}

.badge {
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:3px 9px;
  border-radius:5px;
  font-size:12px;
  font-weight:500;
  line-height:1.7;
}

.badge::before {
  content:'';
  width:4px;
  height:4px;
  border-radius:50%;
  background:currentColor;
}

.s-gray,.badge-missing {
  background:#f0f3f6;
  color:var(--muted);
}

.s-blue {
  background:#edf2fb;
  color:#4d709f;
}

.s-indigo {
  background:#f1eff8;
  color:#665383;
}

.filters {
  gap:7px;
  margin-bottom:20px;
}

.filters form {
  max-width:100%;
}

.filters input {
  width:260px;
  max-width:100%;
}

.filters select {
  width:auto;
  max-width:220px;
}

.filters form input {
  min-width:0 !important;
}

.chip {
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:7px 13px;
  border-radius:7px;
  font-size:13px;
}

.chip b {
  font-weight:600;
  opacity:1;
}

input[type=text],input[type=search],input[type=password],input[type=date],input[type=time],input[type=number],input[type=url],input[type=tel],input[type=datetime-local],select,textarea {
  padding:10px 12px;
  border-color:#c6d2dc;
  border-radius:7px;
  font-size:14px;
  min-width:0;
  line-height:1.5;
}

input::placeholder,textarea::placeholder {
  color:var(--muted);
}

textarea {
  resize:vertical;
  min-height:88px;
}

input:focus,select:focus,textarea:focus {
  outline:2px solid var(--brand);
  outline-offset:0;
  border-color:var(--brand);
  box-shadow:0 0 0 3px var(--brand-soft);
}

input[type=checkbox] {
  accent-color:var(--brand);
  width:16px;
  height:16px;
  flex:none;
}

input[type=file] {
  max-width:100%;
  font-size:13px;
}

input[type=file]::file-selector-button {
  border:1px solid var(--line);
  border-radius:5px;
  background:#f5f8f7;
  padding:7px 10px;
  color:var(--brand);
  margin-right:8px;
  cursor:pointer;
}

label {
  font-size:13px;
  color:#485a68;
  margin-bottom:6px;
}

.field {
  min-width:0;
  margin-bottom:16px;
}

.check-label {
  display:flex;
  gap:9px;
  align-items:flex-start;
  font-size:13px;
  font-weight:400;
}

.check-label input {
  margin-top:4px;
}

fieldset {
  min-width:0;
  border:1px solid var(--line);
  border-radius:9px;
  padding:16px 18px;
  margin:16px 0;
}

legend {
  font-size:13px;
  font-weight:600;
  padding:0 7px;
}

.btn,.btn-primary,button:not([class]) {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:40px;
  padding:8px 16px;
  border:1px solid transparent;
  border-radius:7px;
  background:var(--brand);
  color:#fff;
  font-size:14px;
  font-weight:550;
  white-space:nowrap;
  line-height:1.45;
  cursor:pointer;
  transition:background .15s,border-color .15s,color .15s;
}

button:not([class]) {
  border-color:#d8e1e7;
  background:#fff;
  color:var(--ink);
  font-weight:500;
}

.btn:hover,.btn-primary:hover {
  background:var(--brand-hover);
}

button:not([class]):hover {
  background:var(--brand-soft);
}

.btn:active:not(:disabled),button:active:not(:disabled) {
  transform:translateY(1px);
}

.btn-ghost {
  border-color:#d8e1e7;
  background:#fff;
  color:#384958;
  font-weight:500;
}

.btn-ghost:hover {
  background:var(--brand-soft);
  color:var(--ink);
}

.btn-sm {
  min-height:32px;
  padding:5px 12px;
  font-size:13px;
}

.btn-danger {
  background:var(--bad);
  border-color:var(--bad);
  color:#fff;
}

.btn-danger:hover {
  background:#96342f;
  border-color:#96342f;
}

.btn-danger-ghost {
  border-color:#e8c5c2;
  background:#fff;
  color:var(--bad);
  font-weight:500;
}

.btn-danger-ghost:hover {
  background:var(--bad-soft);
  border-color:var(--bad);
}

.btn:disabled,button:disabled {
  background:var(--bg);
  border-color:var(--line);
  color:var(--muted);
  cursor:not-allowed;
  transform:none;
}

.btn .icon {
  width:16px;
  height:16px;
}

.link {
  font-size:13px;
}

.link:hover {
  color:var(--brand);
}

.logout-button {
  font-size:13px;
}

.flash {
  padding:12px 16px;
  font-size:14px;
  margin-bottom:18px;
  border:1px solid var(--line);
  background:var(--bg);
  color:var(--ink);
}

.flash-ok {
  background:var(--ok-soft);
  color:var(--ok);
  border-color:#d8eadf;
}

.flash-bad {
  background:var(--bad-soft);
  color:var(--bad);
  border-color:#f2dcd9;
}

.flash-warn {
  background:var(--warn-soft);
  color:var(--warn);
  border-color:#f1e4cb;
}

.empty {
  font-size:14px;
}

.empty a {
  color:var(--brand);
  text-decoration:underline;
  text-underline-offset:3px;
}

.pager {
  margin:0;
  padding:16px;
  border-top:1px solid var(--line);
  font-size:12px;
}

.pager a {
  color:var(--brand);
}

.detail-head {
  margin-bottom:24px;
}

.detail-head>div {
  min-width:0;
}

.meta {
  font-size:12px;
  margin-top:10px;
  line-height:2;
}

.meta .badge {
  margin-right:5px;
}

.auth-page .wrap {
  max-width:none;
  padding:0;
}

.auth-page .topbar+.wrap {
  padding:28px;
  max-width:800px;
}

.login-wrap {
  min-height:100vh;
  display:grid;
  grid-template-columns:1fr 1fr;
  padding:0;
  background:#fff;
}

.login-story {
  align-self:stretch;
  justify-self:stretch;
  background:#173671;
  color:#fff;
  padding:56px 64px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  position:relative;
  overflow:hidden;
}

.login-story::after {
  content:'';
  position:absolute;
  width:430px;
  height:430px;
  border:1px solid #ffffff12;
  border-radius:50%;
  right:-240px;
  top:25%;
  box-shadow:0 0 0 70px #ffffff03,0 0 0 140px #ffffff02;
}

.login-brand {
  display:block;
  width:176px;
  max-width:100%;
  height:auto;
  padding:12px 16px;
  background:var(--card);
  border-radius:10px;
}

.login-story h2 {
  font:38px/1.6 Georgia,"Songti SC",serif;
  letter-spacing:.08em;
  font-weight:400;
  margin-bottom:20px;
}

.login-story p {
  color:#dbe7fb;
  font-size:13px;
  line-height:2;
  max-width:300px;
}

.login-story footer {
  font-size:12px;
  color:#dbe7fb;
  letter-spacing:.12em;
}

.login-main {
  display:grid;
  place-items:center;
  padding:40px;
  width:100%;
}

.login-card {
  max-width:340px;
}

.login-card h1 {
  font-size:26px;
  margin-bottom:9px;
}

.login-card .sub {
  font-size:12px;
  margin-bottom:30px;
}

.login-card .card {
  padding:0;
  border:0;
  box-shadow:none;
}

.login-card .btn {
  margin-top:8px;
  padding:12px;
}

.login-card .feishu-login {
  margin-bottom:20px;
  padding-bottom:20px;
  border-bottom:1px solid var(--line);
}

.login-card .feishu-login .btn {
  width:100%;
  margin-top:0;
}

.login-note {
  font-size:12px;
  color:var(--muted);
  margin-top:24px;
  text-align:center;
}

.nav-toggle,.nav-backdrop,.nav-close {
  display:none;
}

.icon-button {
  width:36px;
  height:36px;
  border:1px solid var(--line);
  border-radius:7px;
  background:white;
  color:var(--ink);
  align-items:center;
  justify-content:center;
  margin:0;
}

.upload-error {
  color:var(--bad);
  font-size:12px;
  margin-top:8px;
}

.upload-error:empty {
  display:none;
}

@media(max-width:1200px) {
  .sidebar {
    width:208px;
    padding-inline:12px;
  }
  .has-sidebar .workspace {
    margin-left:208px;
  }
  .wrap {
    padding:28px 24px;
  }
  .topbar {
    padding-inline:24px;
  }
  .dashboard-grid {
    grid-template-columns:minmax(0,1.4fr) minmax(260px,1fr);
    gap:18px;
  }
  .card {
    padding:18px;
  }
  .table-card {
    padding:0;
  }
  .stat-icon {
    right:16px;
    top:18px;
  }
  .filters form {
    flex-basis:100%;
    margin-left:0 !important;
    margin-top:6px;
  }
}

@media(max-width:1000px) {
  .dashboard-stats-wide {
    display:none;
  }
  .dashboard-stats-narrow {
    display:grid;
    margin-top:16px;
  }
  .dashboard-grid {
    grid-template-columns:1fr;
  }
  .dashboard-side {
    grid-template-columns:1fr 1fr;
  }
  .g4 {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .grid[style*="1fr 340px"],.grid[style*="2fr 1fr"] {
    grid-template-columns:1fr !important;
  }
}

@media(max-width:900px) {
  .has-sidebar .workspace {
    margin-left:0;
  }
  .sidebar {
    transform:translateX(-100%);
    width:240px;
    transition:transform .2s;
  }
  .sidebar .nav {
    display:flex;
    width:auto;
    order:0;
    padding:0;
  }
  .nav a {
    min-height:44px;
  }
  .nav-toggle,.nav-close {
    display:inline-flex;
    width:44px;
    height:44px;
  }
  .logout-button {
    min-width:44px;
    min-height:44px;
    font-size:12px;
  }
  .nav-close {
    position:absolute;
    top:12px;
    right:8px;
    font-size:20px;
  }
  .sidebar .brand { padding-right:36px; }
  .btn,button:not([class]),.chip {
    min-height:44px;
    max-width:100%;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .topbar {
    height:64px;
    min-height:64px;
    gap:12px;
  }
  .breadcrumb {
    margin-right:auto;
  }
  .nav-open .sidebar {
    transform:translateX(0);
  }
  .nav-open .nav-backdrop {
    display:block;
    position:fixed;
    inset:0;
    z-index:25;
    background:#162e3c55;
    border:0;
    padding:0;
  }
  .nav-open {
    overflow:hidden;
  }
  .g3,.grid[style*="repeat(3"] {
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .workspace-footer {
    padding-inline:24px;
  }
}

@media(max-width:620px) {
  .wrap {
    padding:22px 16px;
  }
  .topbar {
    padding:0 16px;
  }
  .breadcrumb {
    display:none;
  }
  .topbar .parent-nav { display: flex; flex: 1; }
  .parent-nav .parent-link .icon { display: block; width: 16px; height: 16px; }
  .parent-prefix { display: inline; }
  .parent-nav .parent-current { display: none; }
  .topbar:has(.parent-nav) .user-link > span:last-child { display: none; }
  .topbar:has(.parent-nav) .user-link { min-height: 44px; min-width: 44px; justify-content: center; }

  .who {
    margin-left:auto;
    gap:14px;
  }
  .user-link small {
    display:none;
  }
  .page-head {
    gap:10px;
    margin-bottom:20px;
  }
  .page-head h1 {
    font-size:22px;
  }
  .page-head .btn {
    padding:8px 10px;
  }
  .card {
    padding:17px;
  }
  .table-card {
    padding:0;
  }
  .stat {
    padding:16px;
  }
  .stat .value {
    font-size:28px;
  }
  .stat-icon {
    width:28px;
    height:28px;
    right:12px;
    top:16px;
  }
  .stat .label {
    font-size:12px;
  }
  .g4 {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
  }
  .g3,.g2,.row2,.grid[style*="repeat(2"],.grid[style*="repeat(3"],.grid[style*="repeat(4"],.grid[style*="1fr 1fr"] {
    grid-template-columns:1fr !important;
  }
  .dashboard-side {
    grid-template-columns:1fr;
  }
  .dashboard-stats {
    margin-bottom:18px;
  }
  .filters {
    gap:6px;
  }
  .filters form {
    min-width:0 !important;
    flex-wrap:wrap;
  }
  .filters input {
    width:100%;
    flex:1 1 100%;
  }
  .filters select {
    flex:1;
    max-width:none;
  }
  .detail-head>div:last-child {
    gap:8px !important;
  }
  .detail-head .btn {
    padding:8px 10px;
  }
  .login-wrap {
    grid-template-columns:1fr;
    grid-template-rows:auto 1fr;
  }
  .login-story {
    align-items:center;
    padding:20px 24px;
  }
  .login-story h2,.login-story p,.login-story footer {
    display:none;
  }
  .login-main {
    align-self:start;
    padding:32px 24px 40px;
  }
  .login-card h1 {
    font-size:23px;
  }
  .workspace-footer {
    padding:16px;
  }
  .workspace-footer span:last-child {
    display:none;
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    scroll-behavior:auto !important;
    transition:none !important;
  }
}

@media print {
  .sidebar,.topbar,.workspace-footer,.nav-backdrop,.skip-link {
    display:none !important;
  }
  .has-sidebar .workspace {
    margin:0;
  }
  .wrap {
    padding:0;
    max-width:none;
  }
  .card {
    box-shadow:none;
    break-inside:avoid;
  }
  .table-scroll {
    overflow:visible;
  }
  .table-scroll>table {
    min-width:0;
  }
}

.detail-grid {
  display:grid;
  grid-template-columns:minmax(0,1.4fr) minmax(320px,1fr);
  gap:22px;
  align-items:start;
}

.detail-grid>div {
  min-width:0;
}

@media(max-width:1000px) {
  .detail-grid {
    grid-template-columns:1fr;
  }
}

.grid > *, .detail-grid > * {
  min-width:0;
}

.card-head {
  align-items:flex-start;
}

.card-head>a {
  padding-top:1px;
}

.deadline-item .link {
  padding:5px 9px;
  margin-top:7px;
  border:1px solid var(--line);
  border-radius:5px;
  background:#fff;
}

@media(max-width:620px) {
  .dashboard-grid .table-scroll>table {
    min-width:0;
    table-layout:fixed;
  }
  .dashboard-grid .table-scroll th:first-child {
    width:calc(100% - 82px);
  }
  .dashboard-grid .table-scroll td:nth-child(2),.dashboard-grid .table-scroll th:nth-child(2) {
    width:82px;
    padding-left:8px;
    padding-right:12px;
  }
  .dashboard-grid .table-scroll td:nth-child(3),.dashboard-grid .table-scroll th:nth-child(3) {
    display:none;
  }
  .dashboard-grid .table-scroll td:first-child {
    overflow-wrap:anywhere;
    padding:14px 16px;
  }
  .table-scroll[data-overflow]::before {
    content:'左右滑动查看完整表格';
    display:block;
    position:sticky;
    left:0;
    padding:6px 14px;
    font-size:12px;
    color:var(--muted);
    background:#f9fafb;
  }
}


/* 案件工作区、期限、核查与卷宗 */
.section-gap { margin-bottom: 16px; }
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.action-row form { margin: 0; }

.feishu-binding {
  display:flex;
  gap:8px 16px;
  align-items:flex-end;
  flex-wrap:wrap;
}
.account-list { list-style:none; padding:0; margin:0; }
.account-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(9em,0.7fr) minmax(11em,0.8fr);
  align-items:start;
  gap:8px 16px;
  padding:14px 0;
}
.account-row + .account-row { border-top:1px solid var(--line); }
.account-identity { min-width:0; overflow-wrap:anywhere; }
.account-identity code { display:block; color:var(--muted); font-size:13px; }
.account-status { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.account-actions summary { width:fit-content; cursor:pointer; color:var(--brand); }
.account-actions form { display:grid; gap:6px; margin:8px 0 0; justify-items:start; }
.account-actions label { margin:0; }
@media (max-width:680px) {
  .account-row { grid-template-columns:minmax(0,1fr) minmax(0,0.9fr); }
  .account-actions { grid-column:1 / -1; }
  .account-actions summary { padding:10px 4px; min-height:44px; }
}
.feishu-binding .field {
  flex:1 1 240px;
  min-width:0;
  max-width:420px;
  margin:0;
}
.filters { align-items: flex-end; }
.filters .field { margin-bottom: 0; }
.filters select { max-width: 200px; }
.filters .check-label { align-self: center; margin: 0 6px; }
.detail-nav a {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand);
}
.detail-nav a:hover { background: var(--brand-soft); }
.key-value {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 6px 16px;
  margin: 0 0 10px;
  font-size: 13px;
}
.key-value dt { color: var(--muted); }
.key-value dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.key-value time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.clean-list, .deadline-list { list-style: none; margin: 0; padding: 0; }
.clean-list > li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.clean-list > li:last-child { border: 0; }
.clean-list a, .deadline-context a, .card p a, .flash a { color: var(--brand); text-decoration: underline; }
.readable-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.pending-label { color: var(--warn); }
.file-link { overflow-wrap: anywhere; }
.inline-detail-form { padding-top: 14px; }
details > summary { cursor: pointer; overflow-wrap: anywhere; }
details > summary.btn { display: inline-flex; }
.conflict-lines { margin-bottom: 14px; }
.conflict-lines > li { display: grid; gap: 4px; }
.proceeding-row {
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.proceeding-row:last-child { margin-bottom: 0; }
.proceeding-row.current { border-color: #a3c6bf; background: #f9fcfb; }
.proceeding-row .card-head { margin-bottom: 8px; }
.proceeding-row .key-value { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); }
.proceeding-row .action-row.section-gap { margin: 10px 0 0; }
.note-summary {
  display: list-item;
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brand);
}
.proceeding-row details > summary { color: var(--brand); }
.party-line { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.transition-item { align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.transition-item:last-child { border: 0; }
.checkbox-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 18px; }
.kind-pick { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.kind-pick label {
  flex: 1 1 100px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.kind-pick label:has(input:checked) { border-color: #a3c6bf; background: var(--brand-soft); }
.kind-pick input { margin: 0; width: auto; }
.field > input:not([type]) {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8e1e7;
  border-radius: 7px;
  font-size: 13px;
  color: inherit;
}
.field > input:not([type]):focus { outline: 2px solid var(--brand); }
.span-two { grid-column: span 2; }
.elements-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.elements-fields:disabled { color: var(--ink); }
.required-mark { color: var(--bad); }
.form-foot { position: sticky; bottom: 0; z-index: 5; }
.archive-grid { grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); }
.archive-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.archive-download h2, .archive-download p { margin: 0; }
.archive-download p { margin-top: 4px; }
.archive-download .btn { min-height: 44px; }
.litigation-evidence, .litigation-sample { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.litigation-turn, .litigation-elements, .litigation-sample { border-top: 1px solid var(--line); padding-top: 8px; }
.litigation-latest, .litigation-comparison > div { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.litigation-latest { margin-bottom: 12px; }
.litigation-latest > .litigation-turn { border-top: 0; padding-top: 0; }
.litigation-comparison { margin-bottom: 10px; }
.litigation-comparison p { margin: 4px 0 0; }
.litigation-elements { margin-bottom: 10px; }
.litigation-elements summary { cursor: pointer; color: var(--brand); padding: 8px 0; }
.litigation-elements[open] .grid { margin-top: 8px; }
.litigation-sample-fields { display: none; margin-top: 8px; }
.litigation-sample:has(input[name=sample]:checked) .litigation-sample-fields { display: block; }
#litigation-review button { min-height: 44px; white-space: normal; }
.evidence-row { min-width: 0; margin: 0 0 12px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); }
.evidence-row .check-label { min-width: 0; }
.evidence-fields { margin-top: 10px; }
.evidence-fields .grid { row-gap: 2px; }
#evidence-directory-form button { min-height: 44px; white-space: normal; }
.deadline-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.deadline-card:first-child { border-top: 0; }
.deadline-when { display: grid; justify-items: start; align-content: start; gap: 4px; }
.deadline-when time { font-variant-numeric: tabular-nums; }
.deadline-context { min-width: 0; overflow-wrap: anywhere; }
.deadline-context > a { margin-left: 4px; }
.deadline-actions { justify-content: flex-end; }
.deadline-actions .btn { min-height: 36px; }
.home-urgent { border-color:var(--brand-border); }
.home-urgent .card-head h2 { font-size:16px; }
.home-urgent .card-head a:not(.btn) { color:var(--brand); }
.home-urgent .empty { padding: 16px 0; }

.cases-filters-narrow,.cases-list { display:none; }
.cases-results { padding:6px 0; }
.cases-table { min-width:0; }
.case-title-link,.object-link,.cases-table td:first-child a,.cases-list-heading a {
  color:var(--brand);
  text-decoration:underline;
  text-underline-offset:3px;
  font-weight:600;
}
.case-title-link:hover,.object-link:hover,.cases-table td:first-child a:hover,.cases-list-heading a:hover {
  color:var(--brand-hover);
}
.cases-results .cases-edit-name { margin-top:8px; min-height:32px; font-size:13px; white-space:nowrap; }

dialog,.app-dialog {
  width:min(440px,calc(100% - 24px));
  padding:24px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--card);
  color:var(--ink);
  box-shadow:0 16px 40px rgb(20 35 52 / 18%);
}
dialog::backdrop,.app-dialog::backdrop {
  background:rgb(28 43 56 / 42%);
}
.app-dialog h2 {
  margin:0 0 8px;
  font-size:18px;
  line-height:1.4;
}
.app-dialog p {
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.6;
}
.app-dialog .action-row {
  margin-top:20px;
  justify-content:flex-end;
}

.grid-4 {
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px 16px;
}
.detail-nav {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:16px;
}
.detail-nav a {
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:6px 12px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--card);
  color:var(--ink);
  font-size:13px;
  font-weight:500;
}
.detail-nav a:hover {
  border-color:var(--brand);
  color:var(--brand);
  background:var(--brand-soft);
}
.sticky-batch-bar {
  position:sticky;
  top:8px;
  z-index:12;
  padding:10px 14px;
  border:1px solid var(--brand-border);
  border-radius:8px;
  background:var(--card);
  box-shadow:0 4px 14px rgb(20 35 52 / 8%);
}
.upload-error:not(:empty) {
  margin:8px 0 12px;
  padding:10px 12px;
  border:1px solid #f2dcd9;
  border-radius:7px;
  background:var(--bad-soft);
  color:var(--bad);
  font-size:13px;
}
.pager a {
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:4px 10px;
  border-radius:6px;
}
.pager a:hover {
  background:var(--brand-soft);
}

@media (max-width:900px) {
  .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (pointer:coarse),(max-width:768px) {
  input[type=text],input[type=search],input[type=password],input[type=date],input[type=time],input[type=number],input[type=url],input[type=tel],input[type=datetime-local],select,textarea {
    font-size:16px;
  }
  .pager a,.detail-nav a {
    min-height:44px;
  }
}

@media (max-width:620px) {
  .grid-4 { grid-template-columns:minmax(0,1fr); }
  .btn,.btn-primary,button:not([class]) { min-height:44px; }
  .filters { gap:8px; }
  .cases-filters-wide,.cases-table { display:none; }
  .cases-head .btn,.cases-search .btn,.cases-search input,.cases-more .btn { min-height:44px; }
  .cases-results .cases-edit-name { min-height:44px; }
  .cases-head,.cases-stages { margin-bottom:12px; }
  .cases-stages { gap:8px; }
  .cases-stages .chip { min-height:44px; }
  .cases-filters-narrow { display:block; margin-bottom:14px; }
  .cases-search {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:end;
    gap:8px;
  }
  .cases-search .field { margin:0; color:var(--ink); }
  .cases-search input,.cases-filter-fields select { width:100%; }
  .cases-more { margin-top:8px; }
  .cases-more > summary { color:var(--brand); }
  .cases-more summary .icon { transform:rotate(90deg); }
  .cases-more[open] summary .icon { transform:rotate(-90deg); }
  .cases-filter-fields {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:end;
    gap:10px;
    margin-top:8px;
    padding:12px;
  }
  .cases-filter-fields select { display:block; }
  .cases-filter-fields .field,.cases-filter-fields .check-label { margin:0; }
  .cases-filter-fields .check-label { align-items:center; min-height:44px; }
  .cases-filter-fields .check-label input { margin:0; }
  .cases-filter-fields .btn { grid-column:1 / -1; justify-self:start; }
  .cases-results { padding:0; }
  .cases-list { display:block; list-style:none; margin:0; padding:0; }
  .cases-list li { padding:13px 15px; }
  .cases-list li + li { border-top:1px solid var(--line); }
  .cases-list-heading {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    margin-bottom:5px;
  }
  .cases-list-heading a {
    display:inline-flex;
    align-items:center;
    min-height:44px;
    min-width:0;
    font-size:15px;
    font-weight:650;
    line-height:1.45;
    overflow-wrap:anywhere;
  }
  .cases-list-heading .badge { flex:none; }
  .cases-list-progress { margin:6px 0 0; font-size:13px; overflow-wrap:anywhere; }
  .cases-list-progress .case-next { color:var(--ink); font-weight:600; }
  .cases-list-meta { color:var(--muted); font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
}

@media (max-width: 1020px) {
  .archive-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .wrap details > summary { min-height:44px; padding-block:10px; }
  .deadline-card { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .deadline-when { display: flex; align-items: center; gap: 8px; }
  .deadline-actions { justify-content: flex-start; }
  .deadline-actions .btn { min-height: 44px; }
  .proceeding-row .key-value { grid-template-columns: max-content minmax(0, 1fr); }
  .span-two { grid-column: auto; }
}
