:root {
  --bg: #0d1b2a;
  --card: #16283c;
  --line: #24405c;
  --text: #e6eef7;
  --muted: #8fa6bf;
  --accent: #6fc3ff;
  --error: #ff8a8a;
}

* { box-sizing: border-box; }

/* 带 hidden 属性的元素一律不显示，避免被下面的 display 规则盖掉 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, "Microsoft YaHei", sans-serif;
}

header { padding: 28px 20px 8px; text-align: center; }
header h1 { margin: 0; font-size: 28px; letter-spacing: 6px; color: var(--accent); }
header p { margin: 4px 0 0; color: var(--muted); }

main { max-width: 960px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 10px; font-size: 16px; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .columns { grid-template-columns: 1fr; } }

.muted { color: var(--muted); font-size: 13px; }
a { color: var(--accent); }
.footer { text-align: center; }
.prose ul { list-style: disc; padding-left: 1.4em; }
.prose li { margin: 6px 0; }
.prose code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
#stage { margin-bottom: 16px; }
.name { font-size: 22px; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--bg); border-radius: 8px; padding: 10px; text-align: center; }
.stat-value { font-size: 18px; font-weight: 600; color: var(--accent); }

#tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit;
}
.tab.active { border-color: var(--accent); color: var(--accent); }

ul { list-style: none; margin: 0; padding: 0; }
.feed { max-height: 520px; overflow-y: auto; }
.feed li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.time { color: var(--muted); font-size: 12px; margin-right: 10px; font-variant-numeric: tabular-nums; }

.diary-entry { padding: 8px 0; border-bottom: 1px solid var(--line); }
.diary-entry:last-child { border-bottom: 0; }
.diary-entry p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- 装备 ---------- */

.gear-row { display: grid; grid-template-columns: 4em 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.gear-row:last-child { border-bottom: 0; }

/* ---------- 钓鱼图鉴 ---------- */

.fish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fish-card {
  padding: 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line);
  text-align: center; font-size: 12px;
}
.fish-card .muted { font-size: 11px; }
.fish-name { font-size: 14px; font-weight: 600; margin-top: 4px; }
.fish-pic { height: 84px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.fish-img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* 没钓到的鱼只露出剪影 */
.fish-img.silhouette { filter: brightness(0) invert(.28); }
/* 稀有度越高，边框越亮，高稀有度的鱼带光晕 */
.fish-card.tier1 { border-color: #3f8f52; }
.fish-card.tier2 { border-color: #3b78d6; }
.fish-card.tier3 { border-color: #8250d6; }
.fish-card.tier4 { border-color: #d99a12; }
.fish-card.tier3:not(.unknown) .fish-img { filter: drop-shadow(0 0 6px rgba(160, 110, 255, .8)); }
.fish-card.tier4:not(.unknown) .fish-img { filter: drop-shadow(0 0 8px rgba(255, 200, 60, .9)); }
.fish-card.unknown .fish-name { color: var(--muted); }
.moment-fish { height: 110px; margin: 0 0 12px; display: flex; align-items: center; justify-content: center; }
.steps { max-height: 220px; overflow-y: auto; position: relative; }

form { display: flex; gap: 8px; margin-top: 10px; }
input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; letter-spacing: 2px; text-transform: uppercase;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button[type="submit"] {
  padding: 9px 18px; border-radius: 8px; border: 0; background: var(--accent); color: #062033;
  font: inherit; font-weight: 600; cursor: pointer;
}
button.ghost {
  padding: 7px 16px; border-radius: 8px; border: 1px solid var(--line); background: transparent;
  color: var(--text); font: inherit; cursor: pointer;
}
button.ghost:hover { border-color: var(--accent); color: var(--accent); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 相册 ---------- */

.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
#album-more { display: block; margin: 14px auto 0; }
.moment-card {
  display: block; padding: 0; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
}
.moment-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.moment-thumb.stage { border: 0; border-radius: 0; pointer-events: none; }
.moment-info { padding: 8px 10px 2px; }
.moment-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 10px 10px; min-height: 12px; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--text); }
.badge.tier0 { background: #55657a; }
.badge.tier1 { background: #3f8f52; }
.badge.tier2 { background: #3b78d6; }
.badge.tier3 { background: #8250d6; }
.badge.tier4 { background: #d99a12; color: #1c1300; }
.badge.new { background: #d6577a; }
.badge.thought { background: transparent; border: 1px solid var(--accent); color: var(--accent); }

/* ---------- 瞬间详情（回放） ---------- */

dialog#moment {
  width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text);
}
dialog#moment::backdrop { background: rgba(4, 10, 20, .72); }
#moment-stage.stage { border: 0; border-radius: 0; }
.moment-body { padding: 14px 18px 18px; }
.moment-body h3 { margin: 0; font-size: 18px; }
.moment-body .muted { margin: 2px 0 12px; }
.thought {
  display: flex; gap: 10px; align-items: baseline; min-height: 46px; padding: 10px 14px;
  border-radius: 10px; background: var(--bg); border-left: 3px solid var(--accent); overflow-wrap: anywhere;
}
.thought-label { flex: none; font-size: 12px; color: var(--accent); }
.steps { margin: 14px 0 0; padding-left: 22px; }
.steps li { padding: 5px 8px; border-radius: 8px; color: var(--muted); }
.steps li.active { background: var(--bg); color: var(--text); }
.step-thought { margin-top: 2px; font-size: 13px; overflow-wrap: anywhere; }
.step-thought::before { content: "“"; }
.step-thought::after { content: "”"; }
.diary-text { margin: 14px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.moment-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.msg { min-height: 1.6em; margin: 8px 0 0; color: var(--accent); }
.msg.error { color: var(--error); }
