/* 主視覺：水墨留白（Howl 2026-11-11 選定）。白紙、濃淡墨、一方紅印；少框線、少色塊。 */
:root {
  --paper: #f7f5f0;
  --white: #ffffff;
  --ink: #1a1a1a;
  --muted: #555555;
  --line: #cfcbc2;
  --red: #a3271d;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --kai: "LXGW WenKai TC", "Noto Serif TC", "Kaiti TC", "BiauKai", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 17px; line-height: 1.8;
  min-height: 100dvh; display: flex; flex-direction: column;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px 8px; max-width: 720px; width: 100%; margin: 0 auto;
}
.brand { text-decoration: none; font-family: var(--kai); font-weight: 700; font-size: 21px; letter-spacing: .3em; min-height: 44px; display: inline-flex; align-items: center; }
.top nav { display: flex; gap: 2px; }
.top nav a {
  text-decoration: none; min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center;
  font-size: 14px; letter-spacing: .18em; color: var(--muted); border-bottom: 2px solid transparent;
}
.top nav a.on { color: var(--ink); border-bottom-color: var(--red); }
main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 0 24px 48px; }
.foot { text-align: center; padding: 20px 16px 32px; font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.foot a { display: inline-flex; min-height: 44px; align-items: center; }
.loading, .empty { text-align: center; color: var(--muted); padding: 64px 0; letter-spacing: .3em; }

h1 { font-family: var(--kai); font-size: 28px; line-height: 1.5; margin: 24px 0 8px; font-weight: 700; letter-spacing: .1em; text-wrap: balance; }
h2 { font-size: 13px; margin: 36px 0 12px; font-weight: 400; color: var(--muted); letter-spacing: .5em; }
.lead { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

/* 首頁：遠山、小舟、直排標題 */
.hero {
  position: relative; height: 360px; margin: 0 -24px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 170' preserveAspectRatio='none'%3E%3Cpath d='M0 70 Q60 0 110 46 Q150 -30 210 40 Q250 6 300 50 Q340 24 390 60 L390 170 L0 170Z' fill='%231a1a1a' opacity='.07'/%3E%3Cpath d='M0 110 Q50 46 96 88 Q130 30 180 84 Q230 56 270 100 Q330 66 390 104 L390 170 L0 170Z' fill='%231a1a1a' opacity='.14'/%3E%3Cpath d='M0 142 Q40 104 84 132 Q120 96 170 136 Q240 116 300 146 Q350 132 390 146 L390 170 L0 170Z' fill='%231a1a1a' opacity='.32'/%3E%3C/svg%3E") bottom / 100% 190px no-repeat;
}
.hero::after { /* 小舟 */
  content: ""; position: absolute; left: 54%; bottom: 44px; width: 34px; height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 22'%3E%3Cpath d='M0 16q14 8 34 0l-4 6h-26Z' fill='%231a1a1a'/%3E%3Cpath d='M18 16V0' stroke='%231a1a1a' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat;
}
.hero-title {
  position: absolute; right: 44px; top: 20px; margin: 0; writing-mode: vertical-rl;
  font-size: 46px; line-height: 1.5; letter-spacing: .18em;
}
.hero-title span { display: block; }
.hero .seal { position: absolute; right: 66px; top: 168px; } /* 落在「今日」下方 */
.seal {
  display: inline-block; writing-mode: vertical-rl; background: var(--red); color: var(--paper);
  font-family: var(--kai); font-weight: 700; font-size: 13px; line-height: 1.2; padding: 6px 5px; letter-spacing: .05em;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 52px; padding: 8px 20px; border: 1px solid var(--ink); background: transparent;
  text-decoration: none; font-size: 15px; letter-spacing: .15em; border-radius: 0;
}
.btn.primary { background: var(--ink); color: var(--paper); letter-spacing: .4em; padding-left: 28px; }
.btn.red { border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--red); outline-offset: 3px;
}
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.center { justify-content: center; margin-top: 16px; }
.row .grow { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 0 4px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.chips.center { justify-content: center; margin-top: 14px; }
.chip {
  min-height: 50px; min-width: 44px; padding: 0 12px; border: 0; background: transparent;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; letter-spacing: .1em; border-radius: 0;
}
.chip small { color: var(--muted); margin-left: 6px; font-size: 12px; letter-spacing: 0; }
.chip:hover { color: var(--red); }
.chip.skin[aria-pressed="true"] { color: var(--red); box-shadow: inset 0 -3px 0 var(--red); font-weight: 600; }

/* 詩 */
.card { background: var(--white); border: 1px solid var(--ink); padding: 30px 20px 22px; margin: 20px 0 0; }
.card .kicker { font-size: 13px; color: var(--red); letter-spacing: .35em; margin: 0 0 14px; text-align: center; }
.vert-wrap { overflow-x: auto; padding-bottom: 6px; }
.vert {
  writing-mode: vertical-rl; margin: 0 auto; font-family: var(--kai); font-size: 28px; line-height: 1.9;
  letter-spacing: .14em; font-weight: 700; max-height: 13em; width: max-content;
}
.vert .cl { display: block; white-space: nowrap; }
.vert .meta { font-family: var(--serif); font-size: 14px; font-weight: 400; color: var(--muted); margin-right: 16px; letter-spacing: .2em; }
.vert .meta b { color: var(--ink); font-weight: 600; }
.vert.small { font-size: 22px; }
.horiz { text-align: center; font-family: var(--kai); font-size: 20px; line-height: 2.1; font-weight: 700; margin: 0; }
.horiz .meta { font-family: var(--serif); font-size: 14px; font-weight: 400; color: var(--muted); margin-bottom: 10px; letter-spacing: .15em; }
.hit { color: var(--red); }
.one { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.one b { color: var(--ink); font-weight: 600; margin-right: 10px; letter-spacing: .2em; }
.src { margin: 14px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.src summary { cursor: pointer; color: var(--ink); }
.src ul { margin: 6px 0; padding-left: 20px; }
.src p { margin: 8px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 0 2px; margin-top: 8px; }
.tags a {
  font-size: 13px; padding: 0 10px; text-decoration: none; color: var(--muted);
  min-height: 44px; display: inline-flex; align-items: center; letter-spacing: .1em;
}
.tags a:hover { color: var(--red); }

/* 圖卡 */
.studio { margin-top: 8px; }
.studio h2 { text-align: center; }
.cardimg { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; border: 1px solid var(--line); background: var(--white); aspect-ratio: 4 / 5; }

/* 名字查詢 */
.namebox { display: flex; margin: 14px 0 8px; border-bottom: 2px solid var(--ink); }
.namebox input {
  flex: 1; min-width: 0; min-height: 54px; padding: 0 4px; font-size: 21px; letter-spacing: .3em;
  border: 0; background: transparent; border-radius: 0;
}
.namebox input:focus-visible { outline: none; }
.namebox:focus-within { border-bottom-color: var(--red); }
.namebox .btn { border: 0; color: var(--red); font-weight: 600; font-size: 18px; min-width: 64px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.results { list-style: none; padding: 0; margin: 16px 0; }
.results li { border-bottom: 1px solid var(--line); }
.results li > a { display: block; padding: 16px 0 4px; text-decoration: none; }
.results .ln { font-family: var(--kai); font-size: 21px; font-weight: 700; letter-spacing: .08em; line-height: 1.6; }
.results .by { font-size: 13px; color: var(--muted); letter-spacing: .08em; padding-bottom: 4px; }
.results .by a, .flower-log .by a, .seasonal .by a { display: inline-block; padding: 12px 2px; }
.notice { border-left: 3px solid var(--red); padding: 6px 14px; font-size: 15px; margin: 14px 0; }

.list { list-style: none; padding: 0; margin: 8px 0; }
.list li { border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.list a.main { flex: 1; min-width: 0; display: block; padding: 14px 0; text-decoration: none; }
.list .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .a { color: var(--muted); font-size: 13px; white-space: nowrap; flex: none; }

.prose { font-size: 15px; }
.prose a { color: var(--red); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink);
  color: var(--paper); padding: 10px 20px; font-size: 14px; z-index: 10; letter-spacing: .1em;
}
@media (min-width: 600px) {
  .hero { height: 420px; }
  .hero-title { font-size: 56px; right: 80px; }
  .hero .seal { right: 108px; top: 204px; }
  .vert { font-size: 32px; }
  .card { padding: 40px 32px 28px; }
}

/* 作者名連結（詩句卡內、清單、結果） */
a.au { text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--muted); }
a.au:hover { color: var(--red); }
.list .a a { display: inline-block; padding: 14px 2px; }
.tags a.fest { color: var(--red); }

/* 今天的應景詩 */
.seasonal { margin: 24px 0 0; padding: 14px 18px; border: 1px solid var(--ink); background: var(--white); }
.seasonal .kicker { margin: 0; font-size: 13px; color: var(--red); letter-spacing: .35em; }
.seasonal .line { display: block; font-family: var(--kai); font-size: 20px; font-weight: 700; line-height: 1.7; text-decoration: none; padding: 6px 0 0; }
.seasonal .by { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: .08em; }
.seasonal .more { display: inline-flex; min-height: 44px; align-items: center; font-size: 14px; color: var(--red); text-decoration: none; letter-spacing: .1em; }

/* 飛花令 */
.chips button.chip { cursor: pointer; }
.chip[aria-current="true"] { color: var(--red); box-shadow: inset 0 -3px 0 var(--red); font-weight: 600; }
.flower-log { list-style: none; padding: 0; margin: 12px 0; }
.flower-log li { display: grid; grid-template-columns: 3em 1fr; column-gap: 8px; padding: 8px 0 0; border-bottom: 1px solid var(--line); }
.flower-log .who { font-size: 13px; color: var(--muted); letter-spacing: .15em; padding-top: 4px; }
.flower-log li.cpu .who { color: var(--red); }
.flower-log .c { font-family: var(--kai); font-size: 21px; font-weight: 700; letter-spacing: .08em; line-height: 1.6; overflow-wrap: anywhere; }
.flower-log .by { grid-column: 2; font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.flower-log .by.warn { color: var(--red); padding-bottom: 8px; }
.flower-log .by a { padding: 10px 2px; }
.flower-in { display: flex; gap: 8px; margin: 14px 0 8px; border-bottom: 2px solid var(--ink); }
.flower-in:focus-within { border-bottom-color: var(--red); }
.flower-in input { flex: 1; min-width: 0; min-height: 54px; padding: 0 4px; font-size: 19px; letter-spacing: .1em; border: 0; background: transparent; border-radius: 0; }
.flower-in input:focus-visible { outline: none; }
.flower-in .btn { border: 0; }
