/* [2026-02-23] 修改：移除外部 Google Fonts 依赖并改用本地字体栈 */
/* 原因：国内网络访问 fonts.googleapis.com 往往超时，导致首屏渲染明显变慢 */
/* 影响：登录/首页/案件页首屏更稳定，字体回退为系统字体，不影响功能逻辑 */
/* 未改动：页面色彩、布局、按钮与交互行为保持不变 */

:root {
  color-scheme: light;
  --font-display: 'PingFang SC', 'HarmonyOS Sans SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'PingFang SC', 'HarmonyOS Sans SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --bg: #f4f7fb;
  --bg-soft: #eef2f7;
  --surface: #ffffff;
  --surface-strong: #f8fafc;
  --border: #e2e8f0;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --primary: #1d4ed8;
  --primary-strong: #1e40af;
  --primary-soft: rgba(29, 78, 216, 0.12);
  --accent: #0ea5a0;
  --accent-soft: rgba(14, 165, 160, 0.14);
  --warning: #f59e0b;
  --success: #16a34a;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-soft: #121a2b;
  --surface: #121a2b;
  --surface-strong: #172137;
  --border: #233050;
  --shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
  --shadow-soft: 0 10px 24px rgba(2, 6, 23, 0.35);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-soft: #cbd5f5;
  --primary: #60a5fa;
  --primary-strong: #3b82f6;
  --primary-soft: rgba(96, 165, 250, 0.18);
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.2);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* [2026-02-23] 修改：增加全局横向溢出保护 */
/* 原因：部分移动端浏览器在窄屏下会出现横向拖动，影响阅读和操作 */
/* 影响：企业主题页面在手机端默认禁止横向滚动，提升触屏体验 */
/* 未改动：纵向滚动与现有组件尺寸逻辑不变 */
html,
body {
  width: 100%;
  overflow-x: hidden;
}

.app-shell {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(29, 78, 216, 0.12), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(14, 165, 160, 0.12), transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(99, 102, 241, 0.08), transparent 55%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 36px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.78));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

[data-theme='dark'] .topbar {
  background: linear-gradient(135deg, rgba(11,18,32,0.92), rgba(11,18,32,0.78));
}

/* [2026-02-23] 修改：品牌区支持可点击跳转首页 */
/* 原因：桌面端主页/案件页品牌容器从 div 改成 a 后需保持原有视觉 */
/* 影响：Logo+系统名可点击返回首页，样式与旧版一致 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

/* [2026-02-23] 修改：强化品牌链接与导航文本一致性 */
/* 原因：部分页面出现标题链接下划线和字体不统一问题 */
/* 影响：品牌标题与底部导航文案在各页面保持统一字体与无下划线 */
/* 未改动：品牌跳转行为与导航链接地址不变 */
.brand,
.brand:link,
.brand:visited,
.brand:hover,
.brand:active {
  text-decoration: none !important;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.brand-sub {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text-soft);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(29, 78, 216, 0.2);
}

.btn-primary:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px;
}

.auth-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 36px 48px;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 36px;
  align-items: stretch;
}

.hero {
  background: linear-gradient(140deg, rgba(29, 78, 216, 0.08), rgba(14, 165, 160, 0.1));
  border-radius: var(--radius-xl);
  padding: 36px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 78, 216, 0.25), transparent 70%);
  top: -80px;
  right: -60px;
}

.hero::after {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(14, 165, 160, 0.22), transparent 70%);
  bottom: -120px;
  left: -80px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-soft);
}

.feature-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.feature-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-muted);
}

.feature-list span {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 16px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metric {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.metric strong {
  display: block;
  font-size: 20px;
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.metric span {
  font-size: 12px;
  color: var(--text-soft);
}

.cloud-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cloud-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
}

.login-card h2 {
  font-family: var(--font-display);
  font-size: 24px;
}

.login-card p {
  color: var(--text-soft);
  font-size: 14px;
}

.form-group {
  display: grid;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.hint {
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
}

.security-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: 24px;
  margin-bottom: 32px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  margin-bottom: 10px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.hero-panel h3 {
  font-size: 16px;
  font-family: var(--font-display);
  margin-bottom: 12px;
}

.stat-grid {
  display: grid;
  gap: 12px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.stat-item strong {
  font-family: var(--font-display);
  font-size: 18px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
}

.search-box span {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.quick-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
}

.quick-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.quick-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 8px;
}

.quick-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* [2026-03-23] 修改：首页/案件卡片补充链接语义样式与键盘焦点态 */
/* 原因：卡片改为 a 标签后需要保持原视觉，并提供清晰 focus 可见性 */
/* 影响：键盘用户可感知当前焦点位置，卡片链接风格与原版保持一致 */
/* 未改动：卡片布局、配色与悬停动画逻辑保持不变 */
.quick-card-link,
.case-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.quick-card-link:visited,
.case-card-link:visited,
.quick-card-link:hover,
.case-card-link:hover,
.quick-card-link:active,
.case-card-link:active {
  color: inherit;
  text-decoration: none;
}

.quick-card-link:focus-visible,
.case-card-link:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow), 0 0 0 3px var(--primary-soft);
}

.case-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
  animation: cardIn 0.6s ease both;
  animation-delay: var(--delay, 0s);
}

.case-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.case-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.case-title {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 6px;
}

.case-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.case-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-soft);
}

.case-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--text-soft);
}

.status-draft { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.status-processing { background: rgba(29, 78, 216, 0.12); color: var(--primary); }
.status-completed { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.status-archived { background: rgba(148, 163, 184, 0.2); color: #64748b; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: min(520px, 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 18px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px dashed var(--border);
  color: var(--text-soft);
}

/* [2026-02-23] 修改：企业主题页补齐统一移动端底部导航 */
/* 原因：home/cases 页面此前缺少底部菜单样式，造成跨页时“菜单消失” */
/* 影响：移动端具备稳定的全局底部导航与暗黑模式一致性 */
/* 未改动：桌面端顶部导航和卡片布局不受影响 */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    justify-content: space-around;
    align-items: center;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0 0 env(safe-area-inset-bottom);
    height: calc(58px + env(safe-area-inset-bottom));
    z-index: 9999;
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
  }

  .mobile-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-soft);
    font-size: 11px;
    min-height: 58px;
    height: 58px;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 500;
  }

  .mobile-bottom-nav .nav-icon {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-bottom-nav .nav-label {
    text-decoration: none;
    font-family: var(--font-body);
    line-height: 1.2;
  }

  .mobile-bottom-nav .nav-item.active {
    color: var(--primary);
  }

  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

html.is-mobile .mobile-bottom-nav,
body.device-mobile .mobile-bottom-nav,
body.device-tablet .mobile-bottom-nav {
  display: flex !important;
  z-index: 9999 !important;
}

html.is-mobile body,
body.device-mobile,
body.device-tablet {
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

[data-theme='dark'] .mobile-bottom-nav {
  background: var(--surface);
  border-top-color: var(--border);
}

/* [2026-02-23] 修改：桌面设备强制隐藏底部移动导航 */
/* 原因：桌面端在窄窗口下仍可能触发移动媒体查询，出现底部四宫格菜单 */
/* 影响：标记为 device-desktop 的终端不再显示底部移动导航 */
/* 未改动：移动/平板设备的底部导航显示逻辑保持不变 */
body.device-desktop .mobile-bottom-nav {
  display: none !important;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .auth-grid,
  .page-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 12px 16px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .topbar-actions {
    display: none !important;
  }

  .brand-sub {
    display: none;
  }

  .page-shell,
  .auth-shell {
    padding: 20px;
  }

  .hero {
    padding: 28px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 24px;
  }

  .page-hero {
    gap: 18px;
  }

  .search-box input {
    padding-left: 38px;
  }
}

@media (max-width: 520px) {
  .brand-text { font-size: 16px; }
  .brand-mark { width: 38px; height: 38px; }
  .btn { width: 100%; }
  .topbar-actions { width: 100%; justify-content: space-between; }
}
