:root {
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f7f8fa;
  --brand: #2563eb;
  --brand-2: #7c3aed;
  --accent: #0ea5e9;
  --good: #059669;
  --warn: #b45309;
  --bad: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 30px rgba(16,24,40,.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶栏：左侧图标，其余留白 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 28px;
  max-width: 1200px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.brand-tag { color: var(--muted); font-size: 13px; margin-left: 6px; }

/* ---------- 居中搜索区 ---------- */
.stage {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  transition: min-height .25s ease;
}
.stage.has-results {
  min-height: 0;
  align-items: flex-start;
  padding-top: 36px;
}
.search-area { width: 100%; max-width: 640px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s;
}
.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 34px rgba(37,99,235,.14);
}
.search-icon { color: var(--muted); display: flex; align-items: center; }
.search-box input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
  padding: 11px 0;
  min-width: 0;
}
.search-box input::placeholder { color: #9ca3af; }
.search-box button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 26px;
  cursor: pointer;
  transition: filter .15s, transform .08s;
}
.search-box button:hover { filter: brightness(1.06); }
.search-box button:active { transform: translateY(1px); }

.hint {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.hint .eg { color: var(--brand); cursor: pointer; }
.hint .eg:hover { text-decoration: underline; }

/* ---------- 状态与结果 ---------- */
.status {
  max-width: 1060px;
  margin: 12px auto 0;
  padding: 0 24px;
  color: var(--muted);
  font-size: 14px;
  min-height: 20px;
}
.status.loading::before { content: "⏳ "; }
.status.error { color: var(--bad); }

.ai-summary {
  max-width: 1060px;
  margin: 14px auto 0;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14.5px;
}
.ai-summary .label { font-weight: 700; color: #075985; display: block; margin-bottom: 4px; }
.ai-summary .ai-text { margin-top: 6px; white-space: pre-wrap; }

.warnings { max-width: 1060px; margin: 10px auto 0; padding: 0 24px; }
.warn-item {
  background: #fffbeb; border: 1px solid #fde68a; color: var(--warn);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 6px;
}

.results { max-width: 1060px; margin: 0 auto; padding: 8px 24px 60px; }

section.block { margin-top: 26px; }
.block-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 700; margin: 0 0 12px;
  padding-left: 10px; border-left: 4px solid var(--brand);
}
.block-title .tag {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--soft); border-radius: 6px; padding: 2px 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.gene-card { border-left: 4px solid var(--brand); }
.sim-card { border-left: 4px solid var(--accent); }

.gene-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.gene-symbol {
  font-family: "SF Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 20px; font-weight: 700; color: var(--brand);
}
.gene-name { color: var(--ink); font-weight: 600; }
.gene-org { color: var(--muted); font-size: 13.5px; }
.sim-species { font-weight: 700; font-size: 15px; }
.sim-symbol { font-family: ui-monospace, Consolas, monospace; color: var(--brand-2); font-weight: 700; }

.badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: #ecfdf5; color: var(--good); border: 1px solid #a7f3d0;
}
.badge.warn { background: #fffbeb; color: var(--warn); border-color: #fde68a; }
.badge.blue { background: #eff6ff; color: var(--brand); border-color: #bfdbfe; }
.badge.protein { background: #fdf4ff; color: #a21caf; border-color: #f5d0fe; }
.badge.dna { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }

.desc { margin: 12px 0 0; font-size: 14.5px; color: #334155; }
.field { margin-top: 10px; font-size: 14px; }
.field .k { font-weight: 700; color: #475569; }

.mutation-box {
  margin-top: 12px; background: #fef2f2; border: 1px solid #fecaca; border-left: 4px solid var(--bad);
  border-radius: 10px; padding: 12px 14px; font-size: 14px;
}
.mutation-box .k { font-weight: 700; color: #991b1b; display: block; margin-bottom: 3px; }

/* ---------- 序列 ---------- */
.seq-block { margin-top: 14px; }
.seq-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.seq-head .acc { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--brand); font-weight: 600; }
.seq-head .meta { color: var(--muted); font-size: 12.5px; }
.seq-head .spacer { flex: 1; }
.seq-head button, .btn {
  border: 1px solid var(--line); background: #fff; color: #334155;
  border-radius: 8px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
}
.seq-head button:hover, .btn:hover { background: var(--soft); border-color: #cbd5e1; }
pre.fasta {
  background: #0b1220; color: #a5f3a5;
  border-radius: 10px; padding: 12px 14px; font-size: 12.5px;
  overflow: auto; max-height: 220px; margin: 0;
  font-family: "SF Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  white-space: pre-wrap; word-break: break-all;
}
.fasta-toggle { margin-top: 6px; }

/* ---------- 论文 ---------- */
.paper { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.paper:last-child { border-bottom: 0; }
.paper .t { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.paper .t a { color: inherit; }
.paper .t a:hover { color: var(--brand); }
.paper .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.paper .meta .jr { color: #334155; }
.paper .abs { font-size: 13px; color: #475569; margin-top: 6px; }
.paper .cited { color: var(--good); font-weight: 600; }
.paper .zh-summary {
  margin-top: 6px;
  font-size: 13px;
  color: #1d4ed8;
  background: #eff6ff;
  border-radius: 8px;
  padding: 6px 10px;
  display: inline-block;
}

.seq-note {
  margin-top: 8px;
  font-size: 12.5px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 10px;
}

.seq-label-zh {
  margin-bottom: 8px;
  font-size: 13px;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 6px 10px;
}

.sub-en {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- 直系同源 ---------- */
.orthologs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ortho {
  background: #f5f3ff; border: 1px solid #ddd6fe; color: #6d28d9;
  border-radius: 8px; padding: 5px 10px; font-size: 12.5px;
}
a.ortho:hover { text-decoration: none; background: #ede9fe; }

.empty { color: var(--muted); padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- 页脚 ---------- */
footer {
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 24px 34px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.hidden { display: none !important; }

@media (max-width: 640px) {
  .brand-tag { display: none; }
  .stage { min-height: calc(100vh - 160px); }
  .search-box button { padding: 10px 18px; }
}
