
:root {
  --bg: #06131a;
  --ink: #e7f4ef;
  --muted: #7f9aa0;
  --line: rgba(94, 234, 212, 0.16);
  --panel: rgba(8, 28, 34, 0.82);
  --panel2: rgba(12, 40, 48, 0.9);
  --teal: #2dd4bf;
  --foam: #99f6e4;
  --sand: #f0c987;
  --danger: #fb7185;
  --ok: #4ade80;
  --font: "Noto Sans SC", sans-serif;
  --display: "Syne", "Noto Sans SC", sans-serif;
  --shadow: 0 20px 60px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #041016;
  min-height: 100vh;
  position: relative;
}
a { color: var(--foam); text-decoration: none; }
a:hover { color: #fff; }
.harbor { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.wave {
  position: absolute; left: -10%; right: -10%; height: 42%;
  background: radial-gradient(ellipse at center, rgba(45,212,191,.18), transparent 70%);
  filter: blur(20px); animation: drift 14s ease-in-out infinite alternate;
}
.w1 { bottom: -8%; opacity: .9; }
.w2 { bottom: 4%; opacity: .45; animation-duration: 18s; }
.pier {
  position: absolute; inset: auto 0 0 0; height: 28%;
  background: linear-gradient(180deg, transparent, rgba(8,24,30,.85) 40%, #07141a);
}
@keyframes drift { from { transform: translateX(-2%) scale(1); } to { transform: translateX(2%) scale(1.05); } }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; backdrop-filter: blur(16px);
  background: rgba(4,16,22,.72); border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 12px; align-items: center; color: inherit; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-family: var(--display); font-weight: 800;
  background: linear-gradient(145deg, #134e4a, #2dd4bf); color: #042f2e;
  box-shadow: 0 0 0 4px rgba(45,212,191,.12);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--display); font-size: 20px; letter-spacing: .04em; }
.brand-text small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a {
  color: var(--muted); padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: 14px;
}
.topbar nav a.on, .topbar nav a:hover { color: var(--ink); background: rgba(45,212,191,.12); }

.wrap { position: relative; z-index: 1; width: min(1240px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 70px; }
.hero { text-align: center; padding: 18px 0 8px; }
.eyebrow {
  display: inline-block; margin: 0 0 10px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--sand); font-size: 12px; letter-spacing: .08em;
}
.hero h1 {
  margin: 0; font-family: var(--display); font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: .08em;
  background: linear-gradient(100deg, #ecfeff, #5eead4 55%, #f0c987);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--muted); margin: 10px auto 22px; max-width: 520px; }
.search-box {
  display: flex; gap: 10px; width: min(740px, 100%); margin: 0 auto 14px;
  padding: 8px; border-radius: 18px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.search-box input {
  flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px; padding: 12px 14px;
}
.search-box button, .form button, .btn {
  border: 0; border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 700;
  color: #042f2e; background: linear-gradient(135deg, var(--teal), #99f6e4); cursor: pointer;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 28px; }
.chip, .filter-btn, .ghost, .link-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted);
  border-radius: 999px; padding: 7px 12px; cursor: pointer; font: inherit; font-size: 13px;
}
.chip:hover, .filter-btn:hover, .filter-btn.on, .ghost:hover, .link-btn:hover {
  color: var(--ink); border-color: rgba(45,212,191,.5); background: rgba(45,212,191,.1);
}

.boards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 6px;
}
.boards.hidden { display: none; }
.board {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px;
}
.board-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.board-head h2 { margin: 0; font-size: 14px; font-family: var(--display); }
.hint { color: var(--sand); font-size: 12px; }
.board-list { display: grid; gap: 6px; }
.board-item {
  display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px;
  background: rgba(0,0,0,.18); color: inherit;
}
.board-item:hover { background: rgba(45,212,191,.08); }
.board-cover {
  width: 36px; height: 48px; border-radius: 7px; object-fit: cover; background: #0b2530; flex: none;
}
.board-cover.ph {
  display: grid; place-items: center; font-size: 10px; color: var(--muted);
}
.board-item strong {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 13px; line-height: 1.3;
}
.board-item small { color: var(--muted); font-size: 11px; }

.toolbar {
  display: flex; flex-direction: column; gap: 10px;
  margin: 14px 0 10px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
}
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn { padding: 5px 10px; font-size: 12px; }
.toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mini { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }
select, .form input, .form textarea {
  border-radius: 10px; border: 1px solid var(--line);
  background: #0b1c24; color: var(--ink); padding: 8px 10px; font: inherit;
  color-scheme: dark;
}
.toolbar-right select {
  width: auto; min-width: 108px; appearance: none;
  background: #0b1c24 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%237f9aa0' d='M1 1l5 5 5-5'/></svg>") no-repeat right 10px center;
  padding-right: 28px;
}
.pref-panel {
  margin: 0 0 12px; padding: 8px 12px; border-radius: 12px;
  border: 1px dashed var(--line); background: rgba(0,0,0,.15); color: var(--muted); font-size: 13px;
}
.pref-pans { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pref-pans label {
  display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); cursor: pointer;
}

.result-meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.card {
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; min-width: 0;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: rgba(45,212,191,.4); transform: translateY(-2px); }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cover {
  width: 100%; aspect-ratio: 16 / 10; height: auto; border-radius: 0; object-fit: cover; background: #0b2530;
  display: block;
}
.cover-link { display: block; line-height: 0; }
.cover-link:hover .cover { opacity: .92; }
.cover.ph, img.cover.ph {
  display: grid; place-items: center; color: var(--muted); font-size: 12px;
  border-bottom: 1px dashed var(--line); min-height: 100px; background: #0b2530;
  content: '无图';
}
.card h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.card h3 a {
  color: inherit;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta-row, .berth-row, .flag-row {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 999px; font-size: 11px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted);
}
.badge.flag { color: var(--sand); border-color: rgba(240,201,135,.35); }
.berth {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px;
  background: rgba(0,0,0,.22); border: 1px solid var(--line);
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.link-btn { padding: 4px 8px; font-size: 12px; }
.card-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.card-actions .ghost { padding: 5px 9px; font-size: 12px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 22px; align-items: center; }
.pager button {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
.pager button:disabled { opacity: .4; cursor: not-allowed; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 28px; box-shadow: var(--shadow); max-width: 720px; margin: 10px auto;
}
.panel.wide { max-width: 1240px; }
.panel h1 { margin-top: 0; font-family: var(--display); }
.muted { color: var(--muted); }
.form { display: grid; gap: 14px; margin-top: 18px; }
.form label { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.parse-preview { font-size: 13px; color: var(--muted); }
.msg { min-height: 1.2em; color: var(--ok); }
.warn { color: var(--danger); }
.parse-preview.warn { color: var(--danger); }
.parse-preview.ok { color: var(--ok); }
.submit-history { margin-top: 18px; }
.submit-history h2 { margin: 0 0 8px; font-family: var(--display); font-size: 1.15rem; }
.history-list { display: grid; gap: 8px; margin-top: 12px; }
.history-item {
  display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(0,0,0,.18); font-size: 13px;
}
.history-item strong { font-size: 14px; }
.history-item .muted { font-size: 12px; }
.about-list { line-height: 1.8; color: var(--muted); }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 16px 40px; position: relative; z-index: 1; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.hidden { display: none !important; }
.back { color: var(--muted); font-size: 14px; }
.detail-shell { max-width: 860px; margin: 0 auto; }
.detail-card {
  margin-top: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 22px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 160px 1fr; gap: 20px;
}
.detail-cover { width: 160px; height: 220px; border-radius: 16px; object-fit: cover; background: #0b2530; }
.detail-cover.ph { display: grid; place-items: center; border: 1px dashed var(--line); color: var(--muted); }
.detail-loading { color: var(--muted); padding: 40px 0; }
.detail-desc { color: var(--muted); line-height: 1.7; margin: 12px 0; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.berth-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.berth-table th, .berth-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tag-filters { justify-content: flex-start; margin: 4px 0 14px; min-height: 0; }
.tag-filters .chip.on { background: rgba(45,212,191,.18); color: var(--foam); border-color: transparent; }
.related-section { margin-top: 28px; }
.related-section h2 { font-family: var(--display); font-size: 1.2rem; margin: 0 0 12px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.modal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(0,0,0,.55); padding: 16px;
}
.modal.hidden { display: none !important; }
.modal-card {
  width: min(420px, 100%); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px; box-shadow: var(--shadow);
}
.modal-card h3 { margin: 0 0 10px; font-family: var(--display); }
.modal-card label { display: block; margin-top: 8px; font-size: 12px; }
.modal-card select, .modal-card textarea {
  width: 100%; margin-top: 4px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0,0,0,.25); color: var(--ink); padding: 10px; font: inherit;
}

@media (max-width: 1100px) {
  .results { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .boards { grid-template-columns: 1fr; }
  .results { grid-template-columns: repeat(2, 1fr); }
  .detail-card { grid-template-columns: 1fr; }
  .detail-cover { width: 100%; height: 200px; }
}
@media (max-width: 720px) {
  .topbar { padding: 12px 14px; }
  .brand-text small { display: none; }
  .search-box { flex-direction: column; }
  .results { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card-body { padding: 8px; }
}
