/* BioPharma Hub — design system */
:root {
  --bg: #f8fafb;
  --surface: #ffffff;
  --surface-2: #f1f5f6;
  --border: #e2e8ea;
  --border-strong: #cdd6d9;
  --text: #16232a;
  --text-2: #4a5c66;
  --text-3: #7b8d97;
  --accent: #0d7d6c;
  --accent-soft: #e6f4f1;
  --accent-hover: #0a6456;
  --amber: #b47a12;
  --amber-soft: #fdf3e0;
  --rose: #b3384d;
  --rose-soft: #fdeaee;
  --violet: #5b4bb7;
  --violet-soft: #eeeafb;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 35, 42, .05);
  --shadow: 0 2px 8px rgba(16, 35, 42, .07), 0 1px 2px rgba(16, 35, 42, .04);
  --shadow-lg: 0 12px 32px rgba(16, 35, 42, .12);
  --font-display: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sidebar-w: 248px;
}

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

/* 确保 hidden 属性优先于组件的 display 规则（如 .nav-item{display:flex}） */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; min-height: 100dvh; }

/* ── Sidebar ───────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent) 0%, #14a08a 100%);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .2px;
  color: var(--text);
}
.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-3);
}

/* ── Main ───────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  color: var(--text-2);
}
.menu-btn svg { width: 18px; height: 18px; display: block; }

.topbar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.view { padding: 24px; flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ── Typography ───────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); color: var(--text); line-height: 1.3; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.page-head p { color: var(--text-2); font-size: 13.5px; max-width: 640px; }

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

/* ── Cards ───────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ── News ───────────────────────────────── */
.news-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.search-box svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-3);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.news-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

.news-list { display: flex; flex-direction: column; gap: 10px; }

.news-item {
  display: block;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.news-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.news-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.source-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}
.cat-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}
.cat-研发 { background: var(--violet-soft); color: var(--violet); }
.cat-审批 { background: var(--amber-soft); color: var(--amber); }
.cat-市场 { background: var(--rose-soft); color: var(--rose); }
.cat-技术 { background: #e8f1fa; color: #2563a8; }

.news-time { font-size: 11.5px; color: var(--text-3); margin-left: auto; }

.news-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 4px;
}

.news-summary {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── States ───────────────────────────────── */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 24px;
  text-align: center;
  color: var(--text-2);
}
.state svg { width: 40px; height: 40px; color: var(--text-3); }
.state-title { font-size: 15px; font-weight: 600; color: var(--text); }
.state-desc { font-size: 13px; color: var(--text-3); max-width: 380px; }

.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, #e8edef 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-item { height: 88px; border: 1px solid var(--border); border-radius: var(--radius); }

/* ── Protocol Designer ───────────────────────────────── */
.proto-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }

.proto-panel { padding: 18px; }
.proto-panel h2 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.proto-panel .panel-desc { font-size: 12.5px; color: var(--text-3); margin-bottom: 16px; }

.template-grid { display: flex; flex-direction: column; gap: 6px; }

.template-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  font-family: inherit;
  width: 100%;
}
.template-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.template-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.template-icon {
  width: 32px; height: 32px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.template-info { min-width: 0; }
.template-name { font-size: 13px; font-weight: 600; color: var(--text); }
.template-desc { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Form */
.form-section { margin-bottom: 18px; }
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 4px;
}
.field .hint { font-size: 11px; color: var(--text-3); margin-top: 3px; }

.input, .select, .textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
.input-mono { font-family: var(--font-mono); font-size: 12.5px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Output */
.proto-output { display: flex; flex-direction: column; gap: 14px; }

.output-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.protocol-doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  font-size: 13.5px;
  line-height: 1.7;
}

.protocol-doc h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 2px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}
.protocol-doc .doc-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 18px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.protocol-doc h2 {
  font-size: 14px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.protocol-doc ol, .protocol-doc ul { padding-left: 22px; margin-bottom: 8px; }
.protocol-doc li { margin-bottom: 5px; }
.protocol-doc li::marker { color: var(--accent); font-weight: 600; }

.reagent-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px;
  font-size: 12.5px;
}
.reagent-table th {
  text-align: left;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text-2);
}
.reagent-table td {
  padding: 6px 10px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
}

.note-box {
  background: var(--amber-soft);
  border-left: 3px solid var(--amber);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 10px 0;
  font-size: 12.5px;
  color: #6b4a0e;
}
.note-box strong { color: var(--amber); }

.warning-box {
  background: var(--rose-soft);
  border-left: 3px solid var(--rose);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 10px 0;
  font-size: 12.5px;
  color: #7a2536;
}

/* AI panel */
.ai-panel {
  border: 1px solid var(--violet);
  border-radius: var(--radius);
  overflow: hidden;
}
.ai-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--violet-soft);
  border-bottom: 1px solid #ddd6f5;
}
.ai-panel-head svg { width: 16px; height: 16px; color: var(--violet); }
.ai-panel-head span { font-size: 13px; font-weight: 600; color: var(--violet); }
.ai-panel-body { padding: 14px; background: var(--surface); }
.ai-panel-body .textarea { margin-bottom: 10px; }
.ai-result {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-result h1, .ai-result h2, .ai-result h3 { margin: 12px 0 6px; }
.ai-result strong { color: var(--violet); }
.ai-result code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
}
.ai-result ul, .ai-result ol { padding-left: 20px; margin: 6px 0; }
.ai-unavailable {
  font-size: 12.5px;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

/* ── About ───────────────────────────────── */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.about-card { padding: 18px; }
.about-card h3 { font-size: 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.about-card p { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.about-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 15px;
}

.source-list { margin-top: 18px; }
.source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.source-row:last-child { border-bottom: none; }
.source-name { font-weight: 600; min-width: 160px; }
.source-url { color: var(--text-3); font-family: var(--font-mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ── Bilingual news titles ───────────────────────────────── */
.news-title-zh {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 2px;
}
.news-title-en {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-3);
  line-height: 1.4;
  margin-bottom: 4px;
  font-style: italic;
}

/* ── Tools module ───────────────────────────────── */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-top: 6px; }
.tool-card { overflow: hidden; }
.tool-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.tool-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.tool-header h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.tool-header p { font-size: 12px; color: var(--text-3); }
.tool-body { padding: 16px 18px; }
.tool-status { font-size: 12.5px; margin-top: 10px; min-height: 20px; display: flex; align-items: center; gap: 8px; }
.tool-output { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.tool-output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.tool-textarea {
  border: none;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  resize: vertical;
}
.tool-textarea:focus { box-shadow: none; }

.file-drop {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  color: var(--text-3);
}
.file-drop:hover, .file-drop.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.file-drop svg { width: 28px; height: 28px; margin-bottom: 8px; }
.file-drop p { font-size: 12.5px; }

.ocr-lang-field { margin-bottom: 12px; }
.ocr-lang-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.ocr-preview {
  display: block; max-width: 100%; max-height: 220px; margin: 10px auto 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); object-fit: contain;
}

.md-rendered {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  max-height: 300px;
  overflow-y: auto;
}
.md-rendered h1 { font-size: 18px; margin: 12px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.md-rendered h2 { font-size: 15px; margin: 10px 0 4px; color: var(--accent); }
.md-rendered h3 { font-size: 13.5px; margin: 8px 0 4px; }
.md-rendered ul, .md-rendered ol { padding-left: 20px; margin: 6px 0; }
.md-rendered code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); padding: 1px 4px; border-radius: 3px; }
.md-rendered blockquote { border-left: 3px solid var(--accent); padding-left: 10px; color: var(--text-2); margin: 8px 0; }
.md-rendered hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ── English Learning ───────────────────────────────── */
.eng-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

.flashcard-container { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 20px 0; }
.flashcard {
  width: 100%;
  max-width: 480px;
  min-height: 220px;
  perspective: 1000px;
  cursor: pointer;
}
.fc-front, .fc-back {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  transition: transform .3s;
}
.fc-back { display: none; }
.flashcard.revealed .fc-front { display: none; }
.flashcard.revealed .fc-back { display: flex; }
.fc-word { font-size: 26px; font-weight: 700; font-family: var(--font-display); color: var(--text); margin-bottom: 8px; }
.fc-hint { font-size: 12px; color: var(--text-3); }
.fc-zh { font-size: 20px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.fc-def { font-size: 13px; color: var(--text-2); margin-bottom: 12px; line-height: 1.5; }
.fc-example { font-size: 12.5px; color: var(--text-3); line-height: 1.5; border-top: 1px solid var(--border); padding-top: 10px; width: 100%; text-align: left; }
.fc-controls { display: flex; align-items: center; gap: 14px; }
.fc-counter { font-size: 13px; color: var(--text-2); font-weight: 600; min-width: 60px; text-align: center; }
.fc-actions { display: flex; gap: 8px; }

.quiz-container { max-width: 560px; margin: 0 auto; }
.quiz-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-size: 12px; color: var(--text-3); }
.quiz-bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.quiz-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.quiz-question { text-align: center; margin-bottom: 18px; }
.quiz-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  margin-bottom: 8px;
}
.quiz-word { font-size: 22px; font-weight: 700; font-family: var(--font-display); color: var(--text); }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quiz-option {
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.quiz-option:disabled { cursor: default; opacity: .7; }
.quiz-option.correct { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.quiz-option.wrong { border-color: var(--rose); background: var(--rose-soft); color: var(--rose); }
.quiz-fb { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.fb-correct { background: var(--accent-soft); color: var(--accent); }
.fb-wrong { background: var(--rose-soft); color: var(--rose); }
.quiz-fb-detail { font-size: 12px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }
.quiz-result { text-align: center; padding: 40px 20px; }
.quiz-score { font-size: 42px; font-weight: 700; font-family: var(--font-display); color: var(--accent); margin-bottom: 8px; }
.quiz-result p { font-size: 14px; color: var(--text-2); margin-bottom: 16px; }

.vocab-table { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.vocab-head {
  display: grid;
  grid-template-columns: 180px 100px 1fr;
  gap: 0;
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.vocab-row {
  display: grid;
  grid-template-columns: 180px 100px 1fr;
  gap: 0;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  align-items: center;
}
.vocab-row:last-child { border-bottom: none; }
.vocab-row:hover { background: var(--surface-2); }
.vocab-known { background: #f0faf7; }
.vocab-en { font-weight: 600; color: var(--text); font-family: var(--font-mono); font-size: 12px; }
.vocab-zh { color: var(--accent); font-weight: 500; }
.vocab-def { color: var(--text-3); font-size: 11.5px; }

.reading-list { display: flex; flex-direction: column; gap: 6px; }
.reading-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  transition: all .15s;
  width: 100%;
}
.reading-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.reading-title { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reading-card { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.reading-text { font-size: 13.5px; line-height: 1.8; color: var(--text); }
.term-mark {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 4px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
  border-bottom: 1px dashed var(--accent);
}
.term-mark:hover { background: var(--accent); color: #fff; }
.term-mark-2 {
  background: var(--amber-soft);
  color: var(--amber);
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 500;
}
.word-detail-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
}
.word-detail-card strong { color: var(--accent); font-size: 14px; }
.word-detail-card p { margin-top: 4px; color: var(--text-2); }

/* ── Overlay / mobile ───────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 35, 42, .4);
  z-index: 35;
}

/* ── Print ───────────────────────────────── */
@media print {
  .sidebar, .topbar, .output-actions, .ai-panel, .proto-panel, .news-toolbar,
  .lab-tabs, .gel-side, .gel-head-actions, .inv-head-actions, .inv-ops, .seq-controls { display: none !important; }
  .proto-layout { grid-template-columns: 1fr; }
  .gel-layout { grid-template-columns: 1fr; }
  .protocol-doc { border: none; box-shadow: none; padding: 0; }
  body { background: #fff; }
  .view { padding: 0; max-width: none; }
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 900px) {
  .proto-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: block; }
  .view { padding: 16px; }
  .topbar { padding: 0 16px; }
  .protocol-doc { padding: 18px 16px; }
  .field-row { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .quiz-options { grid-template-columns: 1fr; }
  .vocab-head, .vocab-row { grid-template-columns: 1fr 80px; }
  .vocab-def { display: none; }
  .fc-word { font-size: 22px; }
}

/* ── Lab (实验室) ───────────────────────────────── */
.panel-desc { font-size: 12.5px; color: var(--text-3); margin-bottom: 16px; }
.hint { font-size: 11.5px; color: var(--text-3); }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); display: inline-block; flex-shrink: 0; }

.lab-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.lab-tab {
  padding: 9px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.lab-tab:hover { color: var(--accent); }
.lab-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.lab-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }

/* ── Lab · 序列对比 ───────────────────────────────── */
.seq-panel { padding: 18px; }
.seq-panel h2, .gel-main h2, .gel-side h2, .inv-panel h2 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.seq-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seq-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.seq-running { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.seq-stats {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  margin-top: 16px; padding: 10px 14px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-2);
}
.seq-stats strong { color: var(--text); font-family: var(--font-mono); font-size: 12.5px; }

.aln-pre {
  margin-top: 12px; padding: 14px 16px;
  background: #101d24; color: #d7e2e8;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.55;
  overflow: auto; max-height: 480px;
  scrollbar-width: thin; scrollbar-color: #3a4d58 #101d24;
}
.aln-pre::-webkit-scrollbar { width: 10px; height: 10px; }
.aln-pre::-webkit-scrollbar-track { background: #101d24; }
.aln-pre::-webkit-scrollbar-thumb { background: #3a4d58; border-radius: 5px; border: 2px solid #101d24; }
.aln-pre::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.aln-num { color: #64808f; }
.aln-pre .aln-ok { color: #34d399; }
.aln-pre .aln-pos { color: #a78bfa; }
.aln-pre .aln-mm { color: #f87171; }
.aln-pre .aln-gap { color: #64808f; }
.hint .aln-ok { color: var(--accent); font-family: var(--font-mono); }
.hint .aln-pos { color: var(--violet); font-family: var(--font-mono); }
.hint .aln-mm { color: var(--rose); }
.hint .aln-gap { color: var(--text-3); font-family: var(--font-mono); }
.seq-panel > .hint { margin-top: 8px; }

/* ── Lab · 胶图处理 ───────────────────────────────── */
.gel-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.gel-main, .gel-side { padding: 18px; }
.gel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.gel-head-actions { display: flex; gap: 8px; }
.gel-canvas-wrap {
  margin-top: 12px; padding: 10px;
  background: #101d24; border-radius: var(--radius-sm);
  min-height: 260px; max-height: 72vh;
  display: grid; place-items: center;
  overflow: auto;
  scrollbar-width: thin; scrollbar-color: #3a4d58 #101d24;
}
.gel-canvas-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.gel-canvas-wrap::-webkit-scrollbar-track { background: #101d24; }
.gel-canvas-wrap::-webkit-scrollbar-thumb { background: #3a4d58; border-radius: 5px; border: 2px solid #101d24; }
.gel-canvas-wrap::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.gel-canvas-wrap canvas { max-width: 100%; height: auto; display: block; }
.gel-canvas-wrap .state-title { color: #d7e2e8; }
.gel-canvas-wrap .state-desc { color: #8fa3ad; }
.gel-canvas-wrap .state svg { color: #5c7280; }
.gel-main > .hint { margin-top: 8px; }

.gel-side input[type="range"] {
  width: 100%; height: 22px; margin: 2px 0 0;
  appearance: none; -webkit-appearance: none;
  background: transparent; cursor: pointer;
}
.gel-side input[type="range"]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-soft), var(--border-strong));
}
.gel-side input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin-top: -5.5px;
  border-radius: 50%; background: var(--accent);
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
  transition: transform .1s;
}
.gel-side input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.gel-side input[type="range"]::-moz-range-track { height: 5px; border-radius: 3px; background: var(--border-strong); }
.gel-side input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; box-shadow: var(--shadow-sm);
}
.gel-side input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.gel-checks { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 6px 0 4px; }
.gel-checks label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.gel-checks input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }
#gel-mode-hint { margin: 8px 0 2px; }

.gel-points { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.gel-points-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gel-points-head strong { font-size: 12.5px; flex: 1; }
.pt-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.pt-y { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); flex: 1; min-width: 0; white-space: nowrap; }
.pt-size { width: 84px; padding: 4px 8px; }
.pt-est { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--amber); white-space: nowrap; }
.pt-del { color: var(--text-3); padding: 3px 8px; }
.pt-del:hover { color: var(--rose); background: var(--rose-soft); }

/* ── Lab · 库存管理 ───────────────────────────────── */
.inv-panel { padding: 18px; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.inv-head .panel-desc { margin-bottom: 0; }
.inv-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inv-stats { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; }
.inv-stats strong { font-family: var(--font-mono); }

.inv-form {
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 14px;
}
.inv-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.inv-form-grid .field { margin-bottom: 10px; }
.inv-form-note { grid-column: 1 / -1; }
.inv-form-actions { display: flex; gap: 8px; margin-top: 4px; }

.inv-table-wrap {
  overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm);
  scrollbar-width: thin; scrollbar-color: var(--border-strong) var(--surface-2);
}
.inv-table-wrap::-webkit-scrollbar { height: 10px; width: 10px; }
.inv-table-wrap::-webkit-scrollbar-track { background: var(--surface-2); }
.inv-table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; border: 2px solid var(--surface-2); }
.inv-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.inv-table { width: 100%; min-width: 940px; border-collapse: collapse; font-size: 12.5px; }
.inv-table th {
  text-align: left; padding: 8px 10px; white-space: nowrap;
  background: var(--surface-2); color: var(--text-3);
  font-size: 11.5px; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.inv-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.inv-table tbody tr:last-child td { border-bottom: none; }
.inv-table tbody tr:hover { background: var(--surface-2); }
.inv-name { font-weight: 600; min-width: 140px; }
.inv-name .hint { margin-top: 2px; font-weight: 400; }
.inv-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.inv-badge-accent { background: var(--accent-soft); color: var(--accent-hover); }
.inv-badge-amber { background: var(--amber-soft); color: var(--amber); }
.inv-badge-rose { background: var(--rose-soft); color: var(--rose); }
.inv-ops { white-space: nowrap; text-align: right; }
.inv-badge-mute { background: var(--surface-2); color: var(--text-3); }
.inv-check-col { width: 34px; text-align: center; }
.inv-check, #inv-sel-all { accent-color: var(--accent); cursor: pointer; }
.inv-bulkbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--accent-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; font-size: 12.5px;
}
.inv-bulkbar strong { color: var(--accent-hover); white-space: nowrap; }
.paste-panel {
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 14px;
}
.paste-panel .textarea { width: 100%; margin-bottom: 8px; }

/* ── Lab · Protocol × 库存核对 ───────────────────────────────── */
.mat-list { display: flex; flex-direction: column; }
.mat-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.mat-row:last-child { border-bottom: none; }
.mat-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; }
.mat-amount { display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--text-3); }
.mat-qty { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); white-space: nowrap; }

@media (max-width: 900px) {
  .gel-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .seq-inputs { grid-template-columns: 1fr; }
  .inv-head-actions { width: 100%; }
  .gel-head-actions { width: 100%; }
}

/* ══════════════════════════════════════════════════════════
   用户 / 组织 / 管理后台 / 共享 UI（auth.js 系列模块）
   ══════════════════════════════════════════════════════════ */

/* 工具类 */
.mono { font-family: var(--font-mono); font-size: .92em; }
.mute { color: var(--text-3); }
.req { color: var(--rose); }

/* 含标题的卡片补内边距（.card 本身无 padding） */
.card:has(.card-title) { padding: 18px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.card-title .hint { font-weight: 400; }

/* 表格容器（新模块用 .table-wrap，区别于库存的 .inv-table-wrap） */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table-wrap .inv-table { min-width: 640px; }
.table-wrap .state { padding: 22px 12px; font-size: 12.5px; color: var(--text-3); }
.inv-table tbody tr.row-current { background: var(--accent-soft); }
.select-sm { padding: 4px 8px; font-size: 12px; }

/* 角色 / 徽章 */
.chip-role, .chip-super { cursor: default; border: none; padding: 2px 9px; font-size: 11px; font-weight: 600; }
.chip-role { background: var(--accent-soft); color: var(--accent-hover); }
.chip-super { background: var(--violet-soft); color: var(--violet); }
.chip-role:hover { border-color: transparent; color: var(--accent-hover); }
.chip-super:hover { border-color: transparent; color: var(--violet); }
.inv-badge.accent { background: var(--accent-soft); color: var(--accent-hover); }
.inv-badge.mute { background: var(--surface-2); color: var(--text-3); }
.inv-badge.rose { background: var(--rose-soft); color: var(--rose); }

/* 危险按钮 */
.btn-danger { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn-danger:hover { background: #9c2f42; border-color: #9c2f42; color: #fff; }

/* ── 登录 / 注册 ── */
.auth-wrap { display: flex; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 28px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-form { display: flex; flex-direction: column; }
.auth-submit { width: 100%; justify-content: center; margin-top: 4px; }
.auth-alt { text-align: center; font-size: 12.5px; color: var(--text-3); margin-top: 16px; }
.auth-alt a { color: var(--accent); font-weight: 500; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-error { background: var(--rose-soft); color: var(--rose); border: 1px solid #f0c6cf; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 12px; }
.auth-ok { background: var(--accent-soft); color: var(--accent-hover); border: 1px solid #bfe3db; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 12px; }

/* ── 账号 / 个人中心 ── */
.acct-card { padding: 18px; margin-bottom: 16px; }
.acct-id { display: flex; align-items: center; gap: 14px; }
.acct-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.acct-name { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pw-form { max-width: 360px; }

/* ── 组织 ── */
.org-list { display: flex; flex-direction: column; gap: 10px; }
.org-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.org-card-current { border-color: var(--accent); background: var(--accent-soft); }
.org-card-main { flex: 1; min-width: 0; }
.org-card-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.org-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.stack-form { display: flex; flex-direction: column; margin-top: 12px; }
.org-manage-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.org-manage-head .card-title { margin-bottom: 0; }
.org-code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; }
.org-code { font-size: 15px; font-weight: 600; letter-spacing: .5px; color: var(--accent-hover); background: var(--accent-soft); padding: 4px 10px; border-radius: var(--radius-sm); }
.org-edit-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ── 管理后台 ── */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { padding: 18px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.invite-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; margin: 12px 0 16px; }
.invite-form .field { margin-bottom: 0; }

/* 开关（超级管理员切换） */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: .18s; cursor: pointer; }
.slider::before { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .18s; box-shadow: var(--shadow-sm); }
.switch input:checked + .slider { background: var(--violet); }
.switch input:checked + .slider::before { transform: translateX(17px); }
.switch input:disabled + .slider { opacity: .45; cursor: not-allowed; }

/* ── 顶栏用户菜单 ── */
.usermenu { position: relative; }
.usermenu-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; font-family: inherit; font-size: 13px; color: var(--text); transition: background .15s; }
.usermenu-btn:hover { background: var(--surface-2); }
.usermenu-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.usermenu-name { font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-caret { width: 14px; height: 14px; color: var(--text-3); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.usermenu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: flex; flex-direction: column; }
.usermenu-pop[hidden] { display: none; }
.usermenu-org { font-size: 11.5px; color: var(--text-3); padding: 6px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.usermenu-link { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text); text-decoration: none; background: transparent; border: none; cursor: pointer; font-family: inherit; }
.usermenu-link:hover { background: var(--surface-2); }
.usermenu-logout { color: var(--rose); margin-top: 2px; border-top: 1px solid var(--border); padding-top: 10px; }

/* ── 共享弹窗 / 提示条（ui.js） ── */
.ui-mask { position: fixed; inset: 0; background: rgba(16, 35, 42, .45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; animation: fadeIn .15s ease; }
.ui-modal { width: 100%; max-width: 420px; padding: 22px; box-shadow: var(--shadow-lg); }
.ui-modal-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.ui-modal-msg { font-size: 13px; color: var(--text-2); margin-bottom: 14px; line-height: 1.6; }
.ui-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
#ui-toast-host { position: fixed; bottom: 20px; right: 20px; z-index: 110; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.ui-toast { min-width: 200px; max-width: 340px; padding: 11px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; color: #fff; background: var(--text-2); animation: toastIn .2s ease; }
.ui-toast-ok { background: var(--accent); }
.ui-toast-error { background: var(--rose); }
.ui-toast-info { background: var(--text-2); }
.ui-toast-out { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 820px) {
  .org-two-col { grid-template-columns: 1fr; }
  .invite-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .usermenu-name { display: none; }
}
