/* ============================================================
   律师法律咨询问卷 — 共享样式
   设计：温暖文书感，深墨色，避免常见科技产品视觉
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;700;900&display=swap');

:root {
  --bg: #F4EFE6;
  --surface: #FCFAF5;
  --surface-2: #F7F2E9;
  --ink: #1B1815;
  --ink-soft: #3A352F;
  --muted: #7A7268;
  --border: #DDD2BD;
  --border-soft: #E8DFCE;
  --accent: #344E4D;
  --accent-dark: #233635;
  --accent-soft: #5C7775;
  --gold: #9B7E4F;
  --danger: #8B3A2E;
  --success: #4A6B3E;

  --radius: 2px;
  --radius-lg: 4px;
  --shadow-soft: 0 1px 0 rgba(27, 24, 21, 0.04), 0 4px 24px -8px rgba(27, 24, 21, 0.08);
  --shadow-lift: 0 1px 0 rgba(27, 24, 21, 0.06), 0 12px 40px -12px rgba(27, 24, 21, 0.16);

  --font-display: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(ellipse 1200px 800px at 50% -200px, rgba(155, 126, 79, 0.06), transparent),
    radial-gradient(ellipse 800px 600px at 100% 100%, rgba(52, 78, 77, 0.04), transparent);
  background-attachment: fixed;
}

/* 主排版 */
.serif { font-family: var(--font-display); }
.mono { font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }

/* 顶部页眉 */
.page-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 32px 32px;
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
}

.page-header .seal {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 18px;
  padding: 4px 14px;
  border: 1px solid var(--gold);
  border-radius: 1px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.page-header .subtitle {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.2em;
  font-weight: 400;
}

/* 主卡片 */
.card {
  max-width: 720px;
  margin: 36px auto;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 48px 56px;
}

@media (max-width: 640px) {
  .card { margin: 20px 14px; padding: 32px 24px; }
  .page-header { padding: 36px 20px 24px; }
  .page-header h1 { font-size: 24px; }
}

/* 进度条 */
.progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2em;
}
.progress-dots { display: flex; gap: 6px; flex: 1; }
.progress-dot {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background 0.6s ease;
}
.progress-dot.active { background: var(--accent); }
.progress-dot.completed { background: var(--accent-soft); }

/* 章节 */
.section-head { margin-bottom: 32px; }
.section-head h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.section-head p { color: var(--muted); font-size: 14px; }

/* 表单字段 */
.field { margin-bottom: 26px; }
.field label.label {
  display: block;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 10px;
  font-weight: 500;
}
.field label.label .req { color: var(--danger); margin-left: 4px; }

.field input[type="text"],
.field input[type="date"],
.field input[type="number"],
.field input[type="password"],
.field textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  transition: border 0.2s, background 0.2s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }

.field input::placeholder, .field textarea::placeholder { color: #B5AC9E; }

/* radio / checkbox */
.option-group { display: flex; flex-wrap: wrap; gap: 8px; }
.option-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  user-select: none;
}
.option-group label:hover { border-color: var(--accent-soft); }
.option-group input { position: absolute; opacity: 0; pointer-events: none; }
.option-group label.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* 按钮 */
.btn-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border-soft);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--border);
}
.btn.ghost:hover { background: var(--surface-2); border-color: var(--accent-soft); color: var(--accent); }
.btn.small { padding: 8px 16px; font-size: 13px; }
.btn.gold {
  background: var(--gold);
  border-color: var(--gold);
}
.btn.gold:hover { background: #826638; border-color: #826638; }

/* 提示和消息 */
.notice {
  padding: 14px 18px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.notice.error { border-left-color: var(--danger); background: #FAEFEC; color: var(--danger); }
.notice.success { border-left-color: var(--success); background: #EEF3EA; color: var(--success); }
.notice.gold { border-left-color: var(--gold); background: #F8F0E0; color: #6B5128; }

/* 完成态 */
.complete-state {
  text-align: center;
  padding: 56px 32px;
}
.complete-state .glyph {
  font-family: var(--font-display);
  font-size: 64px;
  color: var(--gold);
  margin-bottom: 24px;
  font-weight: 400;
}
.complete-state h2 { font-size: 24px; margin-bottom: 14px; letter-spacing: 0.04em; }
.complete-state p { color: var(--muted); max-width: 420px; margin: 0 auto 8px; }

/* 后台特有 */
.admin-bg { background: #EFEAE0; }
.admin-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px;
}
@media (max-width: 640px) { .admin-grid { padding: 16px; } }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.admin-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.admin-header .who { font-size: 13px; color: var(--muted); }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 12px 20px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  letter-spacing: 0.05em;
  transition: color 0.15s, border-color 0.15s;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.list-item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  padding: 18px 22px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.list-item:hover { border-color: var(--accent-soft); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.list-item .meta { display: flex; flex-direction: column; gap: 4px; }
.list-item .primary-text { font-size: 15px; font-weight: 500; color: var(--ink); }
.list-item .secondary-text { font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; }
.list-item .right { text-align: right; }
.list-item code {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12px;
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: var(--radius);
  color: var(--accent);
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.pill.used { background: #EEE8D9; color: var(--muted); }
.pill.unused { background: #DDE7DE; color: var(--success); }
.pill.expired { background: #F0DDD8; color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state .glyph { font-family: var(--font-display); font-size: 48px; color: var(--border); margin-bottom: 16px; }

/* 提交详情页 */
.detail-section { margin-bottom: 36px; }
.detail-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
  letter-spacing: 0.05em;
  color: var(--accent);
}
.detail-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px dotted var(--border-soft);
}
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--muted); }
.detail-row .v { color: var(--ink); line-height: 1.6; }

@media (max-width: 640px) {
  .detail-row { grid-template-columns: 1fr; gap: 4px; padding: 10px 0; }
  .detail-row .v { font-weight: 500; }
}

/* 复制框 */
.code-display {
  background: var(--ink);
  color: #F4EFE6;
  padding: 18px 22px;
  border-radius: var(--radius);
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
  margin: 12px 0;
  line-height: 1.6;
}

/* 入场动画 */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s ease-out backwards; }
.fade-up:nth-child(1) { animation-delay: 0s; }
.fade-up:nth-child(2) { animation-delay: 0.05s; }
.fade-up:nth-child(3) { animation-delay: 0.1s; }
.fade-up:nth-child(4) { animation-delay: 0.15s; }
.fade-up:nth-child(5) { animation-delay: 0.2s; }
.fade-up:nth-child(6) { animation-delay: 0.25s; }
.fade-up:nth-child(7) { animation-delay: 0.3s; }
.fade-up:nth-child(8) { animation-delay: 0.35s; }

/* 装饰符 */
.divider-ornament {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold);
  margin: 20px 0;
  font-size: 11px;
  letter-spacing: 0.3em;
}
.divider-ornament::before,
.divider-ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
