/* ===== 全局样式 ===== */
:root {
  --primary: #4a90d9;
  --primary-dark: #357abd;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #f5222d;
  --bg: #f0f2f5;
  --card-bg: #fff;
  --text: #333;
  --text-light: #666;
  --border: #e8e8e8;
  --sidebar-bg: #001529;
  --sidebar-text: #b3c0d1;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--sidebar-bg); color: var(--sidebar-text); flex-shrink: 0; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100; }
.sidebar-header { padding: 20px 16px; font-size: 16px; font-weight: bold; color: #fff; border-bottom: 1px solid #1f3a5f; }
.sidebar-menu { list-style: none; padding: 8px 0; }
.sidebar-menu li a { display: block; padding: 10px 24px; color: var(--sidebar-text); text-decoration: none; transition: all 0.2s; }
.sidebar-menu li a:hover, .sidebar-menu li a.active { background: var(--primary); color: #fff; }
.sidebar-menu li a .icon { margin-right: 8px; }
.main-content { flex: 1; margin-left: 220px; padding: 20px 24px; }
/* ===== 顶栏 ===== */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.topbar h1 { font-size: 20px; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-user .badge { background: var(--primary); color: #fff; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
/* ===== 卡片 ===== */
.card { background: var(--card-bg); border-radius: 8px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card-title { font-size: 16px; font-weight: bold; margin-bottom: 16px; border-bottom: 2px solid var(--primary); padding-bottom: 8px; }
/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.stat-card .num { font-size: 32px; font-weight: bold; color: var(--primary); }
.stat-card .label { color: var(--text-light); margin-top: 4px; }
/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
table th { background: #fafafa; font-weight: 600; white-space: nowrap; }
table tr:hover { background: #f5f9ff; }
/* ===== 按钮 ===== */
.btn { display: inline-block; padding: 6px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; transition: opacity 0.2s; }
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-default { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 3px 10px; font-size: 12px; }
/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px;
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-normal { background: #f6ffed; color: var(--success); border: 1px solid #b7eb8f; }
.tag-borderline { background: #fffbe6; color: var(--warning); border: 1px solid #ffe58f; }
.tag-abnormal { background: #fff2e8; color: #fa8c16; border: 1px solid #ffbb96; }
.tag-high-risk { background: #fff1f0; color: var(--danger); border: 1px solid #ffa39e; }
.tag-pending { background: #e6f7ff; color: #1890ff; }
.tag-completed { background: #f6ffed; color: #52c41a; }
.tag-reviewed { background: #f9f0ff; color: #722ed1; }
.tag-in-progress { background: #fffbe6; color: #faad14; }
/* ===== 分页 ===== */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; list-style: none; }
.pagination li a { display: block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; color: var(--text); }
.pagination li.active a { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination li.disabled a { color: #ccc; cursor: not-allowed; }
/* ===== 提示消息 ===== */
.alert { padding: 10px 16px; border-radius: 4px; margin-bottom: 16px; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: var(--success); }
.alert-danger { background: #fff1f0; border: 1px solid #ffa39e; color: var(--danger); }
.alert-info { background: #e6f7ff; border: 1px solid #91d5ff; color: #1890ff; }
.alert-warning { background: #fffbe6; border: 1px solid #ffe58f; color: var(--warning); }
/* ===== 登录页 ===== */
.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { background: #fff; border-radius: 12px; padding: 40px; width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.login-box h2 { text-align: center; margin-bottom: 8px; color: var(--primary); }
.login-box .subtitle { text-align: center; color: var(--text-light); margin-bottom: 24px; }
.login-box .btn-primary { width: 100%; padding: 10px; font-size: 16px; }
/* ===== 患者端 ===== */
.patient-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%); }
.patient-box { background: #fff; border-radius: 12px; padding: 40px; width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.patient-box h2 { text-align: center; margin-bottom: 8px; color: var(--primary); }
/* ===== 答题页 ===== */
.question-card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.question-card .q-num { font-weight: bold; color: var(--primary); margin-right: 8px; }
.question-card .q-content { font-size: 15px; margin-bottom: 12px; }
.question-card .options label { display: block; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 6px; cursor: pointer; transition: all 0.15s; }
.question-card .options label:hover { background: #f0f7ff; border-color: var(--primary); }
.question-card .options input[type="radio"] { margin-right: 8px; }
/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }

/* ===== 量表配置专用样式 ===== */
.config-section { margin-bottom: 16px; padding: 12px; border: 1px solid #e8e8e8; border-radius: 4px; background: #fafafa; }
.config-section > label { font-weight: 600; display: block; margin-bottom: 8px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; }
.badge-normal { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* ===== 测评审核/详情页 专用样式 ===== */
.section-title { font-size: 16px; font-weight: bold; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); display: flex; align-items: center; gap: 8px; }
.section-title .icon { font-size: 18px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.info-grid .info-item { display: flex; padding: 10px 14px; border-bottom: 1px solid #f0f0f0; align-items: baseline; }
.info-grid .info-item .label { color: var(--text-light); min-width: 90px; flex-shrink: 0; font-size: 13px; }
.info-grid .info-item .value { color: var(--text); font-weight: 500; flex: 1; }
.info-grid .info-item.full { grid-column: 1 / -1; }
.score-summary { display: flex; gap: 16px; margin: 16px 0; flex-wrap: wrap; }
.score-card { flex: 1; min-width: 140px; background: linear-gradient(135deg, #f0f7ff 0%, #e6f0ff 100%); border: 1px solid #d6e8ff; border-radius: 8px; padding: 16px; text-align: center; }
.score-card .score-label { color: var(--text-light); font-size: 13px; margin-bottom: 6px; }
.score-card .score-value { font-size: 28px; font-weight: bold; color: var(--primary); }
.score-card.risk-high { background: linear-gradient(135deg, #fff1f0 0%, #ffe0e0 100%); border-color: #ffccc7; }
.score-card.risk-high .score-value { color: var(--danger); }
.score-card.risk-abnormal { background: linear-gradient(135deg, #fff2e8 0%, #ffe4cc 100%); border-color: #ffbb96; }
.score-card.risk-abnormal .score-value { color: #fa8c16; }
.score-card.risk-borderline { background: linear-gradient(135deg, #fffbe6 0%, #fff5cc 100%); border-color: #ffe58f; }
.score-card.risk-borderline .score-value { color: var(--warning); }
.score-card.risk-normal { background: linear-gradient(135deg, #f6ffed 0%, #eaffd9 100%); border-color: #b7eb8f; }
.score-card.risk-normal .score-value { color: var(--success); }
.scoring-table th { background: #f0f5ff; color: var(--primary-dark); }
.scoring-table .score-cell { font-size: 16px; font-weight: bold; color: var(--primary); text-align: center; }
.scoring-table .type-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #e6f7ff; color: #1890ff; }
.conclusion-list { margin-top: 16px; }
.conclusion-card { border-left: 4px solid var(--primary); background: #fafbfc; border-radius: 0 8px 8px 0; padding: 14px 18px; margin-bottom: 12px; }
.conclusion-card.high-risk { border-left-color: var(--danger); background: #fff8f8; }
.conclusion-card.abnormal { border-left-color: #fa8c16; background: #fffaf5; }
.conclusion-card.borderline { border-left-color: var(--warning); background: #fffdf5; }
.conclusion-card.normal { border-left-color: var(--success); background: #f8fff5; }
.conclusion-card .con-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.conclusion-card .con-title { font-size: 15px; font-weight: bold; color: var(--text); }
.conclusion-card .con-label { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.conclusion-card.high-risk .con-label { background: var(--danger); color: #fff; }
.conclusion-card.abnormal .con-label { background: #fa8c16; color: #fff; }
.conclusion-card.borderline .con-label { background: var(--warning); color: #fff; }
.conclusion-card.normal .con-label { background: var(--success); color: #fff; }
.conclusion-card.default .con-label { background: var(--primary); color: #fff; }
.conclusion-card .con-desc { color: var(--text-light); font-size: 13px; margin-bottom: 6px; line-height: 1.6; }
.conclusion-card .con-suggestion { color: var(--text); font-size: 13px; line-height: 1.6; padding: 8px 12px; background: rgba(255,255,255,0.6); border-radius: 4px; }
.conclusion-card .con-suggestion::before { content: "💡 "; }
.answer-table th { background: #faf0ff; }
.answer-table .ans-label { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 13px; background: #f0f5ff; color: var(--primary-dark); font-weight: 500; }
.answer-table .ans-score { text-align: center; font-weight: 600; }
.review-form { background: #fafbfc; border-radius: 8px; padding: 20px; }
.review-form .form-actions { display: flex; gap: 10px; margin-top: 16px; }
.toolbar { margin-bottom: 16px; }
.toolbar .search-form { display: flex; gap: 10px; align-items: center; }
.toolbar .input { padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; }
