/* 渡口 · Ferry —— 设计系统（theme.css）
 *
 * 意象：夜江 / 灯笼 / 码头木牌 / 船票 / 朱印。全部手写，零外链（不引图片、不走 CDN）。
 *
 * 取法（参考资料见 README「设计」一节）：
 *  1) 暗色底不做纯黑，用「亮度分层」表达高度（页面→面板→卡片→悬停），而不是靠阴影 —— Linear 的做法。
 *  2) 全局只留一个彩色强调（灯笼橙），状态色（青/黄/锈）只表示状态，朱红只给印章 —— 单一强调色。
 *  3) 中性色全部偏暖（纸白系），冷灰会显脏 —— Claude 的暖中性。
 *  4) 标题用宋体单一字重（600），正文用系统无衬线，数字/标签用等宽等宽数字 —— 衬线立骨、无衬线干活。
 *  5) 边线一律半透明暖白（.06/.10/.16），不用实心深灰描边。
 */

:root {
  /* 亮度分层（越靠上越亮 = 越高） */
  --bg: #050e15;
  --panel: #09161f;
  --surface: #0d1e29;
  --surface-2: #122835;
  --surface-3: #17323f;

  /* 半透明暖白边线 */
  --line: rgba(244, 236, 224, 0.07);
  --line-2: rgba(244, 236, 224, 0.12);
  --line-3: rgba(244, 236, 224, 0.2);

  /* 纸白文字三层 */
  --ink: #f3eadc;
  --ink-2: rgba(243, 234, 220, 0.75);
  --ink-3: rgba(243, 234, 220, 0.54);

  /* 唯一强调色：灯笼 */
  --lantern: #ffb46b;
  --lantern-deep: #f08b3c;
  --lantern-soft: rgba(255, 180, 107, 0.14);
  --lantern-soft-2: rgba(255, 180, 107, 0.22);

  /* 状态色（只表状态，不做装饰） */
  --jade: #6fb3a0;
  --amber: #dda43f;
  --rust: #c0604a;
  --seal: #c9452f;

  --r-1: 6px; --r-2: 10px; --r-3: 14px; --r-4: 20px; --r-pill: 999px;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px;

  --shell: 1140px;
  --sidebar: 214px;

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, "SimSun", serif;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --ring: 0 0 0 3px rgba(255, 180, 107, 0.28);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.68;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 江面：极淡的斜纹 + 顶部一圈冷光，只为破掉纯色平板感 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 520px at 50% -12%, rgba(30, 74, 96, 0.5), transparent 72%),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 10px);
}
body > * { position: relative; z-index: 1; }

a { color: var(--lantern); text-decoration: none; }
a:hover { color: #ffd3a4; }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-serif); font-weight: 600; letter-spacing: 0.01em; }
h2 { font-size: 21px; line-height: 1.35; }
h3 { font-size: 17px; line-height: 1.4; }
p { margin: 0; }
code { font-family: var(--font-mono); font-size: 0.92em; }

::selection { background: var(--lantern-soft-2); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--lantern) !important;
}

/* ---------- 文字工具类 ---------- */
.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 var(--s-5); }
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.dim { color: var(--ink-2); }
.small { font-size: 13px; line-height: 1.6; }
.err { color: var(--rust); font-size: 13px; margin: 0; }
.hidden, [hidden] { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(5, 14, 21, 0.86);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: var(--s-4);
  height: 64px; max-width: var(--shell); margin: 0 auto; padding: 0 var(--s-5);
}
.brand, .topbar-right { display: flex; align-items: center; }
.topbar-right { gap: var(--s-3); margin-left: auto; }
.brand { gap: var(--s-3); color: var(--ink); text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b, .brand-text strong { font-family: var(--font-serif); font-size: 19px; font-weight: 600; letter-spacing: 0.1em; }
.brand-text .mono-label { margin-top: 2px; }

.seal {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  padding: 4px;
  background: var(--seal);
  color: #fff4e8;
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 600; line-height: 1;
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(201, 69, 47, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.seal.big {
  width: 58px; height: 58px;
  font-size: 22px; letter-spacing: 0.06em;
  border-radius: 9px; padding: 6px;
  box-shadow: 0 8px 26px rgba(201, 69, 47, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* ---------- 状态灯与胶囊 ---------- */
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-3); display: inline-block; flex: none;
}
.dot.open { background: var(--jade); box-shadow: 0 0 9px rgba(111, 179, 160, 0.75); }
.dot.guarded { background: var(--amber); box-shadow: 0 0 9px rgba(221, 164, 63, 0.7); }
.dot.down { background: var(--rust); box-shadow: 0 0 9px rgba(192, 96, 74, 0.65); }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.open { border-color: rgba(111, 179, 160, 0.34); color: #a8d7c9; background: rgba(111, 179, 160, 0.09); }
.pill.guarded { border-color: rgba(221, 164, 63, 0.34); color: #e8c583; background: rgba(221, 164, 63, 0.09); }
.pill.down { border-color: rgba(192, 96, 74, 0.36); color: #e3a394; background: rgba(192, 96, 74, 0.1); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 38px; padding: 0 var(--s-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit; font-size: 14px; line-height: 1;
  cursor: pointer; text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--line-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--lantern);
  border-color: transparent;
  color: #221206;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(240, 139, 60, 0.22);
}
.btn.primary:hover { background: #ffc689; color: #221206; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.btn.tiny { min-height: 34px; padding: 0 13px; font-size: 13px; border-radius: var(--r-1); }
.btn.danger { color: #e3a394; border-color: rgba(192, 96, 74, 0.3); }
.btn.danger:hover { background: rgba(192, 96, 74, 0.14); color: #f0b7a9; }
.btn.full { width: 100%; min-height: 42px; }
.btn.go {
  color: var(--lantern);
  border-color: rgba(255, 180, 107, 0.34);
  background: rgba(255, 180, 107, 0.08);
}
.btn.go:hover { background: var(--lantern); border-color: var(--lantern); color: #221206; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.actions { display: inline-flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.ghost { color: var(--ink-2); font-size: 14px; }
.ghost:hover { color: var(--lantern); }

/* ============================================================
   后台（操作台 / 监视台）：侧栏 + 视图 + 表格 + 指标砖
   ============================================================ */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: var(--s-6);
  align-items: start;
  padding-top: var(--s-5);
  padding-bottom: var(--s-8);
}

.sidebar {
  position: sticky; top: 88px;
  padding: var(--s-4);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border: 0; border-radius: var(--r-2);
  background: transparent; color: var(--ink-2);
  color: rgba(243, 234, 220, 0.86);
  font: inherit; font-size: 14px; text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.045); color: var(--ink); }
.nav-item.active {
  background: rgba(255, 180, 107, 0.1);
  color: #ffc98f;
  box-shadow: inset 2px 0 0 var(--lantern);
}
.nav-group { margin: var(--s-5) 0 6px; padding-left: 12px; color: rgba(243, 234, 220, 0.6); }
.nav-group:first-child { margin-top: 0; }
.sidebar-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: var(--s-5); padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}
.avatar {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--lantern-soft); color: var(--lantern);
  border: 1px solid var(--line-2);
  font-family: var(--font-serif); font-size: 14px;
}
.acct { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.acct b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.acct i { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.nav-icon { width: 16px; height: 16px; flex: none; opacity: 0.85; }
.nav-item.active .nav-icon { opacity: 1; }

.view { display: none; animation: fade 0.24s ease both; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap;
  margin-bottom: var(--s-5); padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line-2);
}
.section-head h2 { font-size: 21px; }
/* 长表格往下翻时，标题与「保存」始终在手边 */
.view > .section-head {
  position: sticky; top: 64px; z-index: 5;
  margin-left: calc(-1 * var(--s-2)); margin-right: calc(-1 * var(--s-2));
  padding: var(--s-3) var(--s-2) var(--s-3);
  background: var(--bg);
}

/* 指标砖 */
.board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: var(--s-3); }
.ticket {
  padding: var(--s-4) 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.ticket .mono-label { display: block; margin-bottom: var(--s-2); }
.ticket b {
  display: block;
  font-family: var(--font-mono); font-size: 26px; font-weight: 500;
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* 卡片 */
.card {
  margin: var(--s-4) 0 0;
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3); flex-wrap: wrap;
  margin-bottom: var(--s-4);
}
.card-head h3 { font-size: 16.5px; }

/* 表格 */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(243, 234, 220, 0.86); text-align: left; white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.022); }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.055); }
.table td[data-l="潮汐"] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td input[type="checkbox"] { width: 19px; height: 19px; vertical-align: middle; }
.table td input[data-k="strip_prefix"] { accent-color: var(--jade); }
.table td input[data-k="enabled"] { accent-color: var(--lantern); }
.table td select.input { background-color: rgba(255, 255, 255, 0.05); }
.table code {
  padding: 1px 6px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--ink); white-space: nowrap;
}

/* 定义列表（渡口信息 / 门面指标） */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-4) var(--s-5); margin: 0;
}
.facts.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.facts dt {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}
.facts dd {
  margin: 5px 0 0;
  font-family: var(--font-mono); font-size: 14px; color: var(--ink);
  word-break: break-all;
}

/* 表单 */
.field { display: block; margin-bottom: var(--s-4); }
.field > span { display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--ink-2); }
.field.switch {
  display: flex; align-items: center; gap: var(--s-3);
  cursor: pointer; min-height: 34px;
}
.field.switch > span { margin: 0; font-size: 13.5px; color: var(--ink); }
.field.switch input[type="checkbox"] {
  width: 17px; height: 17px; flex: none;
  accent-color: var(--lantern); cursor: pointer;
}
.field-row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.field-row .input { flex: 1 1 240px; width: auto; }

.input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(3, 10, 16, 0.62);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  color: var(--ink); font: inherit; font-size: 14px;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--lantern); box-shadow: var(--ring); }
.input.tiny { min-height: 30px; padding: 5px 9px; font-size: 12.5px; border-radius: var(--r-1); }
textarea.input { min-height: 84px; resize: vertical; }
select.input {
  appearance: none; -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23f3eadc' stroke-opacity='.5' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
input[type="checkbox"] { width: auto; }

/* 复制条 */
.copybox {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 7px 7px 7px 14px;
  background: rgba(3, 10, 16, 0.6);
  border: 1px solid var(--line-2); border-radius: var(--r-2);
}
.copybox code {
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; white-space: nowrap;
  color: var(--ink); font-size: 13px;
  scrollbar-width: none;
}
.copybox code::-webkit-scrollbar { display: none; }

/* 条形与排行 */
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 58px; align-items: center; gap: var(--s-3); }
.bar-row .mono-label:last-child { text-align: right; }
.bar { height: 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--lantern-deep); }

.rank { list-style: none; margin: 0; padding: 0; }
.rank li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.rank li:last-child { border-bottom: 0; padding-bottom: 0; }
.rank li code { color: var(--ink-2); font-size: 13px; word-break: break-all; }
.rank li span {
  flex: none;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: var(--s-7) var(--s-5); text-align: center;
  color: var(--ink-3); font-size: 14px;
  border: 1px dashed var(--line-2); border-radius: var(--r-3);
}

/* 进港口令门 */
.gate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: var(--s-5);
  background: rgba(3, 9, 14, 0.88);
  backdrop-filter: blur(6px);
}
.gate-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  width: min(350px, 100%);
  padding: var(--s-6) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-4);
  box-shadow: var(--shadow-2);
  text-align: center;
}
.gate-card h2 { font-size: 20px; letter-spacing: 0.14em; }
.gate-card .input, .gate-card .btn { width: 100%; }
.gate-card .err { min-height: 18px; }

/* 提示 */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90;
  padding: 10px 18px; border-radius: var(--r-pill);
  background: rgba(9, 22, 31, 0.97);
  border: 1px solid var(--line-3);
  color: var(--ink); font-size: 13.5px;
  box-shadow: var(--shadow-2);
  opacity: 0; transform: translateX(-50%) translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: rgba(192, 96, 74, 0.6); }

/* ============================================================
   门面：把江夜当底，标题压在江面上（不是「图一块、字一块」）
   ============================================================ */
.wrap { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 var(--s-5); }

/* 页面级灯笼氛围光（远处两盏，呼吸式明灭） */
.night { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.lantern {
  position: absolute; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 158, 74, 0.15), transparent 68%);
}
.lantern.l1 { top: -90px; right: 5%; animation: breathe 12s ease-in-out infinite; }
.lantern.l2 {
  bottom: 6%; left: -70px;
  background: radial-gradient(circle, rgba(124, 192, 212, 0.1), transparent 70%);
  animation: breathe 16s ease-in-out infinite reverse;
}

.hero { position: relative; display: flex; align-items: flex-end; min-height: 512px; overflow: hidden; }
/* 让江夜从顶栏底下穿过去，标题压在江面上 —— 沉浸式，而不是「图一块、字一块」 */
.portal main { margin-top: -64px; }
.portal .hero { padding-top: 64px; }
.hero:has(#scene[hidden]) .hero-veil { display: none; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg svg.scene { display: block; width: 100%; height: 100%; }
/* 上压顶栏、下压正文，中间留亮 —— 只做这一层柔和纱 */
.hero-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    /* 左半压暗，给标题让路；右半留亮，让船与灯笼看得见 */
    linear-gradient(100deg,
      rgba(5, 14, 21, 0.92) 0%,
      rgba(5, 14, 21, 0.72) 30%,
      rgba(5, 14, 21, 0.22) 56%,
      rgba(5, 14, 21, 0) 74%),
    linear-gradient(to bottom,
      rgba(5, 14, 21, 0.5) 0%,
      rgba(5, 14, 21, 0.05) 20%,
      rgba(5, 14, 21, 0.08) 56%,
      rgba(5, 14, 21, 0.72) 90%,
      var(--bg) 100%);
}
.hero-inner {
  position: relative; width: 100%;
  max-width: var(--shell); margin: 0 auto;
  padding: 0 var(--s-5) var(--s-5);
}
.eyebrow {
  margin-bottom: var(--s-4);
  color: var(--lantern);
  letter-spacing: 0.32em;
}
.hero h1 {
  font-size: clamp(34px, 7.4vw, 62px);
  line-height: 1.06;
  letter-spacing: 0.16em;
  text-shadow: 0 2px 34px rgba(0, 0, 0, 0.55);
}
.slogan {
  margin-top: var(--s-3);
  font-family: var(--font-serif); font-size: 18px;
  letter-spacing: 0.09em; color: rgba(243, 234, 220, 0.82);
}
.lede { margin-top: var(--s-3); max-width: 44ch; color: var(--ink-2); font-size: 14.5px; }
.hero .copybox {
  margin-top: var(--s-5); max-width: 470px;
  background: rgba(3, 10, 16, 0.62);
  backdrop-filter: blur(8px);
}

/* 三站式航线示意 */
.flow {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  list-style: none; margin: var(--s-5) 0 0; padding: 0;
}
.flow li:not(.arrow) {
  display: flex; flex-direction: column; gap: 1px;
  padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-2);
  background: rgba(255, 255, 255, 0.022);
}
.flow li b { font-family: var(--font-sans); font-size: 13.5px; font-weight: 600; }
.flow li span { font-size: 11.5px; color: var(--ink-3); }
.flow .arrow { color: var(--ink-3); font-size: 13px; }

.how { padding-top: var(--s-5); }
.how .flow { margin-top: var(--s-3); }
.how .mono-label { color: var(--lantern); }

.lines { padding-top: var(--s-7); }
.lines .section-head { border-bottom-color: var(--line); }

/* 航线牌：一块木牌一个泊位 */
.plank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(266px, 1fr)); gap: var(--s-3); }
.plank {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-4) 18px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.plank:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateY(-2px); }
.plank-top { display: flex; align-items: center; gap: var(--s-2); }
.plank-top .pill { margin-left: auto; }
.plank-mark { width: 22px; height: 22px; flex: none; }
.plank-mark .hull { fill: #8a5a34; }
.plank-mark .sail { fill: #d9c7ad; fill-opacity: 0.82; }
.plank-mark .lamp { fill: var(--lantern); }
.plank h3 { font-size: 19px; letter-spacing: 0.03em; }
.plank-meta { display: flex; gap: var(--s-5); margin: 0; }
.plank-meta div { min-width: 0; }
.plank-meta dt {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}
.plank-meta dd {
  margin: 3px 0 0;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2);
  overflow-wrap: anywhere;
}
.plank-actions { display: flex; gap: var(--s-2); margin-top: auto; padding-top: var(--s-1); }
.plank-actions .btn { flex: 1 1 0; }
.plank-actions .btn.go { flex: 1.15 1 0; }
.plank.state-open .plank-mark .lamp { fill: var(--lantern); }
.plank.state-down { border-color: rgba(192, 96, 74, 0.26); }
.plank.state-down .plank-mark .lamp { fill: var(--rust); }
.plank.state-guarded .plank-mark .lamp { fill: var(--amber); }

.board { padding: var(--s-7) 0 0; }
.board h2 { margin-bottom: var(--s-4); }

.foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  flex-wrap: wrap;
  margin-top: var(--s-8); padding: var(--s-5) 0 var(--s-7);
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}

/* ============================================================
   窄屏
   ============================================================ */
.console { min-height: 100vh; }
.views, .view { min-width: 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); padding-top: var(--s-4); }
  /* 手机上侧栏不再是一张卡：导航直接浮在页面上，账户行单独一行 */
  .sidebar {
    position: static;
    padding: 0; background: transparent; border: 0; border-radius: 0;
  }
  .sidebar nav {
    flex-direction: row; gap: var(--s-2);
    overflow-x: auto; padding-bottom: 3px;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .nav-item {
    width: auto; white-space: nowrap;
    padding: 7px 14px; border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.03); font-size: 13.5px;
  }
  .nav-item.active { box-shadow: none; }
  .nav-group { display: none; }
  .sidebar nav {
    mask-image: linear-gradient(to right, #000 0, #000 88%, transparent 100%);
  }
  .facts.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-foot {
    flex-direction: row; flex-wrap: wrap; gap: var(--s-3);
    margin-top: var(--s-3); padding-top: var(--s-3);
  }
}

@media (max-width: 620px) {
  :root { --s-6: 22px; --s-7: 30px; --s-8: 44px; --shell: 100%; }
  .link-portal { display: none; }
  .topbar-right { gap: var(--s-2); }
  .portal main { margin-top: -58px; }
  .portal .hero { padding-top: 58px; }
  .topbar-inner { height: 58px; padding: 0 var(--s-4); gap: var(--s-2); }
  .brand-text strong, .brand-text b { font-size: 17px; }
  .seal { width: 34px; height: 34px; font-size: 14px; }
  .seal.big { width: 52px; height: 52px; font-size: 20px; }
  .wrap, .shell, .hero-inner { padding-left: var(--s-4); padding-right: var(--s-4); }
  .hero { min-height: 384px; }
  .hero h1 { font-size: 32px; letter-spacing: 0.12em; }
  .slogan { font-size: 16px; }
  .hero-inner { padding-bottom: var(--s-5); }
  .plank-grid { grid-template-columns: 1fr; }
  .ticket b { font-size: 23px; }
  .card { padding: var(--s-4); }
  .flow { gap: var(--s-2); }
  .flow li:not(.arrow) { flex: 1 1 auto; }
  .foot { margin-top: var(--s-7); }
}

/* 窄屏表格改为「一牌一行」的堆叠卡：中文不再被压成竖排，长 URL 也不再被裁 */
@media (max-width: 760px) {
  .table-wrap { overflow-x: visible; }
  table.table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr {
    margin-bottom: var(--s-2);
    padding: 10px 13px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: var(--r-2);
  }
  .table tbody tr:nth-child(even) td, .table tbody tr:hover td { background: transparent; }
  .table td { padding: 4px 0; border-bottom: 0; }
  .table td::before {
    content: attr(data-l);
    display: inline-block; min-width: 70px; vertical-align: top;
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2);
  }
  .table td[colspan]::before, .table td[data-l=""]::before { content: none; }
  .table td[data-l=""] { padding-top: 8px; }
  .table td[data-l=""] .btn { width: 100%; }
  .table td .input, .table td .input.tiny { width: 100%; }
  .table code { white-space: normal; word-break: break-all; }
  .table td[data-l="潮汐"] { font-family: inherit; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
