/* 日韓自由行筆記 — 旅行手帳 × 朱印查核
   indigo ink on paper; vermilion is reserved for the "官方查核" seal and nothing else */
:root {
  --paper: #ffffff;
  --desk: #eef1f5;
  --ink: #1e2a44;          /* 藍染 indigo */
  --ink-2: #44506b;
  --muted: #6b748a;
  --line: #d8dee8;
  --line-soft: #e8ecf2;
  --wash: #f2f5fa;         /* indigo wash for answer / table head */
  --seal: #c8322b;         /* 朱肉 vermilion — seal only */
  --jp: #c8322b;           /* country route colours (metro-map style) */
  --kr: #2f56a6;
  --link: #2f4f8f;
  --serif: "Noto Serif TC", "Source Han Serif TC", "PMingLiU", "MingLiU", serif;
  --sans: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.85;
  color: var(--ink); background: var(--paper);
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--kr); outline-offset: 2px; border-radius: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 100; }

/* ---------- header ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; white-space: nowrap;
  font-family: var(--serif); font-weight: 700; font-size: 1.15rem; letter-spacing: .04em; }
.brand img { width: 32px; height: 32px; }
.site-nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { position: relative; color: var(--ink-2); text-decoration: none; font-size: .95rem; padding: 10px 12px; white-space: nowrap; transition: color .15s; }
.site-nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }

/* ---------- breadcrumbs ---------- */
.crumbs { font-size: .86rem; color: var(--muted); margin: 22px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { margin: 0 8px; opacity: .55; }

/* ---------- the seal (the one bold element) ---------- */
.seal {
  --s: 112px;
  flex: none; width: var(--s); height: var(--s); border-radius: 50%;
  display: grid; place-content: center; text-align: center; line-height: 1.25;
  color: var(--seal); border: 3px solid var(--seal); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 5.5px var(--seal);
  transform: rotate(-9deg); font-family: var(--serif); background: #fff;
}
.seal span { font-size: .78rem; font-weight: 700; letter-spacing: .18em; }
.seal b { font-size: .98rem; letter-spacing: .02em; }
.seal small { font-size: .66rem; letter-spacing: .1em; }

/* ---------- home ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 56px 0 44px; border-bottom: 1px solid var(--line); }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: 2.6rem; line-height: 1.35; margin: 0 0 16px; letter-spacing: .02em; max-width: 16em; text-wrap: balance; }
.hero p { margin: 0; max-width: 34em; color: var(--ink-2); font-size: 1.05rem; }
.hero .seal { --s: 150px; animation: stamp .5s .25s cubic-bezier(.3,1.4,.5,1) both; }
.hero > div { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-9deg) scale(1.25); } }

/* destination tiles: the two countries, in real photographs */
.dest { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 32px 0 8px; }
.dest-tile { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; color: var(--ink); text-decoration: none; }
.dest-img { grid-column: 1 / -1; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 4px; background: var(--wash); margin-bottom: 10px; }
.dest-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.dest-tile:hover .dest-img img { transform: scale(1.03); }
.dest-name { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; line-height: 1.3; }
.dest-n { font-family: var(--sans); font-weight: 400; font-size: .88rem; color: var(--muted); margin-left: 10px; }
.dest-cities { grid-column: 1 / -1; color: var(--ink-2); font-size: .92rem; }
.dest-tile:hover .dest-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.photo-credit { font-size: .78rem; color: var(--muted); margin: 40px 0 0; }
.photo-credit a { color: var(--muted); }
.hero .seal b { font-size: 1.2rem; }

.country { padding: 40px 0 8px; scroll-margin-top: 84px; }
.country-h { display: flex; align-items: baseline; gap: 14px; margin: 0 0 6px; }
.country-h h2 { font-family: var(--serif); font-size: 1.9rem; margin: 0; }
.country-h h2 a { color: inherit; text-decoration: none; }
.country-h h2 a:hover { text-decoration: underline; }
.country-h .count { color: var(--muted); font-size: .92rem; }

/* metro-line city index: one line per country, stations = cities */
.line { --c: var(--ink); list-style: none; display: flex; flex-wrap: wrap; gap: 0; padding: 0; margin: 14px 0 10px; position: relative; }
.line.japan { --c: var(--jp); } .line.korea { --c: var(--kr); }
.line li { position: relative; padding: 22px 26px 0 0; }
.line li::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 4px; background: var(--c); }
.line li:last-child::before { right: auto; width: 14px; }
.line li::after { content: ""; position: absolute; left: 0; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--c); }
.line a { color: var(--ink); text-decoration: none; font-weight: 700; }
.line li::after { transition: background .15s; }
.line li:hover::after { background: var(--c); }
.line:has(li:only-child) { display: none; }
.line a:hover { text-decoration: underline; }
.line .n { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: 4px; }

.city-block { margin: 26px 0 0; scroll-margin-top: 84px; }
.city-h { font-family: var(--serif); font-size: 1.2rem; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.city-h::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--c, var(--ink)); flex: none; }
.japan-c { --c: var(--jp); } .korea-c { --c: var(--kr); }
.city-h a { color: inherit; text-decoration: none; }
.city-h a:hover { text-decoration: underline; }

/* ---------- article list (rows, not cards) ---------- */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); }
.card { display: grid; grid-template-columns: 1fr auto; gap: 2px 24px; padding: 16px 12px; margin: 0 -12px; color: var(--ink); text-decoration: none; border-radius: 4px; transition: background .15s; }
.card:hover { background: var(--wash); }
.card:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; }
.card-title { font-weight: 700; font-size: 1.04rem; line-height: 1.6; }
.card-sum { grid-column: 1; color: var(--ink-2); font-size: .92rem; line-height: 1.75; }
.card-meta { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); font-size: .8rem; white-space: nowrap; padding-top: 4px; }
.card-place { color: var(--muted); font-size: .82rem; font-weight: 400; margin-right: 8px; }

/* ---------- article ---------- */
.post { display: grid; grid-template-columns: minmax(0, 720px); gap: 0; margin: 8px 0 40px; }
.post > * { grid-column: 1; min-width: 0; }
.post-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; padding: 18px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.post-header h1 { text-wrap: pretty; font-family: var(--serif); font-size: 2.05rem; line-height: 1.45; margin: 0 0 12px; letter-spacing: .01em; }
.post-meta { font-size: .86rem; color: var(--muted); margin: 0; }
.post-meta a { color: var(--muted); }
.post-header .seal { margin-top: 6px; }

.answer { background: var(--wash); border-left: 4px solid var(--ink); padding: 16px 20px; margin: 0 0 14px; font-size: 1.04rem; line-height: 1.85; }
.answer strong:first-child { display: block; font-family: var(--serif); font-size: .95rem; margin-bottom: 2px; }
.disclosure { font-size: .8rem; color: var(--muted); margin: 0 0 22px; }

.toc { border-top: 3px solid var(--ink); padding: 10px 0 4px; margin: 0 0 28px; font-size: .92rem; }
.toc-h { font-family: var(--serif); font-weight: 700; margin: 0 0 6px; }
.toc ol { margin: 0; padding-left: 1.4em; line-height: 1.9; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }

@media (min-width: 1100px) {
  .post { grid-template-columns: minmax(0, 720px) 250px; column-gap: 64px; }
  .post > .toc { grid-column: 2; grid-row: 1 / span 6; align-self: start; position: sticky; top: 88px; margin-top: 18px; max-height: calc(100vh - 110px); overflow: auto; }
}

.prose h2 { font-family: var(--serif); font-size: 1.5rem; line-height: 1.45; margin: 56px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); scroll-margin-top: 84px; letter-spacing: .01em; text-wrap: balance; }
.prose h3 { text-wrap: balance; }
.prose p, .prose li { text-wrap: pretty; }
.prose h3 { font-size: 1.12rem; margin: 28px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 18px; }
.prose li { margin: 4px 0; }
.prose strong { color: var(--ink); }
.prose blockquote { margin: 18px 0; padding: 4px 16px; border-left: 3px solid var(--line); color: var(--ink-2); font-size: .94rem; }
.prose blockquote p { margin: 0; }
.prose code { background: var(--wash); padding: 1px 6px; border-radius: 4px; font-size: .9em; }

.tldr-box { border: 1px solid var(--line); border-top: 3px solid var(--ink); padding: 14px 20px 6px; margin: 0 0 26px; background: #fff; }
.tldr-box > p:first-child { font-family: var(--serif); margin-bottom: 8px; }
.tldr-box ul { margin-bottom: 10px; }

.table-wrap { overflow-x: auto; margin: 18px 0 24px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; line-height: 1.65; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
th { background: var(--wash); font-weight: 700; white-space: nowrap; color: var(--ink); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }

figure { margin: 22px 0 26px; }
figure img { display: block; width: 100%; border: 1px solid var(--line); background: #fff; }
figcaption { font-size: .84rem; color: var(--muted); margin-top: 8px; }

.faq { border-bottom: 1px solid var(--line); }
.faq:first-of-type { border-top: 1px solid var(--line); }
.faq summary:hover { color: var(--link); }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 32px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "＋"; position: absolute; right: 4px; top: 13px; color: var(--ink-2); }
.faq[open] summary::after { content: "－"; }
.faq p { margin: 0 0 16px; color: var(--ink-2); }

.children { margin-top: 44px; }
.children .list { margin-top: 8px; }

.cta-group { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.cta-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; background: var(--ink); color: #fff; font-weight: 700; padding: 10px 22px; border-radius: 6px; text-decoration: none; border: 1.5px solid var(--ink);
  transition: background .15s, border-color .15s, transform .12s cubic-bezier(.2,.7,.2,1); }
.cta-btn::after { content: "→"; font-weight: 400; transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.cta-btn:hover { background: var(--kr); border-color: var(--kr); color: #fff; }
.cta-btn:hover::after { transform: translateX(3px); }
.cta-btn:active { transform: scale(.97); }
.cta-btn.secondary { background: #fff; color: var(--ink); }
.cta-btn.secondary:hover { background: var(--wash); color: var(--ink); border-color: var(--ink); }

.related { max-width: 720px; margin: 0 0 48px; }
.related h2 { font-family: var(--serif); font-size: 1.3rem; margin: 0 0 10px; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #cdd4e2; margin-top: 56px; padding: 40px 0; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.footer-grid a { display: block; color: #cdd4e2; text-decoration: none; margin: 4px 0; }
.footer-grid a:hover { color: #fff; text-decoration: underline; }
.footer-brand { font-family: var(--serif); font-weight: 700; color: #fff; margin: 0 0 6px; font-size: 1.05rem; }
.footer-h { font-weight: 700; color: #fff; margin: 0 0 6px; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .header-inner { flex-wrap: wrap; gap: 0; padding: 8px 18px 0; min-height: 0; }
  .site-nav { margin: 0 -18px; width: calc(100% + 36px); padding: 0 6px; }
  .site-nav a { padding: 12px 12px; }
  .site-nav a::after { bottom: 6px; }
  .hero { position: relative; display: block; padding: 28px 0 24px; }
  .hero h1 { padding-right: 84px; font-size: 1.62rem; word-break: keep-all; }
  .hero .seal { position: absolute; top: 22px; right: 2px; }
  .dest { grid-template-columns: 1fr; gap: 22px; padding-top: 24px; }
  .dest-name { font-size: 1.3rem; }
  .hero .seal { --s: 80px; }
  .hero .seal span { font-size: .58rem; letter-spacing: .1em; }
  .hero .seal b { font-size: .64rem; letter-spacing: 0; }
  .post-header { display: block; position: relative; padding-top: 14px; }
  .post-meta { padding-right: 78px; }
  .post-header .seal { --s: 74px; position: absolute; right: 0; bottom: 12px; margin: 0; }
  .answer { padding: 14px 16px; }
  .post-header .seal span { font-size: .54rem; letter-spacing: .08em; }
  .post-header .seal b { font-size: .6rem; letter-spacing: 0; }
  .post-header h1 { font-size: 1.55rem; padding-right: 0; }
  .country-h h2 { font-size: 1.55rem; }
  .line li { padding-right: 12px; font-size: .92rem; }
  .line .n { margin-left: 2px; }
  .card { grid-template-columns: 1fr; padding: 14px 12px; }
  .prose h2 { margin-top: 44px; padding-top: 16px; }
  .cta-btn { width: 100%; justify-content: center; }
  .card-meta { grid-column: 1; grid-row: auto; padding-top: 2px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media print { .site-header, .site-footer, .toc, .related { display: none; } }
