/* 大人的Small Talk：指南（版型 F，照 Psyche 的 Guides）。白底、六種淡色塊、明體大標題、很多留白。
   六區的顏色寫成 --c-<區>（底）與 --c-<區>-ink（字），深色模式各自換一組，不用 filter 硬調。 */
:root {
  --bg: #fbfaf7; --paper: #ffffff; --ink: #1e1e1e; --ink2: #4a4a48; --ink3: #77756f; --line: #e3e1da; --hover: #f1efe8;
  --c-c: #e5ecf4; --c-c-ink: #2b4a6f; --c-w: #f1e8dc; --c-w-ink: #7a4b1c; --c-m: #e3efe6; --c-m-ink: #2f5d3d;
  --c-g: #ece6f2; --c-g-ink: #5a3f7a; --c-r: #f5e3e3; --c-r-ink: #8a3434; --c-l: #f2efd9; --c-l-ink: #6b5f1c;
  --serif: "Noto Serif TC", "Songti TC", serif; --sans: "Noto Sans TC", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18181b; --paper: #202024; --ink: #ecebe6; --ink2: #c4c2bb; --ink3: #94928b; --line: #34343a; --hover: #26262b;
    --c-c: #1f2a37; --c-c-ink: #a9c4e4; --c-w: #33281c; --c-w-ink: #e3bf94; --c-m: #1d2e23; --c-m-ink: #a4d3b2;
    --c-g: #2a2433; --c-g-ink: #cdb6e6; --c-r: #352022; --c-r-ink: #eeb0b0; --c-l: #2f2c1b; --c-l-ink: #ddd08f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #18181b; --paper: #202024; --ink: #ecebe6; --ink2: #c4c2bb; --ink3: #94928b; --line: #34343a; --hover: #26262b;
  --c-c: #1f2a37; --c-c-ink: #a9c4e4; --c-w: #33281c; --c-w-ink: #e3bf94; --c-m: #1d2e23; --c-m-ink: #a4d3b2;
  --c-g: #2a2433; --c-g-ink: #cdb6e6; --c-r: #352022; --c-r-ink: #eeb0b0; --c-l: #2f2c1b; --c-l-ink: #ddd08f;
  color-scheme: dark;
}
.c-c { --tint: var(--c-c); --tink: var(--c-c-ink); } .c-w { --tint: var(--c-w); --tink: var(--c-w-ink); }
.c-m { --tint: var(--c-m); --tink: var(--c-m-ink); } .c-g { --tint: var(--c-g); --tink: var(--c-g-ink); }
.c-r { --tint: var(--c-r); --tink: var(--c-r-ink); } .c-l { --tint: var(--c-l); --tink: var(--c-l-ink); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.75 var(--sans); }
a { color: inherit; }
#page { max-width: 1180px; margin: 0 auto; padding: 0 40px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- 上緣 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.brand { font: 700 22px/1.2 var(--serif); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 14.5px; }
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: 7px; }
.tgl { font: inherit; font-size: 13px; color: var(--ink2); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.crumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--ink3); padding: 10px 0 0; }
.crumb a { text-decoration: none; } .crumb a:hover { text-decoration: underline; }
.crumb em { font-style: normal; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

/* ---------------------------------------------------------------- 首頁 */
.hd { padding: 34px 0 6px; }
.hd h1 { font: 700 56px/1.05 var(--serif); margin: 0; }
.hd p { margin: 14px 0 0; font-size: 17px; color: var(--ink2); max-width: 640px; }
.secs { display: grid; grid-template-columns: 96px repeat(6, 1fr); gap: 8px; padding: 22px 0 12px; }
.sec { display: flex; flex-direction: column; text-decoration: none; padding: 12px 12px 10px; background: var(--tint, var(--hover)); color: var(--ink);
  border-radius: 2px; outline: 2px solid transparent; outline-offset: 0; transition: outline-color .15s; }
.sec b { font-size: 15.5px; color: var(--tink, var(--ink)); }
.sec .ds { font-size: 12px; line-height: 1.45; color: var(--ink2); margin-top: 3px; }
.sec .ct, .sec.all small { font: 12.5px var(--mono); margin-top: auto; padding-top: 8px; color: var(--ink2); }
.sec.all { font-weight: 700; justify-content: space-between; }
.sec.on { outline-color: var(--ink); }
.sec:hover { outline-color: var(--line); } .sec.on:hover { outline-color: var(--ink); }

.tools { display: grid; gap: 10px; padding: 6px 0 4px; }
html:not(.js) .tools, html:not(.js) [data-more] { display: none; }
.row-t, .row-f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lab { font-size: 12.5px; color: var(--ink3); margin-right: 4px; min-width: 2.5em; }
.chip { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.chip i { font: normal 11.5px var(--mono); color: var(--ink3); margin-left: 6px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); } .chip.on i { color: var(--bg); opacity: .75; }
.chip.sort { margin-left: auto; }
.loose { font-size: 12.5px; color: var(--ink3); margin-left: 6px; }
.q { flex: 1 1 260px; max-width: 360px; margin-left: 10px; }
.q input { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; }
.sum { font-size: 13.5px; color: var(--ink3); margin: 14px 0 0; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 10px 0 6px; }
.card { display: flex; flex-direction: column; min-height: 236px; padding: 22px 22px 18px; background: var(--tint); text-decoration: none; color: var(--ink); transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card .eb, .art .eb, .art .eb-t { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; color: var(--tink); }
.card h3 { font: 700 23px/1.38 var(--serif); margin: 10px 0 8px; }
.card p { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card small { margin-top: auto; padding-top: 14px; font-size: 12.5px; color: var(--ink2); }
.none { grid-column: 1 / -1; padding: 40px 0; color: var(--ink2); font-size: 16px; }
.more { display: block; margin: 22px auto 10px; font: inherit; color: var(--ink); background: none; border: 1px solid var(--ink); padding: 10px 26px; cursor: pointer; }

.dir { margin: 44px 0 0; border-top: 1px solid var(--line); padding-top: 16px; }
.dir summary { cursor: pointer; font: 700 20px/1.4 var(--serif); }
.dir summary small { font: 400 13px var(--sans); color: var(--ink3); margin-left: 8px; }
.dir-cols { columns: 3 300px; column-gap: 28px; padding-top: 12px; }
.dir-sec { break-inside: avoid-column; margin-bottom: 20px; }
.dir-sec h3 { font: 700 16px/1.4 var(--sans); color: var(--tink); margin: 0 0 6px; padding: 4px 8px; background: var(--tint); }
.dir-sec h3 small { font-weight: 400; color: var(--ink3); }
.dir-sec ol, .th ol { list-style: none; margin: 0; padding: 0; }
.dir-sec li a, .th li a { display: flex; gap: 10px; padding: 3px 0; font-size: 14px; line-height: 1.5; text-decoration: none; }
.dir-sec li a:hover, .th li a:hover { text-decoration: underline; }
.dir-sec li span, .th li span { font: 12px/1.9 var(--mono); color: var(--ink3); flex: none; }

/* ---------------------------------------------------------------- 單集頁 */
.art { max-width: 1000px; margin: 0 auto; padding: 34px 0 20px; }
.ebs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.art .eb { display: inline-block; background: var(--tint); padding: 4px 10px; text-decoration: none; }
.art .eb-t { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); color: var(--ink2); text-decoration: none; }
.art h1 { font: 700 46px/1.28 var(--serif); margin: 14px 0 10px; }
.dek { font: 600 20px/1.65 var(--serif); color: var(--ink2); margin: 0; }
.by { font-size: 14px; color: var(--ink3); margin: 18px 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.by .yt { margin-left: 6px; color: var(--ink); font-weight: 500; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; }
.main h2, .side h2 { font: 700 26px/1.3 var(--serif); margin: 0 0 12px; }
.main section { margin-bottom: 40px; }
.main p { font-size: 16.5px; line-height: 1.85; }
.hint { font-size: 13.5px !important; color: var(--ink3); margin: -6px 0 10px; }
.hook { font: 600 21px/1.6 var(--serif); margin: 0 0 10px; padding-left: 16px; border-left: 3px solid var(--ink); }
.hook small { display: block; font: 500 12px/1.6 var(--sans); letter-spacing: .12em; color: var(--ink3); }
.todo { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.todo li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: 18px; scroll-margin-top: 20px; }
.todo li::before { content: counter(s); position: absolute; left: 0; top: 2px; font: 700 22px/1 var(--serif); color: var(--ink3); }
.todo h4 { font-size: 17.5px; margin: 0 0 4px; line-height: 1.5; }
.todo p { margin: 0; font-size: 16px; }
.tlw { overflow-x: auto; }
.tl { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.65; }
.tl td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
.tl td:first-child { width: 64px; } .tl td:nth-child(2) { width: 30%; }
.tc { font: 500 13px var(--mono); text-decoration: none; color: var(--ink); background: var(--hover); padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.tc:hover { background: var(--line); }
.qs { list-style: none; padding: 0; margin: 0; }
.qs li { margin-bottom: 18px; }
.qs blockquote { margin: 0 0 4px; font: 600 18.5px/1.7 var(--serif); }
.terms { margin: 0; } .terms div { padding: 8px 0; border-top: 1px solid var(--line); }
.terms dt { font-weight: 700; font-size: 15px; } .terms dd { margin: 2px 0 0; font-size: 14.5px; color: var(--ink2); }
.ext { padding-left: 20px; margin: 0; } .ext li { margin-bottom: 8px; font-size: 15.5px; }
.side { position: sticky; top: 20px; align-self: start; }
.key { background: var(--tint); padding: 16px 18px; margin-bottom: 28px; }
.key h2, .rel h2 { font-size: 20px; }
.key ol { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.75; }
.key a { text-decoration: none; } .key a:hover { text-decoration: underline; }
.rel a { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); font: 600 15.5px/1.5 var(--serif); text-decoration: none; }
.rel a:hover { color: var(--ink2); }
.rel small, .pn small { display: block; font: 400 12px/1.6 var(--mono); color: var(--ink3); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.pn a { text-decoration: none; font: 600 16px/1.5 var(--serif); }
.pn .next { text-align: right; }

/* ---------------------------------------------------------------- 主題頁 */
.toc { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 0 6px; }
.toc a { background: var(--tint); color: var(--tink); padding: 6px 14px; font-weight: 700; font-size: 14.5px; text-decoration: none; }
.grp { margin-top: 30px; }
.grp > h2 { font: 700 30px/1.3 var(--serif); margin: 0 0 12px; }
.th { background: var(--tint); padding: 22px 24px; margin-bottom: 16px; scroll-margin-top: 16px; }
.th h3 { font: 700 22px/1.4 var(--serif); margin: 0 0 8px; } .th h3 small { font: 400 13px var(--sans); color: var(--ink3); }
.th p { font-size: 15.5px; line-height: 1.85; margin: 0 0 12px; }
.th ol { columns: 2 280px; column-gap: 24px; }
.th li { break-inside: avoid; }
.go { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 500; color: var(--tink); }

/* ---------------------------------------------------------------- 頁尾 */
.foot { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 26px 0 40px; margin-top: 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink3); }
.foot span { flex: 1 1 100%; }

/* ---------------------------------------------------------------- 窄螢幕 */
@media (max-width: 960px) {
  .secs { grid-template-columns: repeat(4, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; gap: 10px; }
  .side { position: static; }
}
@media (max-width: 640px) {
  #page { padding: 0 16px; }
  .top { flex-wrap: wrap; } .nav { gap: 14px; }
  .hd h1 { font-size: 42px; } .hd p { font-size: 16px; }
  .secs { grid-template-columns: repeat(2, 1fr); }
  .sec .ds { display: none; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { min-height: 0; padding: 18px; } .card h3 { font-size: 21px; }
  /* 十八條主題在手機上會佔掉一整個畫面，改成一列橫向捲（捲的是這一列，不是整頁） */
  .row-t { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .row-t > * { flex: none; }
  .q { margin-left: 0; max-width: none; flex-basis: 100%; order: 9; } .chip.sort { margin-left: 0; }
  .art h1 { font-size: 32px; } .dek { font-size: 17.5px; }
  .tl td:nth-child(2) { width: auto; }
  .tl tr { display: grid; grid-template-columns: 64px 1fr; } .tl td:nth-child(3) { grid-column: 2; border-top: 0; padding-top: 0; }
  .pn { grid-template-columns: 1fr; } .pn .next { text-align: left; }
}
