/* ==========================================================================
   GFF2MG2C · 样式表
   ========================================================================== */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f2f5f7;
  --border: #e3e8ee;
  --border-strong: #cfd6df;
  --ink: #0f172a;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #edf7f5;
  --accent: #ea580c;
  --danger: #b42318;
  --warn: #b54708;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 14px 40px -24px rgba(15, 23, 42, .28);
  --mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }

::placeholder { color: var(--muted-2); opacity: 1; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page-glow {
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  background:
    radial-gradient(720px 260px at 18% -60px, rgba(15, 118, 110, .10), transparent 70%),
    radial-gradient(560px 220px at 88% -80px, rgba(37, 99, 235, .08), transparent 70%),
    linear-gradient(180deg, #eef4f3 0%, rgba(244, 246, 248, 0) 100%);
  z-index: 0;
}

code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--ink-2);
}

pre code {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.hidden { display: none !important; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* ------------------------------- 顶栏 ---------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(12px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark { width: 38px; height: 38px; flex: none; }

.brand-text h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-text .arrow { color: var(--primary); font-weight: 500; }

.brand-text p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* ------------------------------- 徽标 ---------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(152, 162, 179, .18);
}

.badge-ok {
  color: #05603a;
  border-color: #abefc6;
  background: #ecfdf3;
}
.badge-ok .dot { background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .18); }

.badge-local {
  color: #93370d;
  border-color: #fedf89;
  background: #fffaeb;
}
.badge-local .dot { background: #f79009; box-shadow: 0 0 0 3px rgba(247, 144, 9, .18); }

/* ------------------------------- 按钮 ---------------------------------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 550;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }

a.btn { display: inline-flex; align-items: center; text-decoration: none; }

.btn-ghost {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }

.btn-sm { padding: 5px 11px; font-size: 12px; }

.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------- 布局 ---------------------------------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px 24px 56px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px 24px;
  margin-bottom: 18px;
}

.card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }

.step {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #c7e3df;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  letter-spacing: .04em;
}

.card-title { min-width: 0; }

.card-title h2 {
  margin: 0 0 3px;
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -.01em;
}

.card-title p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ------------------------------ 上传区 --------------------------------- */
.dropzone {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .18s, background .18s, box-shadow .18s;
  outline: none;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--primary);
  background: #f7fbfa;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .07);
}
.dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 5px rgba(15, 118, 110, .10);
}
.dropzone.busy { pointer-events: none; opacity: .7; }

.dz-icon { flex: none; width: 52px; height: 52px; color: var(--primary); }
.dz-icon svg { width: 100%; height: 100%; }

.dz-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dz-text strong { font-size: 14px; font-weight: 600; }
.dz-text .link { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.dz-text span { font-size: 12px; color: var(--muted); }

.dz-hint { margin-left: auto; display: flex; gap: 6px; flex: none; }

.pill {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 2px 9px;
}

/* ------------------------------ 设置区 --------------------------------- */
.settings { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }

.settings summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  user-select: none;
}
.settings summary::-webkit-details-marker { display: none; }
.settings summary::before {
  content: "▸";
  color: var(--muted-2);
  font-size: 10px;
  transition: transform .15s;
  display: inline-block;
}
.settings[open] summary::before { transform: rotate(90deg); }
.settings summary em { font-style: normal; font-weight: 400; color: var(--muted-2); font-size: 11.5px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 16px;
  padding: 16px 2px 0;
}

.settings-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  padding: 13px 2px 2px;
}
.settings-checks .check { flex: 1 1 320px; }

.settings-tip {
  margin: 10px 2px 0;
  font-size: 11.5px;
  color: #93370d;
  background: #fffaeb;
  border: 1px solid #fedf89;
  border-radius: 7px;
  padding: 5px 10px;
  display: inline-block;
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.field-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }

input[type="text"],
input[type="number"],
select,
textarea {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .10);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23667085' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 26px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1.5;
}
.check input { margin: 2px 0 0; accent-color: var(--primary); width: 14px; height: 14px; flex: none; }

.radio {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  padding: 2px 0;
  line-height: 1.5;
}
.radio input { margin: 2px 0 0; accent-color: var(--primary); width: 14px; height: 14px; flex: none; }

/* ------------------------------ 统计块 --------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fbfcfd 0%, #f7f9fa 100%);
  border-radius: var(--radius);
  padding: 11px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--primary);
  opacity: .55;
}
.stat-label { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.stat-value {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.35;
}
.stat-unit { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }

/* ------------------------------- 标签页 -------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 12px 9px;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.tab-count {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 0 6px;
  min-width: 20px;
  text-align: center;
}
.tab.active .tab-count { background: var(--primary-soft); border-color: #c7e3df; color: var(--primary-dark); }

/* ------------------------------ 工具条 --------------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.search {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
}
.search svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}
.search input { width: 100%; padding-left: 30px; }

.chr-filter { max-width: 180px; }

.toolbar-info {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}

/* --------------------------- 基因清单筛选 ------------------------------ */
.list-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px 14px 11px;
  margin-bottom: 16px;
}

.list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.list-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.list-title h3 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.list-title span { font-size: 11.5px; color: var(--muted); }

.list-actions { display: flex; gap: 8px; flex: none; }

.list-panel textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
}

.list-status {
  position: relative;
  margin: 8px 0 0;
  padding-left: 14px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
}
.list-status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
}
.list-status strong { color: var(--ink-2); font-weight: 600; }
.list-status.is-ok { color: #05603a; }
.list-status.is-ok strong { color: #05603a; }
.list-status.is-ok::before { background: #12b76a; }
.list-status.is-partial,
.list-status.is-warn { color: #93370d; }
.list-status.is-partial strong,
.list-status.is-warn strong { color: #93370d; }
.list-status.is-partial::before,
.list-status.is-warn::before { background: #f79009; }
.list-status.is-error { color: var(--danger); }
.list-status.is-error strong { color: var(--danger); }
.list-status.is-error::before { background: #d92d20; }
.ls-warn { color: #b54708; }

/* ------------------------------- 表格 ---------------------------------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  max-height: 520px;
  background: var(--surface);
}
.table-wrap.short { max-height: none; }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafb;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 550;
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--muted);
  padding: 8px 10px;
  white-space: nowrap;
}

.data-table th.num, .data-table td.num { text-align: right; }
.data-table th.center, .data-table td.center { text-align: center; }
.data-table .col-idx { width: 46px; text-align: right; color: var(--muted-2); }

.data-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f3f6;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fafcfc; }

.data-table td.num {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  white-space: nowrap;
}

.cell-id {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  word-break: break-all;
}
.cell-name { color: var(--muted); font-size: 11.5px; }

.strand {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}
.strand-plus { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
.strand-minus { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; }
.strand-dot { background: #f8fafc; color: var(--muted-2); border: 1px solid var(--border); }

input[type="color"].swatch {
  width: 30px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  overflow: hidden;
}
input[type="color"].swatch::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"].swatch::-webkit-color-swatch { border: 0; border-radius: 4px; }
input[type="color"].swatch::-moz-color-swatch { border: 0; border-radius: 4px; }

.override-dot::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 5px;
  vertical-align: middle;
}

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.pager button {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 7px;
  width: 28px;
  height: 26px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.pager button:hover:not(:disabled) { background: var(--surface-3); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager .page-text { font-family: var(--mono); font-size: 11.5px; }

/* 染色体长度输入 */
.len-input {
  width: 120px;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 8px;
}
.len-input.dirty { border-color: #f79009; background: #fffcf5; }

.source-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--muted);
  white-space: nowrap;
}
.source-tag.src-seq { background: #ecfdf3; border-color: #abefc6; color: #05603a; }
.source-tag.src-region { background: #eff8ff; border-color: #b9e6fe; color: #175cd3; }
.source-tag.src-max { background: #fffaeb; border-color: #fedf89; color: #93370d; }
.source-tag.src-manual { background: #fdf2fa; border-color: #fcceee; color: #a11062; }

.note {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 12px;
}

.chrom-actions { display: flex; align-items: center; gap: 10px; padding-top: 10px; font-size: 12px; }

/* 提示列表 */
.warn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.warn-list li {
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted-2);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.warn-list li.lv-error { border-left-color: #d92d20; background: #fef3f2; }
.warn-list li.lv-warn { border-left-color: #f79009; background: #fffcf5; }
.warn-list li.lv-info { border-left-color: #2e90fa; background: #f5faff; }
.warn-list li.empty { border-left-color: #12b76a; background: #f6fef9; color: #05603a; }

/* ------------------------------ MG2C 区 -------------------------------- */
.mg2c-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.mg2c-controls > .block { display: flex; flex-direction: column; }

.block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-2);
}

.block h3 {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
}

.block .field { margin-bottom: 6px; }
.block .field:last-child { margin-bottom: 0; }
.block .check { margin: 6px 0; }
.block .check + .field,
.block .field + .check { margin-top: 10px; }

.panel-hint { margin: 0 0 10px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

.color-footnote {
  margin: auto 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

/* -------------------------- 清单基因配色 ------------------------------ */
.gene-colors { margin-bottom: 14px; }

.gene-colors-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.gene-colors-head h3 { margin-bottom: 2px; }
.gene-colors-head .panel-hint { margin: 0; padding-right: 8px; }

.gene-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 3px 18px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.gene-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 5px;
  border-radius: 6px;
  min-width: 0;
}
.gene-color-row:hover { background: #f1f5f8; }
.gene-color-row.has-override { background: #fff8f1; }

.gene-color-row input[type="color"] {
  width: 30px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  flex: none;
  overflow: hidden;
}
.gene-color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.gene-color-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.gene-color-row input[type="color"]::-moz-color-swatch { border: 0; border-radius: 3px; }

.gc-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.gc-id {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gc-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gc-reset {
  margin-left: auto;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-2);
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.gc-reset:hover:not(:disabled) { background: var(--surface); border-color: var(--border-strong); color: var(--ink-2); }
.gc-reset:disabled { opacity: 0; cursor: default; }
.gene-color-row:hover .gc-reset:disabled { opacity: .3; }

.gene-color-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted-2);
}
.gene-color-more { grid-column: 1 / -1; margin: 5px 0 0; font-size: 11px; color: var(--muted-2); }

.mg2c-note {
  margin: 0 0 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.65;
}
.mg2c-note strong { color: var(--ink-2); margin-right: 4px; }



/* 分段控件 */
.seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: #eef1f4;
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 12px;
}
.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 6px 2px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .10);
}

.cfg-panel { border-top: 1px dashed var(--border); padding-top: 11px; }
.cfg-panel:first-of-type { border-top: 0; padding-top: 0; }

.ctrl-label { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-bottom: 6px; display: block; }

.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.color-row input[type="color"] {
  width: 38px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  flex: none;
  overflow: hidden;
}
.color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.color-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-row input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }

.hex-input {
  width: 86px;
  flex: none;
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  text-align: center;
  padding: 5px 4px;
}
.color-desc { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.kw-input { width: 100%; resize: vertical; font-family: var(--mono); font-size: 11.5px; }

.chr-color-list {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  padding-right: 2px;
}

.chr-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.chr-color-row .chr-name {
  font-family: var(--mono);
  font-size: 11.5px;
  min-width: 62px;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.chr-color-row input[type="color"] {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: none;
  cursor: pointer;
  flex: none;
  overflow: hidden;
}
.chr-color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.chr-color-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.chr-color-row .chr-len {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
}

/* 预览 */

/* 输出区 */
.output { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }

.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.output-title { display: flex; align-items: center; gap: 10px; }
.output-title h3 { margin: 0; font-size: 14px; font-weight: 620; }

.valid-badge {
  font-size: 11px;
  font-family: var(--mono);
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid #abefc6;
  background: #ecfdf3;
  color: #05603a;
  white-space: nowrap;
}
.valid-badge.has-error { border-color: #fecdca; background: #fef3f2; color: var(--danger); }
.valid-badge.has-warn { border-color: #fedf89; background: #fffaeb; color: #93370d; }

.output-actions { display: flex; gap: 8px; }

.output-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.output-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.output-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: #f8fafb;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.output-block-head h4 { margin: 0 0 1px; font-size: 12px; font-weight: 600; }
.output-block-head .mono { font-size: 10.5px; }

.output-block textarea {
  display: block;
  width: 100%;
  height: 268px;
  border: 0;
  border-radius: 0;
  padding: 11px 12px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-2);
  background: #fdfefe;
  white-space: pre;
  overflow: auto;
  tab-size: 12;
}
.output-block textarea:focus { box-shadow: inset 0 0 0 2px rgba(15, 118, 110, .18); }

.valid-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.valid-list li {
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted-2);
  background: var(--surface-2);
  color: var(--ink-2);
  line-height: 1.55;
}
.valid-list li.ok { border-left-color: #12b76a; background: #f6fef9; color: #05603a; }
.valid-list li.err { border-left-color: #d92d20; background: #fef3f2; }
.valid-list li.warn { border-left-color: #f79009; background: #fffcf5; }

/* ------------------------------- 页脚 ---------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  background: #101828;
  color: #fff;
  font-size: 12.5px;
  padding: 9px 16px;
  border-radius: 9px;
  box-shadow: 0 12px 30px -12px rgba(16, 24, 40, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #912018; }

/* ------------------------------ 响应式 --------------------------------- */
@media (max-width: 1080px) {
  .mg2c-controls { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .topbar { padding: 10px 16px; }
  .brand-text p { display: none; }
  .wrap { padding: 16px 14px 40px; }
  .card { padding: 18px 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .output-grid { grid-template-columns: 1fr; }
  .dz-hint { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .toolbar-info { margin-left: 0; }
}

@media (max-width: 560px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand { gap: 9px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-text h1 { font-size: 14px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .badge { display: none; }
  .topbar-actions .btn-ghost:first-of-type { display: none; }
  .dz-icon { display: none; }
  .seg { grid-template-columns: repeat(2, 1fr); }
  .search { max-width: none; }
  .chr-filter { max-width: none; flex: 1 1 auto; }
}
