/* 小鎮海線書頁（Coastline）· Hexo theme
   Neutral Gallery Off-White Paper × Muted Sage Pine × Warm Amber Highlight.
   Zero pure #FFFFFF, zero pure #000000, zero blurred drop shadows, zero almanac motifs. */

:root,
[data-theme="morning"] {
  --bg-desk: #EFEFED;
  --bg-paper: #F8F8F6;
  --bg-inset: #F1F1EE;
  --border: #DFDFDB;
  --border-strong: #C9CCC8;
  --stack: #E3E3DF;

  --ink: #2C302E;
  --ink-strong: #1F2422;
  --body: #444946;
  --muted: #707572;

  --accent: #3B5F56;
  --accent-deep: #2B4841;
  --accent-soft: #E7EFEA;
  --accent-border: #B9CEC5;
  --selection-bg: #D5E4DC;

  --slate: #596568;
  --slate-soft: #EAECEB;

  /* Dedicated restrained highlight system (<2% visual weight) */
  --hl-ink: #9A673D;
  --hl-bg: #F3ECE3;
  --hl-border: #E2D1BE;
  --hl-glow: #C49A6C;

  /* Panorama Ligne Claire SVG tokens */
  --sky-plate: #EBF0ED;
  --sky-dusk-opacity: 0;
  --sky-dusk-color: #EBDCCF;
  --sky-hill-fill: #E1EAE5;
  --sky-hill-stroke: #C4D2CB;
  --sky-wash: #DCE7E1;
  --sky-profile: #3B5F56;
  --sky-detail: #6E8D83;
  --sky-star-opacity: 0;
  --sky-glow-halo-opacity: 0.16;
  --sky-glow-dot-opacity: 0.85;

  /* Light-paper mineral-ink syntax highlighting */
  --code-bg: #F1F1EE;
  --code-gutter: #989E9A;
  --syn-comment: #7A807C;
  --syn-keyword: #3E556B;
  --syn-string: #3B5F56;
  --syn-number: #8B5A42;
  --syn-title: #6A4B63;
  --syn-attr: #7E6139;
  --syn-meta: #596568;

  --serif: 'Noto Serif TC', 'Newsreader', Georgia, 'Songti TC', serif;
  --sans: 'Noto Sans TC', 'IBM Plex Sans', system-ui, -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, 'SFMono-Regular', Menlo, monospace;

  --radius: 3px;
  --maxw: 1100px;
}

/* 黃昏（海線暮色微霞）：紙面仍維持乾淨低眩光，天空帶微染蚵子寮夕陽餘暉 */
[data-theme="dusk"] {
  --bg-desk: #EAE8E4;
  --bg-paper: #F6F4F0;
  --bg-inset: #EEEDE8;
  --border: #DAD7D0;
  --border-strong: #C3BEB5;
  --stack: #DFDDD6;

  --ink: #2D2F2D;
  --ink-strong: #202321;
  --body: #464845;
  --muted: #72726C;

  --accent: #395B53;
  --accent-deep: #28433D;
  --accent-soft: #E5ECE7;
  --accent-border: #B5C8BF;
  --selection-bg: #D4E2DA;

  --hl-ink: #9A6338;
  --hl-bg: #F2E8DC;
  --hl-border: #DFCBB5;
  --hl-glow: #C99860;

  --sky-plate: #E9EAE5;
  --sky-dusk-opacity: 0.55;
  --sky-dusk-color: #EFE2D2;
  --sky-hill-fill: #DDDCD6;
  --sky-hill-stroke: #C2BFB6;
  --sky-wash: #D8E0DA;
  --sky-profile: #36564E;
  --sky-detail: #688178;
  --sky-star-opacity: 0.25;
  --sky-glow-halo-opacity: 0.34;
  --sky-glow-dot-opacity: 1;
}

/* 夜燈（低對比深松炭灰）：零純黑、零刺眼純白、小鎮點亮暖光 */
[data-theme="night"] {
  --bg-desk: #181C1B;
  --bg-paper: #202523;
  --bg-inset: #272D2B;
  --border: #333B38;
  --border-strong: #46524E;
  --stack: #131716;

  --ink: #DCE1DD;
  --ink-strong: #EDF2EE;
  --body: #BFC7C2;
  --muted: #8A948E;

  --accent: #7FA99C;
  --accent-deep: #9FC3B8;
  --accent-soft: #263530;
  --accent-border: #3A524A;
  --selection-bg: #324A42;

  --slate: #9DA9AC;
  --slate-soft: #2A3132;

  --hl-ink: #DDA975;
  --hl-bg: #312820;
  --hl-border: #4E3E30;
  --hl-glow: #E4B882;

  --sky-plate: #1B2220;
  --sky-dusk-opacity: 0;
  --sky-hill-fill: #202A27;
  --sky-hill-stroke: #32413C;
  --sky-wash: #25322E;
  --sky-profile: #7FA99C;
  --sky-detail: #547268;
  --sky-star-opacity: 0.65;
  --sky-glow-halo-opacity: 0.42;
  --sky-glow-dot-opacity: 1;

  --code-bg: #1B201E;
  --code-gutter: #616B66;
  --syn-comment: #7B8781;
  --syn-keyword: #8FB1CC;
  --syn-string: #88B8A6;
  --syn-number: #D4A17A;
  --syn-title: #C39DBB;
  --syn-attr: #CCB184;
  --syn-meta: #9DA9AC;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--bg-desk);
  color: var(--body);
  font: 400 16px/1.88 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .2s ease, color .2s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--selection-bg); color: var(--ink-strong); }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--accent);
  color: var(--bg-paper);
  padding: 6px 12px;
  border-radius: var(--radius);
  z-index: 20;
}
.skip:focus { left: 10px; }

/* ---------- Top Header Bar ---------- */
.site-header {
  background: var(--bg-paper);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: var(--ink);
}
.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--accent);
}
.brand-title {
  font: 700 18px/1.2 var(--serif);
  letter-spacing: .02em;
}
.brand-en {
  font: 500 12.5px/1 var(--mono);
  color: var(--muted);
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}
.site-nav a {
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.on {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

.header-mood {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  border-radius: var(--radius);
}
.header-mood .mood-btn {
  padding: 3px 8px;
  font-size: 12px;
}

/* ---------- Main Container ---------- */
.shell {
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 0;
  flex: 1;
}

/* ---------- Top Kaohsiung Coastal Panorama Strip ---------- */
.panorama-plate {
  position: relative;
  background: var(--sky-plate);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 var(--stack);
  overflow: hidden;
  margin-bottom: 24px;
}
.panorama-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 9px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 2;
  pointer-events: none;
}
.panorama-loc {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
}
.mood-switch {
  pointer-events: auto;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.mood-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.2;
  padding: 4px 8px;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color .15s, color .15s;
}
.mood-btn:hover { color: var(--ink); }
.mood-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg-paper);
  font-weight: 600;
}
.mood-btn[aria-pressed="true"] .mood-ico { color: var(--hl-glow); }

.panorama-svg {
  display: block;
  width: 100%;
  height: 122px;
}
.sky-dusk-band {
  fill: var(--sky-dusk-color);
  opacity: var(--sky-dusk-opacity);
  transition: opacity .25s ease;
}
.sky-hill-fill { fill: var(--sky-hill-fill); }
.sky-hill-line {
  fill: none;
  stroke: var(--sky-hill-stroke);
  stroke-width: 0.9;
}
.sky-stars {
  fill: var(--hl-glow);
  opacity: var(--sky-star-opacity);
  transition: opacity .25s ease;
}
.sky-wash { fill: var(--sky-wash); }
.sky-profile {
  fill: none;
  stroke: var(--sky-profile);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sky-detail {
  fill: none;
  stroke: var(--sky-detail);
  stroke-width: 0.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sky-glow-halo {
  fill: var(--hl-glow);
  opacity: var(--sky-glow-halo-opacity);
}
.sky-glow-dot {
  fill: var(--hl-glow);
  opacity: var(--sky-glow-dot-opacity);
}

/* ---------- Two-Column Editorial Grid ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 26px;
  align-items: start;
}
.col-main { min-width: 0; }
.col-main.wide { max-width: 820px; margin: 0 auto; }
.col-side {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-self: stretch;
  align-content: start;
}

/* ---------- Paper Sheet Surface ---------- */
.sheet {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 var(--stack);
}

/* ---------- Featured 2D Ticket-Stub Lead Card ---------- */
.ticket-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  margin-bottom: 20px;
  overflow: hidden;
}
.ticket-stub {
  position: relative;
  background: var(--accent-soft);
  border-right: 1px dashed var(--accent-border);
  padding: 22px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: var(--accent-deep);
}
/* Crisp flat 2D semicircular ticket punch notches */
.ticket-stub::before,
.ticket-stub::after {
  content: "";
  position: absolute;
  right: -7px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg-desk);
  border: 1px solid var(--border);
  z-index: 2;
}
.ticket-stub::before { top: -7px; }
.ticket-stub::after { bottom: -7px; }

.ticket-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}
.ticket-cat {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.ticket-min {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 6px;
  border: 1px solid var(--accent-border);
  border-radius: 2px;
  background: var(--bg-paper);
}
.ticket-date {
  font-size: 11px;
  color: var(--muted);
}

.ticket-body {
  padding: 24px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 20px;
  align-items: center;
}
.ticket-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.hl-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--hl-ink);
  background: var(--hl-bg);
  border: 1px solid var(--hl-border);
  border-radius: 2px;
}
.ticket-title {
  margin: 0 0 10px;
  font: 700 23px/1.45 var(--serif);
  color: var(--ink);
}
.ticket-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}
.ticket-excerpt {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--body);
}
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1px;
}
.read-more:hover { color: var(--accent-deep); border-bottom-color: var(--accent-deep); }

.ticket-spot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  aspect-ratio: 4 / 3;
}
.ticket-spot svg { width: 100%; height: 100%; }

/* ---------- Recent Articles List Sheet ---------- */
.list-sheet { padding: 20px 26px 24px; }
.list-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.list-head h2 {
  margin: 0;
  font: 700 16px/1.3 var(--serif);
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.list-head h2 small {
  font: 500 12px var(--mono);
  color: var(--muted);
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-btn {
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--muted);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .15s;
}
.filter-btn:hover { color: var(--ink); border-color: var(--border-strong); }
.filter-btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-paper);
  font-weight: 600;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
  transition: background-color .12s;
}
.post-row:last-child { border-bottom: 0; }
.post-row[hidden] { display: none; }

.cat-tile {
  width: 36px;
  height: 36px;
  margin-top: 2px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}
.cat-tile.kind-finance {
  background: var(--slate-soft);
  border-color: var(--border-strong);
  color: var(--slate);
}
.cat-tile.kind-software,
.cat-tile.kind-thesis,
.cat-tile.kind-life {
  background: var(--bg-inset);
  border-color: var(--border);
  color: var(--muted);
}
.cat-tile svg { width: 18px; height: 18px; }

.post-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.cat-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.cat-badge.kind-finance {
  background: var(--slate-soft);
  color: var(--slate);
}
.post-row-title {
  margin: 0 0 5px;
  font: 700 17px/1.45 var(--serif);
  color: var(--ink);
}
.post-row-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
.post-row-excerpt {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.filter-empty {
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Pagination ---------- */
.pager {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--muted);
}
.pager a {
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1px;
}
.pager a:hover { color: var(--accent-deep); }

/* ---------- Right Sidebar Cards ---------- */
.side-card {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 var(--stack);
  padding: 18px 20px;
}
.side-card.accent-top { border-top: 2px solid var(--accent); }
.side-head {
  margin: 0 0 12px;
  font: 700 14px/1.3 var(--serif);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.side-head small {
  font: 500 11.5px var(--mono);
  color: var(--muted);
}

.author-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.author-seal {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
  font: 700 18px/1 var(--serif);
  flex-shrink: 0;
}
.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.author-name {
  font: 700 15px/1.3 var(--serif);
  color: var(--ink);
}
.author-en {
  font: 500 11.5px/1.3 var(--mono);
  color: var(--muted);
}
.author-bio {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--body);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.search-box input {
  border: 0;
  background: transparent;
  width: 100%;
  font-size: 13.5px;
  outline: none;
  color: var(--ink);
}
.search-box input::placeholder { color: var(--muted); }

.cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cat-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--border);
  transition: color .15s;
}
.cat-list li:last-child a { border-bottom: 0; }
.cat-list a:hover { color: var(--accent); }
.cat-list a.on { color: var(--accent); font-weight: 700; }
.cat-list .num {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-inset);
  padding: 1px 7px;
  border-radius: 2px;
}

/* Vertical 2D Year Station Route */
.station-rail {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 18px;
  position: relative;
}
.station-rail::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--accent-border);
}
.station-rail li { position: relative; }
.station-rail a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 6px 6px 8px;
  border-radius: 2px;
  font-size: 13.5px;
  transition: background-color .15s, color .15s;
}
.station-rail a::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-paper);
  border: 2px solid var(--accent);
}
.station-rail li:first-child a::before,
.station-rail a.on::before {
  background: var(--accent);
}
.station-rail a:hover {
  background: var(--bg-inset);
  color: var(--accent);
}
.station-rail a.on { color: var(--accent); font-weight: 700; }
.station-count { font-size: 12px; color: var(--muted); }

/* ---------- Post Detail Page ---------- */
.post-sheet {
  padding: 36px 44px 40px;
}
.post-head {
  padding-bottom: 22px;
  margin-bottom: 28px;
  border-bottom: 1px dashed var(--border);
}
.post-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
}
.post-crumb a:hover { color: var(--accent); }
.post-head h1 {
  margin: 0 0 14px;
  font: 700 30px/1.42 var(--serif);
  color: var(--ink);
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.post-tags a {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 2px;
}
.post-tags a:hover { color: var(--accent); border-color: var(--accent-border); }

/* Mobile collapsible TOC */
.mobile-toc {
  display: none;
  margin-bottom: 24px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.mobile-toc summary {
  cursor: pointer;
  font: 700 13.5px var(--serif);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
.mobile-toc summary::-webkit-details-marker { display: none; }
.mobile-toc ol { margin-top: 10px; }

/* Long-form Article Typography */
.art {
  font: 400 16.5px/1.95 var(--sans);
  color: var(--body);
  max-width: 68ch;
  overflow-wrap: break-word;
}
.art > :first-child { margin-top: 0; }
.art p, .art ul, .art ol, .art blockquote, .art table, .art figure, .art pre { margin: 0 0 18px; }
.art a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-color: var(--accent-border);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}
.art a:visited { color: var(--slate); text-decoration-color: var(--border-strong); }
.art a:hover { color: var(--accent); text-decoration-color: var(--accent); }
/* Level 1 emphasis: crisp deeper ink without adding background clutter */
.art strong { font-weight: 700; color: var(--ink-strong); }
.art em { color: var(--ink); }
.art del { color: var(--muted); text-decoration-color: var(--border-strong); }
/* Level 2 explicit highlight: warm amber highlighter span (<mark>) */
.art mark {
  background: var(--hl-bg);
  color: var(--ink-strong);
  padding: 1px 4px;
  border-bottom: 1.5px solid var(--hl-ink);
  border-radius: 2px;
}
.art h2 {
  font: 700 22px/1.48 var(--serif);
  color: var(--ink);
  margin: 38px 0 14px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
.art h3 {
  font: 700 18px/1.5 var(--serif);
  color: var(--ink);
  margin: 26px 0 10px;
}
.art h4 {
  font: 700 16px/1.5 var(--sans);
  color: var(--ink);
  margin: 20px 0 8px;
}
.art h2 a, .art h3 a, .art h4 a { text-decoration: none; color: inherit; }
.art ul, .art ol { padding-left: 1.5em; }
.art li { margin: 5px 0; }
.art li::marker { color: var(--muted); }
.art blockquote {
  background: var(--hl-bg);
  border: 1px solid var(--hl-border);
  border-left: 3.5px solid var(--hl-ink);
  border-radius: var(--radius);
  padding: 13px 18px;
  font-size: 15px;
  color: var(--body);
}
.art blockquote.quote-quiet {
  background: var(--bg-inset);
  border-color: var(--border);
  border-left-color: var(--accent);
}
.art blockquote > :last-child { margin-bottom: 0; }
.art hr {
  border: 0;
  border-top: 1px dashed var(--border);
  margin: 30px 0;
}
.art img {
  display: block;
  margin: 18px auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-inset);
  transition: filter .2s ease;
}
[data-theme="night"] .art img { filter: brightness(0.86) contrast(1.03); }
[data-theme="night"] .art img:hover { filter: brightness(0.96); }
.art figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: -10px;
  margin-bottom: 18px;
}
.art table {
  border-collapse: collapse;
  width: 100%;
  display: block;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.7;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.art th, .art td { padding: 9px 13px; text-align: left; vertical-align: top; font-variant-numeric: tabular-nums; }
.art th {
  background: var(--bg-inset);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.art td { border-top: 1px solid var(--border); }
.art tbody tr:hover td { background: var(--bg-inset); }
.art kbd {
  font: 600 12px var(--mono);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 2px;
  padding: 1px 5px;
  background: var(--bg-inset);
  color: var(--ink);
}

/* Light-paper code blocks (Mineral Inks) */
.art code {
  font: 500 .86em var(--mono);
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--ink);
}
.art pre {
  position: relative;
  font: 400 13.5px/1.72 var(--mono);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
}
.art pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.art figure.highlight {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  overflow-x: auto;
}
.art figure.highlight figcaption {
  font: 600 12px var(--mono);
  padding: 7px 14px;
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
}
.art figure.highlight figcaption a { float: right; }
.art figure.highlight table {
  display: table;
  border: 0;
  background: none;
  margin: 0;
  width: 100%;
  font-size: 13.5px;
  line-height: 1.72;
}
.art figure.highlight td { border: 0; padding: 0; }
.art figure.highlight pre { border: 0; margin: 0; background: none; padding: 14px 16px; }
.art figure.highlight .gutter pre {
  color: var(--code-gutter);
  text-align: right;
  padding-right: 12px;
  border-right: 1px dashed var(--border);
  user-select: none;
}
.art figure.highlight .code { width: 100%; }
.art figure.highlight.has-copy-bar,
.art > pre.has-copy-bar { padding-top: 32px; }
.code-copy {
  position: absolute;
  top: 6px;
  right: 9px;
  border: 1px solid var(--border);
  background: var(--bg-paper);
  color: var(--muted);
  font: 500 11px var(--mono);
  padding: 2px 8px;
  border-radius: 2px;
  cursor: pointer;
  z-index: 2;
  transition: color .15s, border-color .15s;
}
.code-copy:hover { color: var(--accent); border-color: var(--accent-border); }

.art .highlight .comment, .art .highlight .quote { color: var(--syn-comment); font-style: italic; }
.art .highlight .keyword, .art .highlight .selector-tag, .art .highlight .built_in, .art .highlight .type { color: var(--syn-keyword); font-weight: 600; }
.art .highlight .string, .art .highlight .regexp, .art .highlight .addition, .art .highlight .attribute { color: var(--syn-string); }
.art .highlight .number, .art .highlight .literal, .art .highlight .symbol, .art .highlight .bullet { color: var(--syn-number); }
.art .highlight .title, .art .highlight .section, .art .highlight .name, .art .highlight .selector-id, .art .highlight .selector-class { color: var(--syn-title); font-weight: 600; }
.art .highlight .attr, .art .highlight .variable, .art .highlight .template-variable, .art .highlight .params { color: var(--syn-attr); }
.art .highlight .meta, .art .highlight .tag { color: var(--syn-meta); }
.art .highlight .deletion { color: var(--hl-ink); }

/* ---------- Sticky Reading-Time TOC ("本頁行程") ---------- */
.sticky-box {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  position: relative;
}
.toc-list::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--accent-border);
}
.toc-list li { position: relative; }
.toc-list a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 4px 6px 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  border-bottom: 1px dashed var(--border);
  transition: color .15s;
}
.toc-list li:last-child a { border-bottom: 0; }
.toc-list a::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-paper);
  border: 1.5px solid var(--accent-border);
}
.toc-list a:hover { color: var(--ink); }
.toc-list a.on { color: var(--ink); font-weight: 700; }
.toc-list a.on::before { background: var(--accent); border-color: var(--accent); }
.toc-list a.on .toc-time { color: var(--accent); }
.toc-time { font-size: 11.5px; color: var(--muted); }

.read-progress {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.read-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.read-progress-track {
  height: 4px;
  background: var(--accent-soft);
  border-radius: 2px;
  overflow: hidden;
}
.read-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .12s linear;
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.related-list a {
  display: block;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--body);
}
.related-list li:last-child a { border-bottom: 0; }
.related-list a:hover { color: var(--accent); }
.related-date {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 2px;
}

/* ---------- Prev / Next & Comments ---------- */
.around {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}
.around a {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 var(--stack);
  padding: 14px 18px;
  font: 700 14.5px/1.5 var(--serif);
  color: var(--ink);
  transition: border-color .15s;
}
.around a:hover { border-color: var(--accent); color: var(--accent); }
.around a.r { text-align: right; }
.around small {
  display: block;
  font: 500 11.5px var(--sans);
  color: var(--muted);
  margin-bottom: 4px;
}

.comments-sheet {
  margin-top: 20px;
  padding: 22px 26px;
}
.load-comments {
  background: var(--bg-inset);
  border: 1px solid var(--accent-border);
  color: var(--accent-deep);
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.load-comments:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-paper);
}

/* ---------- Archive, Terms, Search Pages ---------- */
.page-banner {
  padding: 24px 28px;
  margin-bottom: 20px;
}
.page-kicker {
  display: block;
  font: 600 11.5px var(--mono);
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.page-banner h1 {
  margin: 0 0 6px;
  font: 700 26px/1.35 var(--serif);
  color: var(--ink);
}
.page-banner p { margin: 0; font-size: 13.5px; color: var(--muted); }

.archive-group-title {
  margin: 22px 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font: 700 15px var(--serif);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.archive-group-title:first-child { margin-top: 0; }
.archive-group-title small { font: 500 12px var(--mono); color: var(--muted); }

.chips-wrap {
  padding: 24px 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.term-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink);
  transition: border-color .15s, color .15s;
}
.term-chip:hover { border-color: var(--accent); color: var(--accent); }
.term-chip b {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--bg-paper);
  padding: 1px 6px;
  border-radius: 2px;
}

.search-page-input {
  margin-top: 14px;
  padding: 9px 12px;
}
.search-page-input input { font-size: 15px; }
.search-status {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.search-hit mark {
  background: var(--hl-bg);
  color: var(--ink);
  border-bottom: 1.5px solid var(--hl-ink);
  padding: 0 2px;
}

/* ---------- Footer Colophon ---------- */
.site-footer {
  max-width: var(--maxw);
  width: 100%;
  margin: 40px auto 0;
  padding: 22px 24px 34px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--muted);
}
.footer-quote {
  margin: 0 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.footer-quote p {
  margin: 0 0 4px;
  font: italic 500 15.5px/1.6 'Newsreader', var(--serif);
  color: var(--body);
  letter-spacing: .01em;
}
.footer-quote cite {
  font: 500 11.5px/1.4 var(--mono);
  font-style: normal;
  letter-spacing: .06em;
  color: var(--hl-ink);
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 20px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.site-footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sticky-box { position: static; max-height: none; }
  .mobile-toc { display: block; }
  .desktop-toc { display: none; }
  .site-header-inner { flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; }
  .site-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; gap: 16px; padding-bottom: 2px; }
  .header-mood { margin-left: auto; }
  .shell { padding: 18px 16px 0; }
  .site-footer { padding: 16px 16px 28px; }
}

@media (max-width: 640px) {
  .brand-en { display: none; }
  .panorama-bar {
    position: static;
    pointer-events: auto;
    padding: 8px 12px;
    border-bottom: 1px dashed var(--border);
    background: var(--bg-paper);
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .panorama-svg { height: 92px; }
  .panorama-loc { font-size: 10.5px; }
  .mood-btn { padding: 3px 7px; font-size: 11px; }

  .ticket-card { grid-template-columns: 1fr; }
  .ticket-stub {
    flex-direction: row;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px dashed var(--accent-border);
    padding: 10px 16px;
  }
  .ticket-stub::before,
  .ticket-stub::after {
    top: auto;
    bottom: -7px;
  }
  .ticket-stub::before { left: -7px; right: auto; }
  .ticket-stub::after { right: -7px; }
  .ticket-icon { display: none; }
  .ticket-body {
    grid-template-columns: 1fr;
    padding: 18px 18px 20px;
  }
  .ticket-spot { display: none; }
  .ticket-title { font-size: 20px; }

  .list-sheet { padding: 16px 16px 20px; }
  .post-sheet { padding: 22px 18px 26px; }
  .post-head h1 { font-size: 23px; }
  .art { font-size: 16px; }
  .around { grid-template-columns: 1fr; }
  .around a.r { text-align: left; }
}

@media print {
  .site-header, .panorama-plate, .col-side, .around, .comments-sheet, .site-footer, .mobile-toc, .code-copy { display: none !important; }
  body, .sheet { background: #F8F8F6; border: 0; box-shadow: none; }
  .shell, .post-sheet { padding: 0; max-width: none; }
}
