/* ============================================================
   问卷调查平台 · 设计系统（纸感暖底 × 墨青 × 衬线标题）
   背景：暖纸 #F4F1EA  主色：墨青 #2D6966  标题：衬线
   ============================================================ */

:root {
  --brand: #2D6966;
  --brand-hover: #214F4C;
  --brand-active: #1A3E3C;
  --brand-light: rgba(45, 105, 102, 0.12);
  --brand-lighter: rgba(45, 105, 102, 0.06);

  --bg: #F4F1EA;
  --bg-strong: #EBE6DB;
  --card: #FFFDF9;
  --card-2: #FAF6EF;

  --text-1: #233130;
  --text-2: #566766;
  --text-3: #81918F;
  --text-4: #A9B6B4;

  --border: rgba(91, 110, 108, 0.16);
  --border-strong: rgba(63, 84, 82, 0.28);

  --success: #4C7B68;
  --success-bg: rgba(76, 123, 104, 0.12);
  --warning: #B68456;
  --warning-bg: rgba(182, 132, 86, 0.12);
  --danger: #B85C58;
  --danger-bg: rgba(184, 92, 88, 0.1);
  --gold: #B68456;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --shadow-xs: 0 4px 14px rgba(35, 49, 48, 0.05);
  --shadow-sm: 0 10px 30px rgba(35, 49, 48, 0.06);
  --shadow: 0 20px 50px rgba(35, 49, 48, 0.1);
  --shadow-lg: 0 28px 80px rgba(31, 43, 43, 0.14);

  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Songti SC",
    "Source Han Serif SC", "Noto Serif CJK SC", serif;
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; }

::selection { background: rgba(45, 105, 102, 0.18); }

/* ---------------- 通用排版 ---------------- */
.h1, .h2 { font-family: var(--font-display); letter-spacing: 0.2px; }
.h1 { font-size: 26px; font-weight: 700; }
.h2 { font-size: 20px; font-weight: 700; }
.h3 { font-size: 16px; font-weight: 600; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #FFFDF9; box-shadow: 0 6px 16px rgba(45, 105, 102, 0.28); }
.btn-primary:hover { background: var(--brand-hover); color: #FFFDF9; }
.btn-primary:active { background: var(--brand-active); }
.btn-ghost { background: var(--card); color: var(--text-2); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-lighter); }
.btn-subtle { background: var(--brand-light); color: var(--brand); }
.btn-subtle:hover { background: rgba(45, 105, 102, 0.2); }
.btn-danger { background: var(--card); color: var(--danger); border-color: rgba(184, 92, 88, 0.35); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-success { background: var(--success); color: #FFFDF9; }
.btn-success:hover { background: #3E6555; color: #FFFDF9; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 28px; font-size: 15px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 20px 24px; }
.card-hover { transition: box-shadow .2s, transform .2s, border-color .2s; }
.card-hover:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-2px); }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 500; color: var(--text-2); margin-bottom: 7px; font-size: 13px; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-1);
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }

/* ---------------- 标签 / 徽章 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 12px; font-weight: 500; line-height: 1;
}
.tag-brand { background: var(--brand-light); color: var(--brand); }
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-gray { background: rgba(91, 110, 108, 0.1); color: var(--text-3); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--success); }
.dot-gray { background: var(--text-4); }

/* ---------------- 顶部进度条（填写页） ---------------- */
.progress-track {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: var(--border); z-index: 60;
}
.progress-fill { height: 100%; background: linear-gradient(90deg, #7F9B96, #2D6966); width: 0; transition: width .35s ease; }

/* ---------------- 空状态 ---------------- */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-3);
}
.empty svg { width: 64px; height: 64px; opacity: 0.5; margin-bottom: 12px; }
.empty .empty-title { font-size: 15px; color: var(--text-2); font-weight: 500; }
.empty .empty-sub { font-size: 13px; margin-top: 4px; }

/* ---------------- 提示 ---------------- */
.flash-wrap { max-width: 1080px; margin: 16px auto 0; padding: 0 24px; }
.alert {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 4px;
}
.alert-info { background: var(--brand-light); color: var(--brand); }
.alert-err { background: var(--danger-bg); color: var(--danger); }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--text-3); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--card-2); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.table tr:hover td { background: var(--brand-lighter); }

/* ---------------- 分隔 ---------------- */
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.section-title { font-size: 15px; font-weight: 600; color: var(--text-1); display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 3px; height: 15px; background: var(--brand); border-radius: 2px; }

/* ---------------- 动画 ---------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .35s ease both; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 253, 249, 0.4); border-top-color: #FFFDF9; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
