/* 周志盈的覺察筆記 — warm paper style */
:root {
  --paper: #f5efe3;
  --paper-2: #fbf8f1;
  --paper-3: #ece3d2;
  --ink: #3b332b;
  --ink-2: #5e5448;
  --muted: #857867;
  --line: #ddd0bb;
  --amber: #b06f22;
  --amber-soft: #f1dfc2;
  --navy: #33405a;
  --navy-soft: #e3e6ec;
  --radius: 14px;
  --serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 108px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--amber); text-underline-offset: 3px; }
a:hover { color: #8a5416; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.4; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin: .2em 0 .25em; letter-spacing: .02em; }
h2 { font-size: 1.55rem; margin: 0 0 .8em; }
h3 { font-size: 1.22rem; margin: 1.6em 0 .5em; }
h4 { font-size: 1.05rem; margin: 0 0 .3em; }
p { margin: 0 0 1em; }
.wrap { width: min(920px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.lead { font-size: 1.12rem; color: var(--ink-2); }
.eyebrow { font-size: .82rem; letter-spacing: .12em; color: var(--amber); font-weight: 600; }
.sr-only, .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper-2); padding: 6px 12px; z-index: 50; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

/* Header & footer */
.site-header { background: rgba(245, 239, 227, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.12rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #f4c77d, var(--amber) 70%); box-shadow: 0 0 0 4px var(--amber-soft); }
.top-nav { display: flex; gap: 6px; }
.top-nav a { color: var(--ink-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .95rem; }
.top-nav a:hover, .top-nav a[aria-current] { background: var(--paper-3); color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 40px; font-size: .9rem; color: var(--ink-2); }
.site-footer p { margin: .3em 0; }

/* Home */
.hero { padding: 64px 0 40px; background: radial-gradient(ellipse at 85% 0%, #f8dfb4 0%, transparent 55%), radial-gradient(ellipse at 0% 100%, #dfe3ea 0%, transparent 50%); }
.hero .lead { max-width: 36em; }
.hero-search, .search-form { display: flex; gap: 8px; margin-top: 22px; max-width: 560px; }
input, textarea { font: inherit; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; width: 100%; }
input:focus, textarea:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px var(--amber-soft); }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 20px; background: var(--navy); color: #fff; white-space: nowrap; }
button:hover { background: #26304a; }
.topic { margin-top: 40px; }
.topic-head { border-left: 4px solid var(--amber); padding-left: 16px; margin-bottom: 24px; }
.topic-head h2 { margin: 0 0 .2em; }
.topic-head p { color: var(--ink-2); margin: 0; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.video-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.video-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(80, 60, 30, .12); color: inherit; }
.video-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.video-card-body { padding: 14px 18px 18px; }
.video-card h3 { margin: .2em 0 .3em; }
.video-card p { font-size: .95rem; color: var(--ink-2); margin: 0; }

/* Video page */
.video-head { padding-top: 36px; }
.crumbs { font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.tags { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { display: inline-block; font-size: .85rem; padding: 3px 12px; border-radius: 999px; background: var(--amber-soft); color: #7a4c14; text-decoration: none; }
.tags a:hover { background: #e9cfa5; }
.section-nav { position: sticky; top: 60px; z-index: 15; background: rgba(245, 239, 227, .95); border-bottom: 1px solid var(--line); margin-top: 26px; }
.section-nav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.section-nav a { flex: none; padding: 10px 12px; font-size: .92rem; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; }
.section-nav a.active { color: var(--ink); border-bottom-color: var(--amber); }
.block { margin-top: 52px; }
.block > h2::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); margin-right: 12px; vertical-align: middle; position: relative; top: -2px; }

.yt { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #1d1d1d; box-shadow: 0 10px 30px rgba(60, 45, 25, .15); }
.yt iframe, .yt-play { width: 100%; height: 100%; border: 0; display: block; }
.yt-play { padding: 0; position: relative; background: #1d1d1d; border-radius: 0; }
.yt-play img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .2s; }
.yt-play:hover img { opacity: 1; }
.yt-icon { position: absolute; inset: 50% auto auto 50%; width: 76px; height: 54px; transform: translate(-50%, -50%); background: rgba(176, 111, 34, .95); border-radius: 14px; }
.yt-icon::after { content: ""; position: absolute; left: 31px; top: 16px; border-style: solid; border-width: 11px 0 11px 19px; border-color: transparent transparent transparent #fff; }
.yt + p { margin-top: 10px; }

.infographic { margin: 0; }
.infographic img { border-radius: var(--radius); border: 1px solid var(--line); }
.infographic figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; text-align: right; }

/* Mind map */
.mindmap { margin-top: 28px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 24px; }
.mindmap-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mindmap-head h3 { margin: 0; }
.mm-buttons { display: flex; gap: 6px; }
.mm-buttons button { background: var(--paper-3); color: var(--ink-2); padding: 5px 12px; font-size: .85rem; }
.mm-buttons button:hover { background: var(--line); }
.mm-root { display: inline-block; background: #c9cdf3; color: #252a55; font-family: var(--serif); font-weight: 700; padding: 8px 18px; border-radius: 10px; font-size: 1.08rem; }
.mm-tree, .mm-tree ul { list-style: none; margin: 0; padding-left: 26px; position: relative; }
.mm-tree { padding-left: 18px; margin-top: 2px; }
.mm-tree li { position: relative; padding: 6px 0 0 22px; }
.mm-tree li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid #b9bff0; }
.mm-tree li:last-child::before { bottom: auto; height: 24px; }
.mm-tree li::after { content: ""; position: absolute; left: 0; top: 24px; width: 18px; border-top: 2px solid #b9bff0; }
.mm-tree summary, .mm-leaf { display: inline-block; padding: 4px 14px; border-radius: 9px; line-height: 1.6; }
.mm-tree summary { cursor: pointer; list-style: none; background: #c5daef; color: #1f3550; font-weight: 600; }
.mm-tree summary::-webkit-details-marker { display: none; }
.mm-tree summary::after { content: "›"; display: inline-block; margin-left: 10px; transition: transform .2s; color: #4a6585; }
.mm-tree details[open] > summary::after { transform: rotate(90deg); }
.mm-tree ul ul summary { background: #bfe3d8; color: #1c4a3e; }
.mm-tree ul ul summary::after { color: #3d7466; }
.mm-leaf { background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); font-size: .95rem; }

/* Notes */
.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 8px; }
.hl { background: var(--paper-2); border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; }
.hl span { font-size: .8rem; color: var(--navy); font-weight: 600; }
.hl b { font-family: var(--serif); font-size: 1.1rem; margin: 2px 0; }
.hl small { color: var(--muted); font-size: .82rem; }
.note h3 { border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.note ul, .note ol { padding-left: 1.3em; }
.pill-list li, .steps li { margin-bottom: .5em; }
.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 30px; height: 30px; border-radius: 50%; background: var(--amber-soft); color: #7a4c14; font-weight: 700; text-align: center; line-height: 30px; font-size: .95rem; }
blockquote { margin: 1.3em 0; padding: 16px 22px; background: var(--paper-2); border-left: 4px solid var(--amber); border-radius: 0 10px 10px 0; font-family: var(--serif); font-size: 1.08rem; color: var(--ink); }
.layers { display: grid; gap: 12px; margin: 1em 0; }
.layer { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.layer:nth-child(1) { border-left: 5px solid #8d96b8; }
.layer:nth-child(2) { border-left: 5px solid #6f7899; }
.layer:nth-child(3) { border-left: 5px solid #4b5475; }
.layer h4 small { font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: .85rem; margin-left: 8px; }
.layer p { margin: 0; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 1.2em 0; }
.compare > div { border-radius: 12px; padding: 14px 18px; background: var(--navy-soft); }
.compare > div.bright { background: linear-gradient(160deg, #fbecd3, #f6e3c4); }
.compare h4 { margin-bottom: .5em; }
.compare p { margin: 0 0 .45em; font-size: .96rem; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1em 0; background: var(--paper-2); border-radius: 10px; overflow: hidden; }
.table th { background: var(--navy); color: #fff; text-align: left; font-weight: 600; padding: 10px 12px; }
.table td { border-top: 1px solid var(--line); padding: 10px 12px; vertical-align: top; }

/* Slides carousel */
.carousel { position: relative; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper-2); }
.car-track::-webkit-scrollbar { display: none; }
.car-slide { flex: 0 0 100%; scroll-snap-align: center; margin: 0; }
.car-slide img { width: 100%; aspect-ratio: 1376 / 768; object-fit: contain; }
.car-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 12px; }
.car-controls button { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 1.6rem; line-height: 1; background: var(--paper-3); color: var(--ink); }
.car-controls button:hover:not(:disabled) { background: var(--line); }
.car-controls button:disabled { opacity: .35; cursor: default; }
.car-count { min-width: 70px; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Practice */
.quote { text-align: center; font-size: 1.3rem; border: 0; background: linear-gradient(135deg, #2f3a55, #3e4b6c); color: #f6dfb6; border-radius: var(--radius); padding: 30px 24px; }
.practice { padding-left: 1.3em; }
.practice li { margin-bottom: 20px; }
.practice label { display: block; font-weight: 600; margin-bottom: 6px; }
.saved { min-height: 1.5em; }

/* Comments */
.comment-form { display: grid; gap: 6px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.comment-form label { font-weight: 600; font-size: .92rem; margin-top: 6px; }
.comment-form .cf-turnstile { margin-top: 10px; min-height: 65px; }
.comment-form button { justify-self: start; margin-top: 6px; }
.form-msg { margin: 0; font-size: .92rem; min-height: 1.4em; }
.form-msg.err { color: #a33b2b; }
.comment-list { list-style: none; padding: 0; margin: 22px 0 0; }
.comment-list li { border-bottom: 1px solid var(--line); padding: 14px 4px; }
.comment-list .c-meta { font-size: .85rem; color: var(--muted); }
.comment-list .c-name { font-weight: 700; color: var(--ink); margin-right: 10px; }
.comment-list .c-body { margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }
.comment-list .empty { color: var(--muted); border: 0; }

/* Pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 60px; }
.pager a { display: block; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 700; }
.pager a:hover { border-color: var(--amber); }
.pager small { display: block; font-family: var(--sans); font-weight: 400; color: var(--muted); font-size: .82rem; }
.pager .next { text-align: right; grid-column: 2; }

/* Search */
.search-page { margin-top: 40px; }
.search-results { list-style: none; padding: 0; margin: 20px 0; }
.search-results li { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; }
.search-results h3 { margin: 0 0 .2em; }
.search-results h3 a { color: var(--ink); text-decoration: none; }
.search-results h3 a:hover { color: var(--amber); }
.search-results .r-topic { font-size: .82rem; color: var(--amber); }
.search-results p { margin: .3em 0 0; font-size: .95rem; color: var(--ink-2); }
mark { background: #f6d79c; color: inherit; padding: 0 2px; border-radius: 3px; }
.tag-cloud { margin-top: 40px; }
.tag-cloud h2 { font-size: 1.2rem; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .compare, .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: auto; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { border-top: 1px solid var(--line); padding: 8px 0; }
  .table td { border: 0; padding: 3px 12px; }
  .table td:first-child { font-weight: 700; font-family: var(--serif); }
  .table td[data-label]::before { content: attr(data-label) "："; color: var(--navy); font-size: .82rem; font-weight: 600; }
  .mm-tree, .mm-tree ul { padding-left: 10px; }
  .mm-tree li { padding-left: 16px; }
  .mm-tree li::after { width: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
