/* ============================================================
   诉状生成助手 - 公共样式表
   设计语言：现代极简 SaaS · 蓝/白 · 超大圆角 · 柔和阴影
   对齐参考：E:\phpstudy\WWW\deepseek 风格
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 品牌主色：蓝 */
  --color-primary: #2563eb;
  --color-primary-light: #3b82f6;
  --color-primary-dark: #1d4ed8;
  --color-primary-tint: #eff6ff;
  --color-primary-tint2: #eef2ff;
  --color-primary-ring: rgba(37, 99, 235, 0.15);

  /* 中性色 */
  --color-bg: #ffffff;
  --color-bg-soft: #f8fafc;
  --color-bg-card: #ffffff;
  --color-bg-paper: #f8fafc;
  --color-bg-doc: #ffffff;
  --color-bg-track: #f1f5f9;

  /* 文字 */
  --color-text: #0f172a;
  --color-text-light: #475569;
  --color-text-muted: #64748b;
  --color-text-placeholder: #94a3b8;

  /* 边框 */
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-border-medium: #cbd5e1;

  /* 状态色 */
  --color-success: #166534;
  --color-success-bg: #dcfce7;
  --color-warning: #b97709;
  --color-danger: #dc2626;
  --color-info: #2563eb;

  /* 字体 */
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Source Han Sans SC', 'Noto Sans SC', sans-serif;
  --font-doc: 'Inter', 'PingFang SC', 'Microsoft YaHei', '仿宋', 'FangSong', serif;

  /* 圆角体系：超大圆角风格 */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --radius-pill: 40px;
  --radius-pill-lg: 60px;
  --radius-full: 999px;

  /* 阴影：极其柔和 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 6px 22px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 18px 30px -12px rgba(0, 0, 0, 0.08);
  --shadow-input: 0 8px 20px -8px rgba(0, 0, 0, 0.08);
  --shadow-primary: 0 4px 8px rgba(37, 99, 235, 0.15);

  --transition: all 0.2s ease;
}

/* ---------- 全局重置 ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

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

::selection {
  background: rgba(37, 99, 235, 0.15);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--color-primary-dark); }

ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ---------- 布局容器 ---------- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- 顶部导航（白底极简） ---------- */
.header {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border-light);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-logo .logo-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.header-logo .logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.3;
  white-space: nowrap;
}

.header-logo p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.2;
  white-space: nowrap;
  margin-top: 2px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-shrink: 0;
}

.header-nav a {
  color: #334155;
  font-size: 1.02rem;
  font-weight: 500;
  padding-bottom: 4px;
  transition: color 0.2s;
}
.header-nav a:hover {
  color: var(--color-primary);
}
.header-nav a.active {
  color: var(--color-text);
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary);
}

/* ---------- 头部登录/注册按钮 ---------- */
.header-nav .nav-btn-login,
.header-nav .nav-btn-register {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  margin-left: 10px;
  transition: all 0.2s;
}
.header-nav .nav-btn-register {
  background: var(--color-primary);
  color: #fff;
}
.header-nav .nav-btn-login:hover {
  background: var(--color-primary);
  color: #fff;
}
.header-nav .nav-btn-register:hover {
  opacity: 0.85;
  color: #fff;
}
.header-nav #nav-welcome {
  margin-left: 10px;
  color: #64748b;
  font-size: 0.95rem;
}
.header-nav #nav-welcome a {
  margin-left: 8px;
  color: #64748b;
}

/* ---------- 头部用户下拉菜单 ---------- */
.nav-user {
  position: relative;
  margin-left: 14px;
}
.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 3px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
  vertical-align: middle;
}
.nav-user-btn:hover {
  border-color: var(--color-primary);
  background: #eff6ff;
}
.nav-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}
.nav-user-avatar::before {
  content: "\1F464";
  font-size: 13px;
  line-height: 1;
}
.nav-user-tel {
  font-size: 1.02rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.5px;
}
.nav-caret {
  font-size: 11px;
  color: #94a3b8;
  transition: transform 0.2s;
}
.nav-user:hover .nav-caret {
  transform: rotate(180deg);
}
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s;
  z-index: 1000;
}
.nav-user:hover .nav-user-dropdown,
.nav-user.open .nav-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-user-dropdown .dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #334155 !important;
  font-size: 14px;
  margin-left: 0 !important;
  transition: background 0.15s;
}
.nav-user-dropdown .dd-item:hover {
  background: #f1f5f9;
}
.nav-user-dropdown .dd-ico {
  font-size: 15px;
}
.nav-user-dropdown .dd-logout {
  color: #dc2626 !important;
  border-top: 1px solid #f1f5f9;
  border-radius: 0 0 8px 8px;
  margin-top: 2px;
}
.nav-user-dropdown .dd-logout:hover {
  background: #fef2f2;
}

/* ---------- 头部右侧容器 + 手机端汉堡菜单 ---------- */
.header {
  position: relative;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--color-text);
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { display: none; }
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border-light);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
    padding: 4px 16px 16px;
    z-index: 999;
  }
  .mobile-menu.open { display: block; }
  .mobile-menu > a[data-nav] {
    display: block;
    padding: 13px 4px;
    font-size: 15px;
    font-weight: 500;
    color: #334155;
    border-bottom: 1px solid var(--color-border-light);
  }
  .mobile-menu > a[data-nav]:hover { color: var(--color-primary); }
  .mobile-menu > a[data-nav].active {
    color: var(--color-primary);
    font-weight: 600;
  }
  .mobile-menu > a[data-nav]:last-of-type { border-bottom: none; }

  .mobile-menu .m-auth {
    display: flex;
    gap: 12px;
    margin-top: 16px;
  }
  .mobile-menu .m-auth a {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
  }
  .mobile-menu .m-btn-login {
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
  }
  .mobile-menu .m-btn-register {
    background: var(--color-primary);
    color: #fff;
  }

  .mobile-menu .m-user {
    margin: 18px 0 4px;
    padding: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 60%);
    border: 1px solid #dbeafe;
    box-shadow: 0 4px 14px -8px rgba(37, 99, 235, 0.18);
  }
  .mobile-menu .m-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.02) 100%);
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
  }
  .mobile-menu .m-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }
  .mobile-menu .m-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background:#f1f1f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
  }
  .mobile-menu .m-user-avatar::before {
    content: "\1F464";
    font-size: 20px;
    line-height: 1;
  }
  .mobile-menu .m-user-tel {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .mobile-menu .m-user-desc {
    font-size: 12px;
    color: var(--color-primary);
    font-weight: 500;
    letter-spacing: 0.2px;
  }
  .mobile-menu .m-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 15px;
    color: #334155;
    background: #fff;
    border-bottom: 1px solid var(--color-border-light);
    transition: background 0.15s;
  }
  .mobile-menu .m-user-item:last-child {
    border-bottom: none;
  }
  .mobile-menu .m-user-item:active {
    background: #f8fafc;
  }
  .mobile-menu .m-user-item .m-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--color-primary-tint);
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
  }
  .mobile-menu .m-logout {
    color: var(--color-danger);
  }
  .mobile-menu .m-logout .m-ico {
    background: #fef2f2;
    color: var(--color-danger);
  }
}

/* ---------- 主内容区 ---------- */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}

/* ---------- 模式切换（分段控件） ---------- */
.mode-switcher {
  display: flex;
  gap: 4px;
  background: var(--color-bg-track);
  border-radius: var(--radius-pill);
  padding: 5px;
  margin-bottom: 28px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.mode-tab {
  padding: 10px 28px;
  text-align: center;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
}

.mode-tab:hover {
  color: var(--color-primary);
}

.mode-tab.active {
  background: #fff;
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mode-tab .tab-icon {
  font-size: 1.05rem;
  line-height: 1;
}

/* ---------- 步骤指示器 ---------- */
.steps-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--color-bg-soft);
  border-radius: var(--radius-2xl);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(50% + 24px);
  right: calc(-50% + 24px);
  height: 2px;
  background: var(--color-border);
  z-index: -1;
  transition: background 0.3s ease;
}

.step-item.done:not(:last-child)::after {
  background: var(--color-primary);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  transition: var(--transition);
  margin-bottom: 8px;
}

.step-item.active .step-number {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-ring);
}

.step-item.done .step-number {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.step-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
  max-width: 110px;
  line-height: 1.35;
}

.step-item.active .step-label {
  color: var(--color-primary);
  font-weight: 600;
}

.step-item.done .step-label {
  color: var(--color-text-light);
  font-weight: 500;
}

/* ---------- 卡片容器 ---------- */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border-light);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.card-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}

.card-header h3::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.card-body {
  padding: 28px;
}

.card-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--color-bg-soft);
}

/* 面板进入动画 */
.active-step-panel,
.qa-step-panel {
  animation: panelIn 0.35s ease both;
}

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

/* ---------- 表单组件 ---------- */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
  line-height: 1.4;
}

.form-label .required {
  color: var(--color-danger);
  margin-left: 2px;
}

.form-label .optional {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.8rem;
  margin-left: 4px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}

.form-control:hover {
  border-color: var(--color-border-medium);
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}

.form-control::placeholder {
  color: var(--color-text-placeholder);
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
  line-height: 1.7;
  border-radius: var(--radius-md);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

input[type="date"].form-control {
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 20px;
}

.form-row .form-group {
  flex: 1;
  min-width: 0;
}

.form-hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ---------- 单选/多选胶囊 ---------- */
.radio-group, .checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-card, .checkbox-card {
  position: relative;
  padding: 8px 20px;
  border: 1px solid var(--color-border-medium);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  user-select: none;
  line-height: 1.5;
}

.radio-card:hover, .checkbox-card:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-tint);
}

.radio-card input, .checkbox-card input {
  display: none;
}

.radio-card.checked, .checkbox-card.checked {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
  color: var(--color-primary);
  font-weight: 600;
}

.radio-card.checked::after,
.checkbox-card.checked::after {
  content: '✓';
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* ---------- 类型切换标签 ---------- */
.type-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border-light);
}

.type-tab {
  padding: 10px 20px;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
  font-weight: 500;
  user-select: none;
}

.type-tab:hover {
  color: var(--color-primary);
}

.type-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* ---------- 可添加列表项 ---------- */
.list-item {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  position: relative;
  transition: border-color 0.15s;
}

.list-item:hover {
  border-color: var(--color-border);
}

.list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.list-item-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95rem;
}

.list-item-remove {
  color: var(--color-danger);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  font-weight: 500;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--color-border-light);
}
.list-item-remove:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
}

/* 问答式被告块 */
.defendant-block {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.5;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary:disabled:hover {
  background: var(--color-primary);
}

.btn-secondary {
  background: #fff;
  border-color: var(--color-border-medium);
  color: #334155;
}
.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-tint);
}

.btn-outline {
  background: #fff;
  border-color: var(--color-border-medium);
  color: #334155;
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-tint);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-danger:hover { background: #b91c1c; }

.btn-success {
  background: var(--color-primary);
  color: #fff;
}
.btn-success:hover { background: var(--color-primary-dark); }

.btn-sm { padding: 7px 18px; font-size: 0.85rem; }
.btn-lg { padding: 14px 36px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-add {
  width: 100%;
  padding: 14px;
  border: 2px dashed var(--color-border-medium);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
  background: transparent;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-add:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-tint);
}

/* ---------- 步骤导航按钮区 ---------- */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-light);
}

.step-nav .btn { min-width: 130px; }

/* ---------- 案由模板选择 ---------- */
.cause-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.cause-cat-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.87rem;
  font-weight: 500;
  border: 1px solid var(--color-border-medium);
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: var(--transition);
}
.cause-cat-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.cause-cat-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.cause-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.cause-item {
  padding: 12px 16px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.88rem;
  transition: var(--transition);
  background: #fff;
  color: #475569;
  line-height: 1.4;
}
.cause-item:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
  color: var(--color-primary);
}
.cause-item.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
  color: var(--color-primary);
  font-weight: 600;
}

/* ---------- 问答模板卡片 ---------- */
.qa-view-all-wrap { margin-top: 20px; }
.qa-view-all-btn {
    width: 100%;
    padding: 14px;
    border: 2px dashed var(--color-border-medium);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
    background: transparent;
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}
.qa-view-all-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.03);
}

/* 查看全部弹窗 */
.qa-all-modal { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(15,23,42,0.55); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; }
.qa-all-box { background: #fff; border-radius: 14px; width: 100%; max-width: 1080px; height: 100%; max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(15,23,42,0.3); border: 1px solid #e2e8f0; }
.qa-all-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; border-bottom: 2px solid #e2e8f0; flex-shrink: 0; background: #f8fafc; border-radius: 14px 14px 0 0; }
.qa-all-header h3 { margin: 0; font-size: 17px; font-weight: 700; color: #1e293b; }
.qa-all-close { background: none; border: none; font-size: 24px; line-height: 1; color: #94a3b8; cursor: pointer; padding: 0 4px; }
.qa-all-close:hover { color: #475569; }
.qa-all-body { flex: 1; overflow-y: auto; padding: 16px 24px; }
.qa-all-cate { margin-bottom: 20px; }
.qa-all-cate:last-child { margin-bottom: 0; }
.qa-all-cate-title { font-size: 15px; font-weight: 600; color: #2563eb; margin-bottom: 10px; padding-left: 10px; border-left: 3px solid #2563eb; }
.qa-all-cate-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.qa-all-item { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; transition: all 0.15s; background: #fff; }
.qa-all-item:hover { border-color: #93c5fd; background: #eff6ff; }
.qa-all-item.selected { border-color: #2563eb; background: #eff6ff; }
.qa-all-item-icon { font-size: 18px; flex-shrink: 0; }
.qa-all-item-name { font-size: 13px; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-all-item.selected .qa-all-item-name { color: #2563eb; font-weight: 600; }

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.template-card {
  position: relative;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.template-card:hover {
  border-color: var(--color-border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.template-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}
.template-card.selected::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-card .tpl-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: var(--radius-md);
  background: var(--color-primary-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  line-height: 1;
  transition: var(--transition);
}
.template-card:hover .tpl-icon,
.template-card.selected .tpl-icon {
  background: var(--color-primary-tint2);
}

.template-card .tpl-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 4px;
}

.template-card .tpl-desc {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ---------- 问答问题项 ---------- */
.qa-question {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--color-border);
}
.qa-question:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* 问答式结构化输入控件样式 */
.qa-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}
.qa-input-wrap .form-control {
  flex: 1;
  border-radius: 8px;
}
.qa-number-wrap {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}
.qa-number-wrap .qa-number-prefix {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 15px;
}
.qa-number-wrap .qa-number-suffix {
  color: var(--color-text-muted);
  font-size: 14px;
  flex-shrink: 0;
}
.qa-number-wrap .qa-number-input {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 10px 0;
}
.qa-number-wrap .qa-number-input:focus {
  outline: none;
  box-shadow: none;
}
.qa-date-input {
  max-width: 280px;
}

.qa-question-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.qa-question-title .q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.qa-note-input {
  background: var(--color-bg-soft);
  border: 1px dashed var(--color-border-medium);
  font-size: 0.88rem;
  color: var(--color-text);
  border-radius: var(--radius-md);
}
.qa-note-input::placeholder {
  color: var(--color-text-placeholder);
}
.qa-note-input:focus {
  border-style: solid;
  border-color: var(--color-primary);
  background: #fff;
}

.custom-facts-section {
  border-top: 1px dashed var(--color-border);
  padding-top: 20px;
}
.custom-facts-section .section-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
}
.custom-fact-item {
  position: relative;
  margin-bottom: 12px;
}
.custom-fact-item .list-item-remove {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.78rem;
  z-index: 2;
}
.custom-fact-item textarea {
  padding-right: 70px;
}

/* ---------- 诉讼费展示 ---------- */
.fee-box {
  background: var(--color-primary-tint);
  border: 1px solid #dbeafe;
  color: var(--color-text);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.fee-box .fee-label {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  position: relative;
}

.fee-box .fee-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.3;
  position: relative;
}

.fee-box .fee-note {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 8px;
  line-height: 1.6;
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.fee-box input.form-control {
  background: #fff !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-text) !important;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  width: 200px;
  max-width: 100%;
}
.fee-box input.form-control::placeholder {
  color: var(--color-text-placeholder);
}
.fee-box input.form-control:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px var(--color-primary-ring) !important;
}

/* ---------- 预览区域 ---------- */
.preview-wrapper {
  background: var(--color-bg-soft);
  padding: 40px;
  border-radius: var(--radius-2xl);
  min-height: 400px;
}

.preview-paper {
  background: var(--color-bg-doc);
  max-width: 800px;
  margin: 0 auto;
  padding: 56px 64px;
  min-height: 600px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 24px 48px -16px rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  position: relative;
  font-family: var(--font-doc);
  font-size: 16px;
  line-height: 2;
  color: #1e293b;
}

.preview-paper .doc-title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 30px;
  letter-spacing: 8px;
  color: var(--color-text);
}

.preview-paper .doc-party {
  margin-bottom: 8px;
  text-indent: 0;
}

.preview-paper .doc-section-title {
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 8px;
}

.preview-paper .doc-content {
  text-indent: 2em;
  margin-bottom: 8px;
}

.preview-paper .doc-request-item {
  text-indent: 2em;
  margin-bottom: 4px;
}

.preview-paper .doc-evidence-item {
  text-indent: 2em;
  margin-bottom: 4px;
}

.preview-paper .doc-signature {
  margin-top: 40px;
  text-align: right;
}

.preview-paper .doc-date {
  text-align: right;
  margin-top: 8px;
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 900px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s ease;
  box-shadow: 0 24px 56px -16px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-overlay.show .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.modal-close:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--color-bg-soft);
  flex-shrink: 0;
}

/* ---------- 提示信息 ---------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
}

/* ---------- 自定义日期选择器（桌面居中 / 移动底部弹层） ---------- */
.date-picker-modal {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.date-picker-modal.show { display: flex; }
.date-picker-sheet {
  background: #fff;
  width: 100%;
  max-width: 520px;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: dpFadeIn 0.2s ease-out;
}
@keyframes dpFadeIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.date-picker-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.dp-btn {
  background: none;
  border: none;
  font-size: 15px;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  font-family: inherit;
}
.dp-btn:hover { background: #f1f5f9; }
.dp-cancel { color: #64748b; }
.dp-confirm { color: #2563eb; font-weight: 600; }
.dp-title { font-size: 15px; font-weight: 600; color: #1e293b; }
.date-picker-cols {
  display: flex;
  gap: 10px;
  padding: 18px 16px;
}
.dp-col {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.dp-col select {
  width: 100%;
  padding: 12px 30px 12px 12px;
  font-size: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  color: #1e293b;
  font-family: inherit;
  height: 45.5px;
}
.dp-col select:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.dp-col select::-ms-expand { display: none; }
.dp-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 14px;
  pointer-events: none;
}
.js-datepicker {
  cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat right 14px center;
  padding-right: 38px;
}
.js-datepicker:hover { border-color: #93c5fd; }
.js-datepicker:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); outline: none; }
@media (max-width: 768px) {
  .date-picker-modal { padding: 0; align-items: flex-end; }
  .date-picker-sheet { max-width: 100%; border-radius: 14px 14px 0 0; animation: dpSlideUp 0.2s ease-out; }
  .date-picker-cols { gap: 8px; padding: 14px 12px; }
  .dp-col select { padding: 12px 26px 12px 10px; font-size: 16px; }
}
@keyframes dpSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.alert strong { font-weight: 600; }

.alert-info {
  background: var(--color-primary-tint);
  border: 1px solid #dbeafe;
  color: #1d4ed8;
}

.alert-warning {
  background: #fefce8;
  border: 1px solid #fde68a;
  color: var(--color-warning);
}

.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--color-danger);
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 14px;
  opacity: 0.5;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--color-border-light);
  background: #fff;
  margin-top: 48px;
  padding: 40px 32px;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---------- 使用指南 ---------- */
.guide-section {
  background: #f8fafc;
  border-top: 1px solid var(--color-border-light);
  padding: 48px 24px 64px;
  scroll-margin-top: 72px;
}
.guide-container {
  max-width: 1080px;
  margin: 0 auto;
}
.guide-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}
.guide-sub {
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}
.guide-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 48px;
}
.guide-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.guide-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 4px 14px rgba(15,23,42,0.08);
}
.guide-card-icon {
  font-size: 2.4rem;
  margin-bottom: 10px;
}
.guide-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}
.guide-card p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.guide-steps-wrap {
  margin-bottom: 44px;
}
.guide-steps-heading {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.guide-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 10px;
  padding: 2px 12px;
}
.guide-badge-qa {
  background: #ecfeff;
  color: #0891b2;
}
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.guide-step {
  display: flex;
  gap: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px 22px;
  align-items: flex-start;
}
.guide-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guide-step-body h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.guide-step-body p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 22px;
  transition: border-color 0.2s;
}
.faq-item[open] {
  border-color: #bfdbfe;
}
.faq-item summary {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: '▶';
  display: inline-block;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-right: 8px;
  transition: transform 0.2s;
}
.faq-item[open] summary::before {
  transform: rotate(90deg);
}
.faq-item p {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.about-content {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px 28px;
}
.about-content p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 8px;
}
.about-content p:last-child { margin-bottom: 0; }
@media (max-width: 768px) {
  .guide-cards { grid-template-columns: 1fr; }
  .guide-section { padding: 36px 16px 48px; }
  .guide-step { flex-direction: column; gap: 10px; }
}

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-primary); }
.text-muted { color: var(--color-text-muted); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.font-bold { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-border-medium);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .preview-wrapper { padding: 24px; }
  .preview-paper { padding: 40px 36px; }
  .header-inner { padding: 0 24px; }
  .main { padding: 24px 24px 48px; }
}

@media (max-width: 640px) {
  html { font-size: 14px; }

  .header-inner { padding: 0 16px; height: 60px; }
  .header-logo h1 { font-size: 1.15rem; }
  .header-logo p { display: none; }
  .header-nav { display: none; }
  .header-logo .logo-icon { width: 36px; height: 36px; }

  .container { padding: 0 16px; }
  .main { padding: 20px 16px 48px; }

  .mode-switcher { margin-bottom: 20px; }
  .mode-tab { padding: 10px 16px; font-size: 0.88rem; }

  .steps-bar { padding: 18px 12px; border-radius: var(--radius-xl); margin-bottom: 16px; }
  .step-item:not(:last-child)::after {
    top: 16px;
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
  }
  .step-number { width: 32px; height: 32px; font-size: 0.82rem; margin-bottom: 6px; }
  .step-label { font-size: 0.72rem; max-width: 64px; }

  .card-header { padding: 16px 18px; }
  .card-body { padding: 18px; }
  .card-footer { padding: 14px 18px; flex-wrap: wrap; }

  .form-row { flex-direction: column; gap: 0; }

  .list-item, .defendant-block { padding: 16px; }

  .step-nav .btn { min-width: 0; flex: 1; }
  .btn-lg { padding: 12px 24px; }

  .template-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .template-card { padding: 20px 14px; }
  .cause-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .fee-box { padding: 18px 20px; }
  .fee-box .fee-amount { font-size: 1.6rem; }

  .preview-wrapper { padding: 16px; border-radius: var(--radius-lg); }
  .preview-paper { padding: 28px 20px; font-size: 14.5px; line-height: 1.9; }
  .preview-paper .doc-title { font-size: 21px; letter-spacing: 5px; margin-bottom: 22px; }

  .modal-overlay { padding: 12px; }
  .modal { max-height: 92vh; border-radius: var(--radius-xl); }
  .modal-header { padding: 16px 20px; }
  .modal-body { padding: 20px; }
  .modal-footer { padding: 14px 20px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; }

  .footer { margin-top: 32px; }
  .footer-container { padding: 28px 20px; }
}

/* ---------- 减弱动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 打印样式 ---------- */
@media print {
  .header, .mode-switcher, .steps-bar, .step-nav, .card-footer, .btn {
    display: none !important;
  }
  .preview-paper {
    box-shadow: none;
    padding: 0;
  }
}
