:root {
  /* 主题色：蓝绿双色搭配（参考 Quinn Emanuel） */
  --primary: #48A8C0;        /* 品牌蓝 */
  --primary-dark: #3a92a8;   /* 蓝（深一档） */
  --primary-deep: #2e7d92;   /* 蓝（更深） */
  --primary-light: #e8f4f8;  /* 蓝（浅底） */
  --navy: #002b33;           /* 深海军蓝 */
  --navy-2: #0c4450;         /* 深海军蓝（浅一档） */
  --navy-3: #14656b;         /* 深海军蓝（更浅一档） */
  --accent: #C0CF13;         /* 品牌绿（点缀色） */
  --accent-dark: #a0ac10;
  --accent-light: #f6f8df;
  --success: #16a34a;
  --success-light: #ecfdf3;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --bg: #f4f6fb;
  --card: #ffffff;
  --border: #e7ebf2;
  --text-1: #17233d;
  --text-2: #5b6472;
  --text-3: #98a2b3;
  --shadow-sm: 0 1px 2px rgba(23, 35, 61, .05), 0 1px 3px rgba(23, 35, 61, .05);
  --shadow: 0 1px 3px rgba(23, 35, 61, .06), 0 4px 12px rgba(23, 35, 61, .06);
  --shadow-lg: 0 12px 32px rgba(23, 35, 61, .14), 0 4px 12px rgba(23, 35, 61, .08);
  --radius: 12px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: linear-gradient(180deg, #f7f9fd 0%, #eef2f8 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button { font-family: inherit; cursor: pointer; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9d2e0; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #aeb9cc; }
::-webkit-scrollbar-track { background: transparent; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(72, 168, 192, .22); }
.btn-primary {
  background: linear-gradient(135deg, #58b7ce, var(--primary-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(46, 125, 146, .28);
}
.btn-primary:hover { background: linear-gradient(135deg, #63c0d6, var(--primary-deep)); color: #fff; }
.btn-danger { color: var(--danger); border-color: #fecaca; background: #fff; }
.btn-danger:hover { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.btn-success { background: linear-gradient(135deg, #22b455, #15803d); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(22, 163, 74, .25); }
.btn-success:hover { color: #fff; filter: brightness(1.05); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* 表单 */
.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d8dee9;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-1);
  background: #fbfcfe;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(72, 168, 192, .14);
}
.input:hover:not(:focus), .select:hover:not(:focus) { border-color: #bcc6d6; }
.textarea { resize: vertical; min-height: 70px; }
.input.invalid, .select.invalid { border-color: var(--danger); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.field .required::after { content: " *"; color: var(--danger); }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.field.invalid .field-error { display: block; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1d6a80 0%, #3795ad 52%, #5d8416 100%);
  border-right: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  padding: 20px 18px 16px;
  font-size: 24px;
  font-weight: 800;
  color: #C0CF13;
  letter-spacing: 3px;
  line-height: 1;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.nav { padding: 14px 12px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 3px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all .15s ease;
}
.nav-item:hover { background: rgba(192, 207, 19, .28); color: #fff; }
.nav-item.active { background: #fff; color: var(--primary-deep); font-weight: 600; box-shadow: inset 4px 0 0 var(--accent); }
.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  border-radius: 10px;
  padding: 1px 7px;
  font-weight: 600;
}
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .16); font-size: 12px; color: rgba(255, 255, 255, .72); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 650; letter-spacing: .2px; }
.topbar h1::before { content: ""; display: inline-block; width: 4px; height: 18px; border-radius: 4px; background: linear-gradient(180deg, var(--primary) 0 55%, var(--accent) 55% 100%); margin-right: 10px; vertical-align: -3px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.icon-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.icon-btn .dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8f4f8, #d7ebf2);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #c4dfe9;
}
.user-chip .name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.user-chip .role { font-size: 12px; color: var(--text-3); }

.content { padding: 26px; max-width: 1240px; width: 100%; margin: 0 auto; animation: pageIn .22s ease; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, #fdfdfe, #fafbfd);
}
.card-head h2 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-head h2::before { content: ""; width: 3px; height: 15px; border-radius: 3px; background: var(--primary); }
.card-head .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 20px; }

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 15px; text-align: left; font-size: 14px; }
th {
  color: var(--text-2);
  font-weight: 600;
  background: #f8fafd;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { border-bottom: 1px solid #f0f3f8; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #f7f9ff; }
.row-click { cursor: pointer; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge-blue { background: #e8f4f8; color: #2e7d92; }
.badge-green { background: #e8f8ee; color: #15803d; }
.badge-orange { background: #fff3e0; color: #b45309; }
.badge-red { background: #feecec; color: #dc2626; }
.badge-gray { background: #eef1f6; color: #5b6472; }

/* 统计卡 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: all .18s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72, 168, 192, .08), transparent 70%);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.stat-icon.green { background: var(--accent-light); color: var(--accent-dark); }
.stat-card .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat-card .value { font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.stat-card .value small { font-size: 13px; color: var(--text-3); font-weight: 400; }
.stat-card .trend { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* 登录页 */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 22%, rgba(192, 207, 19, .20), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(72, 168, 192, .34), transparent 44%),
    linear-gradient(135deg, #2e7d92 0%, #48A8C0 52%, #a9dae5 100%);
  padding: 24px;
  position: relative;
}
.auth-card {
  width: 430px;
  background: rgba(255, 255, 255, .97);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(10, 20, 60, .35);
  padding: 38px 40px 30px;
  backdrop-filter: blur(8px);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.auth-card .auth-logo {
  color: #C0CF13;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 3px;
  line-height: 1;
}
.auth-card h1 { font-size: 22px; font-weight: 700; letter-spacing: .3px; margin: 0; }
.auth-card .auth-sub { font-size: 13px; color: var(--text-3); margin: 6px 0 22px; }
.tabs { display: flex; gap: 8px; margin-bottom: 22px; background: #eef1f7; padding: 4px; border-radius: 12px; }
.tab {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  text-align: center;
  transition: all .18s;
}
.tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }
.auth-demo {
  margin-top: 20px;
  padding: 13px 15px;
  background: #f6f8fc;
  border: 1px dashed #d5dce9;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.9;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .48);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  z-index: 100;
  overflow-y: auto;
  animation: fadeIn .16s ease;
}
.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 580px;
  max-width: 100%;
  animation: modalIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; font-weight: 650; }
.modal-close { border: none; background: none; font-size: 22px; color: var(--text-3); line-height: 1; padding: 2px; border-radius: 6px; }
.modal-close:hover { color: var(--text-1); background: #f2f4f8; }
.modal-body { padding: 22px; }
.modal-foot { padding: 15px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* 提示 */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: #fff;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 14px;
  min-width: 220px;
  max-width: 380px;
  animation: slideIn .2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn {
  from { transform: translateX(-50%) translateY(-8px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* 计时器 */
.timer-card {
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 255, 255, .16), transparent 34%),
    linear-gradient(135deg, #2e7d92, #48A8C0);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 18px;
  box-shadow: 0 10px 28px rgba(46, 125, 146, .32);
  position: relative;
  overflow: hidden;
}
.timer-card::after {
  content: "";
  position: absolute;
  left: -40px;
  bottom: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 22px solid rgba(255, 255, 255, .07);
}
.timer-display { font-size: 46px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; text-shadow: 0 2px 10px rgba(0, 0, 30, .15); }
.timer-controls { display: flex; gap: 10px; margin-top: 14px; }
.timer-controls .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .32); color: #fff; box-shadow: none; }
.timer-controls .btn:hover { background: rgba(255, 255, 255, .28); transform: translateY(-1px); }
.timer-controls .btn-stop { background: #fff; border-color: #fff; color: var(--primary); font-weight: 600; }
.timer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; position: relative; z-index: 1; }
.timer-fields label { font-size: 12px; opacity: .85; display: block; margin-bottom: 4px; }
.timer-fields .select, .timer-fields .input { background: rgba(255, 255, 255, .95); border-color: transparent; color: var(--text-1); }

/* 案件搜索选择 */
.combo-wrap { position: relative; }
.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: none;
}
.combo-list.show { display: block; }
.combo-item { padding: 9px 12px; font-size: 13px; cursor: pointer; color: #000; }
.combo-item:hover, .combo-item.active { background: var(--primary-light); color: #000; }
.combo-item .c-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* 日历 */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-weekday {
  text-align: center;
  font-size: 12px;
  color: var(--text-2);
  padding: 6px 0;
  background: #f8fafd;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 500;
}
.cal-weekday.weekend { color: var(--text-1); background: var(--gray-2, #e9edf4); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  height: 104px;
  background: var(--white, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 8px;
  font-size: 12px;
  overflow-y: auto;
  transition: border-color .15s, box-shadow .15s;
}
.cal-cell:hover { border-color: #b9c7ee; }
.cal-cell .day-num { font-weight: 600; color: var(--text-2); }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: #fbfcff; }
.cal-cell.cur-month { background: #f6f8fc; }
.cal-cell.cur-month.weekend { background: #e9edf4; }
.cal-cell.other-month .day-num { color: var(--text-3); }
.cal-event { display: block; margin-top: 4px; padding: 0; font-size: 11px; cursor: pointer; overflow-wrap: anywhere; word-break: break-all; line-height: 1.35; background: transparent; }
.cal-event.hearing { color: var(--primary); }
.cal-event.deadline { color: var(--danger); }
.cal-event.urgent { color: #b91c1c; font-weight: 700; }
.cal-week-view .cal-row { display: grid; grid-template-columns: 150px 1fr; gap: 8px; margin-bottom: 8px; }

/* 详情信息表 */
.info-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-item .k { font-size: 12px; color: var(--text-3); margin-bottom: 3px; }
.info-item .v { font-size: 14px; color: var(--text-1); word-break: break-all; }

.section-title { font-size: 15px; font-weight: 650; margin: 24px 0 12px; display: flex; align-items: center; justify-content: space-between; }
.jump-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.jump-chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.jump-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); transform: translateY(-1px); }
.sec-anchor { scroll-margin-top: 78px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { width: 260px; position: relative; }
.empty { text-align: center; padding: 44px 20px; color: var(--text-3); font-size: 13px; }
.empty .big { font-size: 38px; display: block; margin-bottom: 10px; opacity: .8; }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
}
.list-item:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 14px; }
.list-item .li-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }

.amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.amount.green { color: var(--success); }
.amount.red { color: var(--danger); }

.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--text-3); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.text-sm { font-size: 13px; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .info-table { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
