/* ===== 极致简约风格 — Minimalist SaaS UI ===== */

/* 全局变量 */
:root {
  --brand: #2563EB;
  --brand-light: #3B82F6;
  --brand-50: #EFF6FF;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --text-placeholder: #D1D5DB;
  --border: #E5E7EB;
  --border-focus: #2563EB;
  --bg-page: #F9FAFB;
  --bg-white: #FFFFFF;
  --success: #059669;
  --error: #DC2626;
  --error-light: #FEF2F2;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 滚动条 */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.4s ease-out forwards; }
.animate-shake { animation: shake 0.3s ease; }

/* ===== 首页 ===== */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

@media (max-width: 640px) {
  .page { padding: 48px 20px 80px; }
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 56px;
}

.hero-icon {
  font-size: 2.5rem;
  margin-bottom: 24px;
  opacity: 0.9;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .hero-title { font-size: 1.75rem; }
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Feature List */
.features {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 48px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-white);
}

.feature-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.feature-content {
  flex: 1;
}

.feature-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.feature-desc {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Info Block */
.info-block {
  margin-bottom: 48px;
}

.info-block-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.info-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
  margin-top: 8px;
}

/* Auth Section */
.auth-section {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
}

/* User Info */
.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-white);
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Logout Button */
.btn-logout {
  background: transparent;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
}

.btn-logout:hover {
  color: var(--error);
  border-color: var(--error);
  background: var(--error-light);
}

/* Record Section */
.record-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* Buttons */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-history {
  margin-top: 4px;
  height: 48px;
  font-size: 1rem;
  border-radius: 12px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

.btn-primary {
  background: var(--text-primary);
  color: white;
}

.btn-primary:hover {
  background: #000;
}

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

.btn-ghost:hover {
  background: var(--bg-white);
  border-color: var(--text-tertiary);
}

.btn-brand {
  background: var(--brand);
  color: white;
}

.btn-brand:hover {
  background: var(--brand-light);
}

.btn-sm {
  height: 44px;
  font-size: 0.875rem;
}

.hero-footer {
  margin-top: 56px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* ===== 问卷页 ===== */

/* 进度条 */
.progress-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.progress-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 24px;
}

@media (max-width: 640px) {
  .progress-inner { padding: 14px 20px; }
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.progress-percent {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand);
}

.progress-track {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 1px;
  transition: width 0.5s ease-out;
}

/* 问卷容器 */
.survey-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 120px;
}

@media (max-width: 640px) {
  .survey-page { padding: 32px 20px 100px; }
}

/* 分节 */
.section {
  margin-bottom: 64px;
}

.section:last-of-type {
  margin-bottom: 48px;
}

.section-header {
  margin-bottom: 40px;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* 题目 */
.question {
  margin-bottom: 40px;
  animation: fadeIn 0.3s ease-out forwards;
}

.question.hidden {
  display: none;
}

.question.error {
  animation: shake 0.3s ease;
}

.question-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.question-number {
  color: var(--text-tertiary);
  font-weight: 400;
  margin-right: 4px;
}

.question-required {
  color: var(--error);
  margin-left: 2px;
}

.question-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-left: 8px;
  font-weight: 400;
}

/* 输入框 — 极细下划线 */
.input-field {
  width: 100%;
  padding: 12px 0;
  font-size: 1rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.input-field::placeholder {
  color: var(--text-placeholder);
}

.input-field:focus {
  border-bottom-color: var(--brand);
  border-bottom-width: 2px;
}

.input-field.error {
  border-color: #EF4444;
}

.input-readonly {
  background: #F3F4F6;
  color: #6B7280;
  cursor: not-allowed;
}

.height-error {
  color: #EF4444;
  font-size: 0.8125rem;
  margin-top: 6px;
  line-height: 1.4;
}

/* 数字输入隐藏箭头 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* 日期输入 */
input[type="date"] {
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.4;
}

input[type="date"]:focus::-webkit-calendar-picker-indicator {
  opacity: 0.7;
}

/* 输入组合 */
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.input-unit {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  padding-bottom: 12px;
  flex-shrink: 0;
}

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

/* 选项 — 纯文字交互 */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.option-list-inline {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.option-item:first-child {
  border-top: 1px solid var(--border);
}

.option-item-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-width: 0;
}

.option-item-inline:hover {
  border-color: var(--text-tertiary);
}

.option-item-inline.selected {
  border-color: var(--brand);
  background: var(--brand-50);
}

.option-item-inline .option-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.option-item-inline:hover .option-text {
  color: var(--text-primary);
}

.option-item-inline.selected .option-text {
  color: var(--brand);
  font-weight: 500;
}

.option-item-inline .option-check {
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-item-inline.selected .option-check {
  opacity: 1;
}

.option-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.option-item:hover .option-text {
  color: var(--text-primary);
}

.option-item.selected .option-text {
  color: var(--brand);
  font-weight: 500;
}

.option-check {
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.option-item.selected .option-check {
  opacity: 1;
}

/* 多选选项 */
.option-multi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.option-multi:first-child {
  border-top: 1px solid var(--border);
}

.option-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.option-multi.selected .option-checkbox {
  background: var(--brand);
  border-color: var(--brand);
}

.option-multi .option-text {
  flex: 1;
}

.option-multi.selected .option-text {
  color: var(--brand);
  font-weight: 500;
}

/* 信息区块 */
.info-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.info-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.info-section-content {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* 复合题 */
.compound-row {
  display: flex;
  align-items: flex-end;
  gap: 24px;
}

@media (max-width: 480px) {
  .compound-row {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }
}

.compound-field {
  flex: 1;
  min-width: 0;
}

.compound-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.checkbox-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.checkbox-inline label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* 导航 */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  z-index: 50;
}

.nav-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  gap: 12px;
}

@media (max-width: 640px) {
  .nav-inner { padding: 14px 20px; }
}

.nav-inner .btn {
  flex: 1;
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

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

.modal {
  background: var(--bg-white);
  border-radius: 16px;
  width: 100%;
  max-width: 340px;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-content {
  padding: 40px 32px 32px;
  text-align: center;
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-actions {
  padding: 0 32px 32px;
  display: flex;
  gap: 12px;
}

/* Toast 提示 */
.toast {
  position: fixed; top: 16px; left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.8125rem;
  z-index: 2000;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  animation: toastIn 0.3s ease;
}
.toast-warn { background: #FEF3C7; color: #92400E; }
.toast-error { background: #FEE2E2; color: #991B1B; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 历史记录列表 */
.history-list {
  max-height: 300px; overflow-y: auto; padding: 8px 0;
}
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; cursor: pointer; border-radius: 6px;
  transition: background 0.15s; font-size: 0.8125rem;
}
.history-item:hover { background: var(--bg-secondary); }
.history-item + .history-item { border-top: 1px solid var(--border); }
.history-item-active { background: var(--bg-secondary); }
.history-item-date { color: var(--text-secondary); }
.history-item-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: var(--brand); color: #fff;
}

/* 历史记录横幅 */
.history-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; margin-bottom: 12px;
  background: #F0F9FF; border-radius: 8px; font-size: 0.8125rem;
  color: var(--text-secondary);
}
.history-bar .btn { flex: none; }

/* 历史记录页面 */
.history-page { padding: 24px 16px; }
.history-page-title {
  font-size: 1.125rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: 16px;
}
.history-page-empty {
  text-align: center; padding: 40px 0;
  color: var(--text-secondary); font-size: 0.875rem;
}
.history-page-list { display: flex; flex-direction: column; gap: 8px; }
.history-page-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-radius: 8px; cursor: pointer;
  background: var(--bg-white); border: 1px solid var(--border);
  transition: background 0.15s;
}
.history-page-item:hover { background: var(--bg-secondary); }
.history-page-item.active { border-color: var(--brand); background: #F0F9FF; }
.history-page-date { font-size: 0.8125rem; color: var(--text-secondary); }
.history-page-summary { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 3px; }
.history-page-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: var(--brand); color: #fff; flex-shrink: 0;
}
.history-page-actions {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 24px;
}

/* 加载中 */
.loading-overlay {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #fff;
  z-index: 1000;
  transition: opacity 0.3s;
}
.loading-overlay.hidden {
  opacity: 0; pointer-events: none;
}
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid #E5E7EB;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-text {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-actions .btn {
  flex: 1;
}

/* ===== 结果页 ===== */
.result-header {
  text-align: center;
  padding: 32px 0 48px;
}

.result-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.result-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.result-section {
  margin-bottom: 48px;
}

.result-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  gap: 24px;
}

.result-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.result-row-warn {
  background: var(--brand-50);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 8px -16px;
}

.result-row-warn .result-label {
  color: var(--brand);
  font-weight: 600;
}

/* 分析表格 */
.analysis-table {
  width: 100%;
  border-collapse: collapse;
}

.analysis-table tr {
  border-bottom: 1px solid var(--border);
}

.analysis-table tr:last-child {
  border-bottom: none;
}

.analysis-table td {
  padding: 14px 0;
  vertical-align: middle;
}

.analysis-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  width: 120px;
  padding-right: 20px;
}

.analysis-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.result-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

.result-footer {
  display: flex;
  gap: 12px;
  padding: 48px 0;
}

.result-footer .btn {
  flex: 1;
}

/* ===== 管理后台 ===== */
.admin-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.admin-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 640px) {
  .admin-header-inner {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

.admin-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-subtitle {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.admin-link {
  font-size: 0.875rem;
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.admin-link:hover {
  text-decoration: underline;
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* 统计 */
.stats-row {
  display: flex;
  gap: 1px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 48px;
}

@media (max-width: 640px) {
  .stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.stat-item {
  flex: 1;
  padding: 24px;
  background: var(--bg-white);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

/* 操作栏 */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.toolbar-btn {
  height: 40px;
  padding: 0 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-btn:hover {
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

/* 表格 */
.data-table-wrap {
  background: var(--bg-white);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.data-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.data-table-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.data-table-count {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 24px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 16px 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg-page);
}

.cell-name {
  font-weight: 500;
  color: var(--text-primary);
}

.gender-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
}

.gender-m {
  background: var(--brand-50);
  color: var(--brand);
}

.gender-f {
  background: #FDF2F8;
  color: #DB2777;
}

.cell-actions {
  display: flex;
  gap: 8px;
}

.cell-btn {
  font-size: 0.8125rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.cell-btn-view {
  color: var(--brand);
}

.cell-btn-view:hover {
  background: var(--brand-50);
}

.cell-btn-delete {
  color: var(--error);
}

.cell-btn-delete:hover {
  background: var(--error-light);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 20px;
  border-top: 1px solid var(--border);
}

.page-btn {
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover {
  background: var(--bg-page);
}

.page-btn.active {
  background: var(--text-primary);
  color: white;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 详情弹窗 */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.detail-overlay.active {
  opacity: 1;
  visibility: visible;
}

.detail-modal {
  background: var(--bg-white);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.detail-overlay.active .detail-modal {
  transform: scale(1);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: all 0.15s ease;
}

.detail-close:hover {
  background: var(--bg-page);
  color: var(--text-primary);
}

.detail-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.detail-section {
  margin-bottom: 32px;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-field-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.detail-field-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

/* ===== 图表卡 ===== */
.chart-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.chart-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 12px;
}

.chart-body {
  min-height: 40px;
}

.chart-na {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  text-align: center;
  padding: 24px 0;
}

.chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  padding: 8px 0 4px;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 2px;
  border-radius: 1px;
  vertical-align: middle;
}

.legend-label {
  font-size: 0.75rem;
  color: #9CA3AF;
  margin-left: 4px;
  vertical-align: middle;
}

.chart-sub {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 8px;
  text-align: center;
}

/* 严重度圆点 */
.sev-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* 柱状图 */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  width: 90px;
  flex-shrink: 0;
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 20px;
  background: var(--bg-page);
  border-radius: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.8s ease;
  min-width: 4px;
}

.bar-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

/* 环形进度 */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gauge-ring {
  width: 120px;
  height: 120px;
}

.gauge-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* 打印 */
@media print {
  .progress-bar,
  .nav-bar,
  .modal-overlay,
  .detail-overlay {
    display: none !important;
  }
  body { background: white; }
  .survey-page { padding: 0; }
}
