/* ==========================================================================
   MeiCare 门诊病历质控 · 设计系统 v2
   极简医疗专业风 · 主色 #0D9488（精水青）
   ========================================================================== */
:root {
  /* ============ 品牌主色 · 医疗青绿 ============ */
  --c-primary-50:  #F0FDFA;
  --c-primary-100: #CCFBF1;
  --c-primary-200: #99F6E4;
  --c-primary-500: #14B8A6;
  --c-primary-600: #0D9488;
  --c-primary-700: #0F766E;
  --c-primary-800: #115E59;
  --c-primary-900: #134E4A;

  /* ============ 中性色 · Slate ============ */
  --c-slate-50:  #F8FAFC;
  --c-slate-100: #F1F5F9;
  --c-slate-150: #E9EEF4;
  --c-slate-200: #E2E8F0;
  --c-slate-300: #CBD5E1;
  --c-slate-400: #94A3B8;
  --c-slate-500: #64748B;
  --c-slate-600: #475569;
  --c-slate-700: #334155;
  --c-slate-800: #1E293B;
  --c-slate-900: #0F172A;

  /* ============ 语义色 ============ */
  --c-success-50: #ECFDF5;
  --c-success-500: #10B981;
  --c-success-700: #047857;
  --c-warning-50: #FFFBEB;
  --c-warning-500: #F59E0B;
  --c-warning-700: #B45309;
  --c-danger-50:  #FEF2F2;
  --c-danger-500: #EF4444;
  --c-danger-700: #B91C1C;
  --c-info-50:    #EFF6FF;
  --c-info-500:   #3B82F6;
  --c-info-700:   #1D4ED8;

  /* ============ 语义别名 ============ */
  --bg-page: var(--c-slate-50);
  --bg-panel: #FFFFFF;
  --bg-soft: var(--c-slate-100);

  --text-1: var(--c-slate-900);
  --text-2: var(--c-slate-600);
  --text-3: var(--c-slate-500);
  --text-muted: var(--c-slate-400);

  --line: var(--c-slate-200);
  --line-strong: var(--c-slate-300);
  --line-soft: var(--c-slate-150);

  /* ============ 形状/层级 ============ */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.10), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 24px 48px -8px rgba(15, 23, 42, 0.18);
  --shadow-focus: 0 0 0 3px rgba(13, 148, 136, 0.16);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --tx-fast: 120ms cubic-bezier(0.2, 0, 0.2, 1);
  --tx-base: 180ms cubic-bezier(0.2, 0, 0.2, 1);
  --tx-slow: 280ms cubic-bezier(0.2, 0, 0.2, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-1);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--c-primary-700);
  text-decoration: none;
  transition: color var(--tx-fast);
}
a:hover { color: var(--c-primary-800); }

/* 链接在深色背景上的反色 */
.login-brand a { color: rgba(255, 255, 255, 0.92); }

h1, h2, h3, h4 {
  margin: 0 0 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
h1 { font-size: 24px; letter-spacing: -0.02em; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }

p { margin: 0 0 12px; }

/* ==========================================================================
   顶栏
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--c-primary-600), var(--c-primary-700));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.5px;
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.32);
}
.brand-tagline {
  color: var(--text-3);
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

nav.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
}
nav.topnav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--tx-fast);
}
nav.topnav a:hover {
  color: var(--c-primary-700);
  background: var(--c-primary-50);
  text-decoration: none;
}
nav.topnav a.active {
  color: var(--c-primary-700);
  background: var(--c-primary-50);
}

.user-menu { position: relative; margin-left: 8px; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary-500), var(--c-primary-700));
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
  transition: transform var(--tx-fast), box-shadow var(--tx-fast);
}
.avatar:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18); }
.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 42px;
  min-width: 180px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}
.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown { display: block; }
.user-name {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
}
.user-dropdown a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-1);
  transition: background var(--tx-fast);
}
.user-dropdown a:hover { background: var(--c-primary-50); color: var(--c-primary-700); text-decoration: none; }

/* ==========================================================================
   布局 & 消息
   ========================================================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px 48px; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0; }
.page-head .actions { display: inline-flex; gap: 10px; }

.messages { max-width: 1200px; margin: 16px auto 0; padding: 0 24px; }
.message {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.message.success {
  border-color: var(--c-success-500);
  background: var(--c-success-50);
  color: var(--c-success-700);
}
.message.error {
  border-color: var(--c-danger-500);
  background: var(--c-danger-50);
  color: var(--c-danger-700);
}
.message.info { border-color: var(--c-info-500); background: var(--c-info-50); color: var(--c-info-700); }
.message.warning { border-color: var(--c-warning-500); background: var(--c-warning-50); color: var(--c-warning-700); }

/* ==========================================================================
   卡片
   ========================================================================== */
.form-panel, .panel, .auth-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}
.form-panel h1, .panel h1 { font-size: 20px; }
.form-panel h2, .panel h2 { font-size: 17px; margin-bottom: 16px; }
.form-panel h3, .panel h3 { font-size: 15px; }
.form-panel > form, .panel > form { display: block; }
.panel { margin-bottom: 20px; overflow: auto; }

/* ==========================================================================
   按钮
   ========================================================================== */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 16px;
  height: 38px;
  background: var(--c-primary-600);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--tx-fast), box-shadow var(--tx-fast), transform var(--tx-fast);
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.30);
}
button:hover, .button:hover { background: var(--c-primary-700); }
button:active, .button:active { background: var(--c-primary-800); transform: translateY(1px); }
button:focus-visible, .button:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
button:disabled, .button:disabled { background: var(--c-slate-200); color: var(--c-slate-400); cursor: not-allowed; box-shadow: none; }

.button.large, button.large { height: 44px; padding: 0 22px; font-size: 15px; border-radius: var(--radius-md); }
.button.small, button.small { height: 30px; padding: 0 12px; font-size: 13px; box-shadow: none; }
.button.full { width: 100%; }
.button.secondary {
  background: #fff;
  color: var(--text-1);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.button.secondary:hover { background: var(--c-slate-50); border-color: var(--c-slate-300); }
.button.secondary:active { background: var(--c-slate-100); }
.button.ghost {
  background: transparent;
  color: var(--text-2);
  box-shadow: none;
  border: 1px solid transparent;
}
.button.ghost:hover { background: var(--c-slate-100); color: var(--text-1); }
button.danger, .button.danger {
  background: var(--c-danger-500);
  box-shadow: 0 1px 2px rgba(239, 68, 68, 0.32);
}
button.danger:hover, .button.danger:hover { background: var(--c-danger-700); }
button.danger:active, .button.danger:active { background: #991B1B; }

/* ==========================================================================
   表单
   ========================================================================== */
label { display: block; margin: 14px 0 4px; font-weight: 500; font-size: 14px; color: var(--text-2); }

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 0 12px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  color: var(--text-1);
  background: #fff;
  transition: border-color var(--tx-fast), box-shadow var(--tx-fast), background var(--tx-fast);
}
input:hover, select:hover, textarea:hover { border-color: var(--c-slate-400); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--c-primary-500);
  box-shadow: var(--shadow-focus);
  background: #fff;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0 8px 0 0; accent-color: var(--c-primary-600); }
input[type="date"], input[type="number"] { padding: 0 10px; }

textarea { height: auto; min-height: 96px; padding: 10px 12px; }

.hint { color: var(--text-3); font-size: 13px; }
.captcha { display: block; margin: 8px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }

/* ==========================================================================
   指标卡
   ========================================================================== */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 880px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .metrics { grid-template-columns: 1fr; } }

.metrics > div {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: transform var(--tx-base), box-shadow var(--tx-base), border-color var(--tx-base);
}
.metrics > div:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.metrics > div::before {
  content: "";
  position: absolute;
  top: 0; left: 20px;
  width: 28px; height: 3px;
  background: linear-gradient(90deg, var(--c-primary-500), var(--c-primary-700));
  border-radius: 0 0 2px 2px;
}
.metrics > div > span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.metrics > div > strong {
  display: block;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.02em;
}
.metrics > div > strong + small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}

/* ==========================================================================
   表格
   ========================================================================== */
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom-color: var(--line-strong);
}
th:first-child { border-top-left-radius: var(--radius-lg); }
th:last-child { border-top-right-radius: var(--radius-lg); }
tbody tr { transition: background var(--tx-fast); }
tbody tr:hover { background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: 0; }

td.tag, .tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-soft);
  color: var(--text-2);
}
.tag.success { background: var(--c-success-50); color: var(--c-success-700); }
.tag.warning { background: var(--c-warning-50); color: var(--c-warning-700); }
.tag.danger { background: var(--c-danger-50); color: var(--c-danger-700); }
.tag.info { background: var(--c-info-50); color: var(--c-info-700); }
.tag.primary { background: var(--c-primary-50); color: var(--c-primary-700); }

.sep { color: var(--c-slate-300); margin: 0 8px; }

/* 批量操作条 */
.bulk-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.bulk-bar label { margin: 0; min-width: 180px; }
.bulk-bar input[type="number"] { width: 96px; }

/* ==========================================================================
   登录 / 注册 / 改密 · 拆分布局
   ========================================================================== */
.login-page {
  height: 100vh;
  overflow: hidden;
  background: var(--bg-page);
}

.auth-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; grid-template-rows: 200px 1fr; }
}

/* 左品牌区 */
.auth-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 0% 0%, var(--c-primary-500) 0%, transparent 60%),
    radial-gradient(120% 120% at 100% 100%, var(--c-primary-800) 0%, transparent 60%),
    linear-gradient(135deg, var(--c-primary-700), var(--c-primary-800));
  color: #fff;
  padding: 56px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-brand::before {
  content: "";
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 60%);
  top: -180px; left: -180px;
}
.auth-brand::after {
  content: "";
  position: absolute;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 60%);
  bottom: -120px; right: -120px;
}

.auth-brand-mark {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}
.auth-brand-mark .mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.20);
}
.auth-brand-mark .mark svg path { fill: #fff; }
.auth-brand-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-brand-title {
  position: relative;
  z-index: 1;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  max-width: 360px;
}
.auth-brand-title em {
  font-style: normal;
  background: linear-gradient(180deg, #ffffff, #b9f6ec);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-brand-subtitle {
  position: relative;
  z-index: 1;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,0.78);
  max-width: 360px;
}

.auth-brand-features {
  position: relative;
  z-index: 1;
  margin-top: 36px;
  display: grid;
  gap: 14px;
  max-width: 380px;
}
.auth-brand-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.auth-brand-feature .dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.auth-brand-foot {
  position: absolute;
  bottom: 24px; left: 0; right: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  z-index: 1;
}

/* 右表单区 */
.auth-form {
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  padding: 40px 36px 32px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  text-align: center;
}
.auth-card .subtitle {
  margin: 0 0 28px;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
}

.auth-form-grid {
  display: grid;
  gap: 14px;
}

.auth-errors {
  padding: 12px 14px;
  border: 1px solid rgba(239, 68, 68, 0.40);
  border-radius: var(--radius);
  background: var(--c-danger-50);
  color: var(--c-danger-700);
  font-size: 13px;
  margin-bottom: 4px;
}

.auth-field {
  display: block;
  position: relative;
  margin: 0;
}
.auth-field > input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  transition: border-color var(--tx-fast), box-shadow var(--tx-fast), background var(--tx-fast);
}
.auth-field.noicon > input { padding-left: 14px; }
.auth-field > input:hover { border-color: var(--c-slate-400); }
.auth-field > input:focus {
  outline: none;
  border-color: var(--c-primary-500);
  box-shadow: var(--shadow-focus);
}
.auth-field > input::placeholder { color: var(--text-muted); }
.auth-field .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}
.auth-field .icon svg { display: block; width: 100%; height: 100%; }

.auth-field-error {
  color: var(--c-danger-700);
  font-size: 12px;
  margin-top: 4px;
}

.auth-captcha {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 10px;
  align-items: stretch;
}
.auth-captcha input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  letter-spacing: 4px;
  text-transform: uppercase;
  transition: border-color var(--tx-fast), box-shadow var(--tx-fast);
}
.auth-captcha input:focus {
  outline: none;
  border-color: var(--c-primary-500);
  box-shadow: var(--shadow-focus);
}
.auth-captcha-img {
  position: relative;
  height: 44px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #f0fdfa, #ecfeff);
}
.auth-captcha-img img {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  transition: filter var(--tx-fast);
}
.auth-captcha-img:hover img { filter: brightness(0.96); }
.auth-captcha-img::after {
  content: "换一张";
  position: absolute;
  top: 0; right: 0;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-bottom-left-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity var(--tx-fast);
  pointer-events: none;
}
.auth-captcha-img:hover::after { opacity: 1; }

.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
  font-size: 13px;
}
.auth-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 400;
  color: var(--text-2);
  cursor: pointer;
}
.auth-options a { font-size: 13px; }

.auth-submit {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--c-primary-600), var(--c-primary-700));
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  margin-top: 4px;
  transition: transform var(--tx-fast), box-shadow var(--tx-fast), filter var(--tx-fast);
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.32), 0 4px 12px rgba(13, 148, 136, 0.20);
}
.auth-submit:hover { filter: brightness(1.04); box-shadow: 0 4px 16px rgba(13, 148, 136, 0.30); }
.auth-submit:active { transform: translateY(1px); filter: brightness(0.98); }
.auth-submit:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.auth-link {
  margin: 20px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
}
.auth-link a { color: var(--c-primary-700); font-weight: 500; }

/* 单独居中卡片（改密页） */
.single-card-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: 32px 24px;
}

/* ==========================================================================
   评分 / 预览页
   ========================================================================== */
.review-shell { height: calc(100vh - 60px); display: grid; grid-template-rows: 44px 1fr; }
.review-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.review-grid { min-height: 0; display: grid; grid-template-columns: minmax(460px, 58%) minmax(380px, 42%); }
.record-pane { min-height: 0; padding: 14px; background: var(--bg-page); overflow: auto; }
iframe { width: 100%; height: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; }
.preview-shell { height: calc(100vh - 60px); display: grid; grid-template-rows: 44px 1fr; }
.preview-panel iframe { height: 72vh; }
.score-pane { min-height: 0; overflow: auto; background: #fff; border-left: 1px solid var(--line); }
.score-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.score-summary > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.score-summary > div > span { color: var(--text-3); display: block; font-size: 12px; }
.score-summary > div > strong { font-size: 22px; font-weight: 600; color: var(--text-1); }
details { border-bottom: 1px solid var(--line); }
summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-1);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 18px; color: var(--text-3); transition: transform var(--tx-fast); }
details[open] summary::after { transform: rotate(45deg); }
summary:hover { background: var(--bg-soft); }
.defect-item {
  display: grid;
  grid-template-columns: 22px 1fr 56px;
  gap: 8px;
  align-items: start;
  padding: 10px 16px;
  margin: 0;
  font-weight: 400;
  border-top: 1px solid var(--line-soft);
}
.defect-item > input { margin: 3px 0 0; width: auto; accent-color: var(--c-primary-600); }
.defect-item > em { color: var(--c-danger-700); font-style: normal; text-align: right; font-weight: 500; }
.comment-label { padding: 14px 16px; }
.comment-label textarea { width: 100%; min-height: 80px; }
.actions { display: flex; gap: 10px; padding: 0 16px 18px; border-top: 1px solid var(--line); padding-top: 14px; background: var(--bg-soft); }

/* ==========================================================================
   兼容旧 class（保留一些旧名避免破坏模板）
   ========================================================================== */
.auth-card.legacy-auth { max-width: 420px; margin: 56px auto; }
.container.fluid { max-width: none; }

/* 老的 login-shell 兜底（不该再被使用，保留清理期兼容） */
.login-shell { display: none; }

/* ==========================================================================
   响应式小补丁
   ========================================================================== */
@media (max-width: 640px) {
  .topbar { padding: 0 16px; height: 56px; }
  .brand-tagline { display: none; }
  .container { padding: 20px 16px 32px; }
  .auth-card { padding: 32px 22px 24px; }
  .auth-brand { padding: 32px 28px; }
  .auth-brand-title { font-size: 26px; }
  .form-panel, .panel { padding: 18px; }
}/* ==========================================================================
   移动端适配 · MeiCare v2 (追加于 2026-08-09)
   覆盖点：评分双栏、登录拆分布局、宽表格、iOS 聚焦缩放、触控友好
   ========================================================================== */

/* ---------- 平板 / 窄桌面 ---------- */
@media (max-width: 900px) {
  /* 评分/预览页：双栏改为上下堆叠 */
  .review-grid { grid-template-columns: 1fr; }
  .review-shell, .preview-shell {
    height: auto;
    min-height: 100vh;
    grid-template-rows: 44px auto;
  }
  .review-shell > .review-topbar,
  .preview-shell > .review-topbar { overflow-x: auto; white-space: nowrap; }
  .record-pane { min-height: 46vh; }
  .score-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
    min-height: 48vh;
  }
  .preview-panel iframe { height: 55vh; }
}

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
  /* 登录/注册页：整页可滚动，不锁死 100vh */
  .login-page { height: auto; min-height: 100vh; overflow: auto; }
  .auth-shell { height: auto; min-height: 100vh; }
  .auth-form { align-items: flex-start; padding: 20px 16px 44px; }
  .auth-card { padding: 28px 20px 26px; border-radius: var(--radius-xl); }
  .auth-card h1 { font-size: 21px; }
  .auth-card .subtitle { margin-bottom: 22px; font-size: 13px; }

  /* 品牌区压缩为顶部横幅 */
  .auth-brand { padding: 26px 20px 22px; }
  .auth-brand-mark { margin-bottom: 18px; }
  .auth-brand-title { font-size: 22px; margin-bottom: 8px; }
  .auth-brand-subtitle { font-size: 13px; }
  .auth-brand-features { display: none; }
  .auth-brand-foot { position: static; margin-top: 16px; text-align: left; font-size: 11px; }

  /* 顶栏 */
  .topbar { height: 54px; padding: 0 12px; }
  nav.topnav { gap: 0; }
  nav.topnav a { padding: 7px 9px; font-size: 13px; }
  .brand-tagline { display: none; }
  .brand { font-size: 14px; }

  /* 布局 */
  .container { padding: 18px 14px 44px; }
  .page-head h1 { font-size: 20px; }
  .messages { padding: 0 14px; }

  /* 卡片 */
  .form-panel, .panel { padding: 16px; border-radius: var(--radius-lg); }

  /* 指标卡 */
  .metrics { gap: 10px; }
  .metrics > div { padding: 14px 16px; }
  .metrics > div > strong { font-size: 24px; }

  /* 表格：窄屏横向滚动（panel 自带 overflow:auto） */
  th, td { padding: 10px 10px; font-size: 13px; white-space: nowrap; }
  .panel table { min-width: 560px; }
  .tag { font-size: 11px; }

  /* 表单：16px 防 iOS 聚焦自动放大 */
  input, select, textarea { font-size: 16px; }
  input[type="date"], input[type="number"] { font-size: 16px; }
  .auth-field > input, .auth-captcha input { font-size: 16px; }
  .bulk-bar { gap: 8px; }
  .bulk-bar label { min-width: 140px; }

  /* 评分页细节 */
  .score-summary { gap: 8px; padding: 10px; }
  .score-summary > div { padding: 8px; }
  .score-summary > div > strong { font-size: 18px; }
  summary { padding: 12px; }
  .defect-item { padding: 8px 12px; }
  .actions { padding: 0 12px 14px; flex-wrap: wrap; }
  .actions button { flex: 1 1 auto; }

  /* 按钮更大触控目标 */
  button, .button { min-height: 40px; }

  /* 改密页 */
  .single-card-shell { padding: 24px 16px; }
}

/* ---------- 超小屏 ---------- */
@media (max-width: 380px) {
  .auth-captcha { grid-template-columns: 1fr; }
  .auth-captcha-img { height: 44px; }
  nav.topnav a { padding: 6px 7px; font-size: 12px; }
  .metrics { grid-template-columns: 1fr 1fr; }
}
/* ==========================================================================
   移动端 v2 优化 · 指标卡 2x2 + 表格转卡片（追加于 2026-08-09）
   ========================================================================== */
@media (max-width: 640px) {

  /* ========== 指标卡：2x2 grid 填满屏幕 ========== */
  .metrics {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
  .metrics > div { padding: 14px 14px; }
  .metrics > div::before { left: 14px; width: 22px; height: 3px; }
  .metrics > div > span { font-size: 12px; margin-bottom: 6px; }
  .metrics > div > strong { font-size: 22px; }

  /* ========== 表格转卡片列表 ========== */
  .panel table { min-width: 0; border: 0; background: transparent; }
  .panel > table thead { display: none; }

  .panel > table tbody tr {
    display: block;
    position: relative;
    padding: 12px 72px 12px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
  }
  .panel > table tbody tr:hover { background: var(--bg-soft); }
  .panel > table tbody tr:last-child { margin-bottom: 0; }

  .panel > table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    border: 0;
    font-size: 13px;
    white-space: normal;
  }
  .panel > table tbody td::before {
    content: attr(data-label);
    color: var(--text-3);
    font-size: 12px;
    flex-shrink: 0;
    margin-right: 12px;
  }
  /* ID 列：突出主信息 */
  .panel > table tbody td:first-child {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-primary-700);
    margin-bottom: 4px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--line-soft);
  }
  .panel > table tbody td:first-child::before {
    font-weight: 500;
  }
  /* 操作列：右上悬浮按钮 */
  .panel > table tbody td:last-child {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    margin: 0;
  }
  .panel > table tbody td:last-child::before { display: none; }
  .panel > table tbody td:last-child a {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    background: var(--c-primary-600);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
  }
  .panel > table tbody td:last-child a::after {
    content: "→";
    margin-left: 4px;
  }

  /* 选择列（sample_detail）：小标签在左 */
  .panel > table tbody td:first-child input[type="checkbox"] {
    margin-right: 6px;
    transform: scale(1.1);
  }
}