/* 543tw.tw 兼職｜下班手帳：紙張、便利貼、拍立得、手寫字 */
:root {
  --paper: #fbf6ec; --paper-2: #f4ead6; --kraft: #e9d8b8; --ink: #3a2e28; --ink-2: #6a5a4f; --line: #e3d5bd;
  --red: #e2583e; --mustard: #f2b33d; --sage: #8fb08a; --sky: #8bb3c9; --navy: #2f3e5c; --pink: #f3b7a8;
  --hand: 'LXGW WenKai TC', 'BiauKai', 'DFKai-SB', '標楷體', serif;
  --round: 'Huninn', 'LXGW WenKai TC', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  font-family: var(--hand); color: var(--ink); line-height: 1.85; font-size: 17px;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(58, 46, 40, .13) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul { list-style: none; }
.sheet { width: min(1120px, 100% - clamp(28px, 6vw, 72px)); margin-inline: auto; }

/* 螢光筆、數字 */
.mk { background: linear-gradient(transparent 58%, rgba(242, 179, 61, .6) 58%, rgba(242, 179, 61, .6) 92%, transparent 92%); padding: 0 .1em; }
.num { font-family: var(--round); color: var(--red); white-space: nowrap; }
.kicker { font-family: var(--round); font-size: .92rem; color: var(--red); letter-spacing: .08em; margin-bottom: 6px; }
.kicker::before { content: '✂ '; color: var(--ink-2); }
h1, h2, h3 { font-weight: 700; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem); line-height: 1.35; }
.pg__lead { color: var(--ink-2); margin: 8px 0 26px; font-size: 1.05rem; }
.fine, .src { color: var(--ink-2); font-size: .9rem; margin-top: 18px; }
.fine a, .src a { color: var(--red); }

/* 按鈕：貼紙感 */
.stick-btn { display: inline-flex; align-items: center; justify-content: center; font-family: var(--round); text-decoration: none; padding: 10px 20px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); box-shadow: 4px 4px 0 var(--ink); transition: transform .15s, box-shadow .15s; white-space: nowrap; }
.stick-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.stick-btn--red { background: var(--red); color: #fff; }
.txt-link { font-family: var(--round); color: var(--navy); text-decoration: underline wavy rgba(226, 88, 62, .6); text-underline-offset: 6px; }

/* 頂部：手帳索引標籤 */
.bar { position: sticky; top: 0; z-index: 30; background: rgba(251, 246, 236, .94); backdrop-filter: blur(6px); border-bottom: 2px dashed var(--line); }
.bar__in { display: flex; align-items: center; gap: 16px; height: 66px; }
.bar__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--round); font-size: 1.15rem; line-height: 1.1; }
.bar__brand img { border-radius: 50%; border: 2px solid var(--ink); }
.bar__brand small { display: block; font-size: .78rem; color: var(--red); }
.tabs { display: flex; gap: 4px; margin-left: auto; align-self: flex-end; }
.tabs a { font-family: var(--round); text-decoration: none; font-size: .95rem; padding: 7px 14px 9px; border-radius: 10px 10px 0 0; border: 2px solid var(--ink); border-bottom: 0; background: var(--paper-2); transform: translateY(2px); }
.tabs a:nth-child(7n+1) { background: #fde2c7; } .tabs a:nth-child(7n+2) { background: #fbe9a8; } .tabs a:nth-child(7n+3) { background: #dce9cf; }
.tabs a:nth-child(7n+4) { background: #d7e6ef; } .tabs a:nth-child(7n+5) { background: #f7d5cd; } .tabs a:nth-child(7n+6) { background: #ffd3c4; } .tabs a:nth-child(7n) { background: #e6ddf0; }
.tabs a.is-active, .tabs a:hover { transform: translateY(-3px); }

/* 開頁 */
.open { padding: clamp(36px, 6vw, 80px) 0 40px; }
.open__in { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.open__date { font-family: var(--round); font-size: .9rem; color: var(--ink-2); border-bottom: 1px solid var(--line); display: inline-block; padding-bottom: 2px; margin-bottom: 16px; }
.open h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); line-height: 1.32; margin-bottom: 20px; }
.open__lead { font-size: 1.12rem; }
.open__aside { margin-top: 14px; color: var(--ink-2); padding: 10px 14px; border-left: 3px solid var(--sage); background: rgba(143, 176, 138, .12); }
.open__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 28px; }

.polaroid { position: relative; background: #fff; padding: 12px 12px 14px; box-shadow: 0 14px 30px rgba(58, 46, 40, .18); }
.polaroid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.polaroid figcaption { font-family: var(--hand); text-align: center; margin-top: 8px; color: var(--ink-2); }
.polaroid--r { transform: rotate(2.5deg); }
.polaroid--l { transform: rotate(-2deg); }
.tape { position: absolute; top: -14px; left: 50%; width: 110px; height: 30px; transform: translateX(-50%) rotate(-4deg); background: rgba(242, 179, 61, .7); }
.tape--g { background: rgba(143, 176, 138, .75); }

.notes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: clamp(32px, 5vw, 56px); }
.note { padding: 18px 18px 22px; box-shadow: 0 8px 16px rgba(58, 46, 40, .12); }
.note b { display: block; font-family: var(--round); font-size: clamp(1.4rem, 1rem + 1.2vw, 1.9rem); line-height: 1.2; }
.note span { color: var(--ink-2); font-size: .95rem; }
.note--y { background: #fde98f; transform: rotate(-1.5deg); }
.note--p { background: #fbd0c4; transform: rotate(1.2deg); }
.note--g { background: #d3e7c6; transform: rotate(-.8deg); }
.note--b { background: #cfe2ee; transform: rotate(1.6deg); }

/* 頁面區塊 */
.pg { padding: clamp(56px, 7vw, 96px) 0; }
.pg--ruled { background: repeating-linear-gradient(#fffdf7, #fffdf7 33px, #e8dcc6 33px, #e8dcc6 34px); border-block: 2px solid var(--line); }
.pg--kraft { background: var(--kraft); background-image: radial-gradient(rgba(58, 46, 40, .08) 1px, transparent 1.4px); background-size: 6px 6px; }
.pg--warn { background: #fff4ee; border-block: 2px dashed #f0b9a8; }
.pg__two { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
.pg__fig img { aspect-ratio: 3 / 2; }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.checks li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; }
.chk { width: 26px; height: 26px; border: 2px solid var(--ink); border-radius: 6px; position: relative; margin-top: 4px; background: #fff; }
.chk::after { content: '✓'; position: absolute; left: 3px; top: -10px; font-size: 1.6rem; color: var(--red); font-family: var(--round); }
.checks h3 { font-size: 1.12rem; }
.checks p { color: var(--ink-2); font-size: .98rem; }

/* 試算：筆記本＋收據 */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.calc__form { background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 24px; box-shadow: 6px 6px 0 var(--mustard); display: grid; gap: 10px; }
.calc__label { font-family: var(--round); font-size: 1rem; }
.seg { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.seg button { font: inherit; font-family: var(--round); font-size: .95rem; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); cursor: pointer; color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.calc__input { display: flex; align-items: center; gap: 10px; }
.calc__input input { flex: 1; min-width: 0; font-family: var(--round); font-size: 1.5rem; padding: 6px 4px; border: 0; border-bottom: 3px solid var(--red); background: transparent; color: var(--ink); }
.calc__input input:focus { outline: none; background: #fff8e6; }
.calc__hint { color: var(--ink-2); font-size: .9rem; }
.calc__result { background: #fffef9; padding: 24px 24px 30px; position: relative; box-shadow: 0 10px 22px rgba(58, 46, 40, .15); border-top: 6px dotted var(--paper); transform: rotate(.6deg);
  -webkit-mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 0 / 18px 100% repeat-x; mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 0 / 18px 100% repeat-x; }
.calc__result .calc__label { color: var(--ink-2); }
.calc__total { font-family: var(--round); font-size: clamp(2.2rem, 1.6rem + 2vw, 3rem); color: var(--red); line-height: 1.2; margin: 4px 0 12px; border-bottom: 2px dashed var(--line); padding-bottom: 10px; }
.calc__rows div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dotted var(--line); }
.calc__rows strong { font-family: var(--round); font-weight: 400; }
.calc__formula { margin-top: 14px; font-size: .9rem; color: var(--ink-2); }

/* 週計畫 */
.planners { display: grid; gap: 20px; }
.pl { background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 20px 22px; display: grid; grid-template-columns: 220px 1fr; gap: 6px 26px; }
.pl header { grid-row: span 2; border-right: 2px dashed var(--line); padding-right: 18px; }
.pl__tag { font-family: var(--round); font-size: .85rem; background: var(--ink); color: #fff; padding: 2px 10px; border-radius: 6px; }
.pl h3 { font-size: 1.3rem; margin-top: 8px; }
.pl header p { color: var(--ink-2); font-size: .95rem; }
.pl__week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; list-style: none; }
.pl__day { display: grid; grid-template-rows: auto 96px; gap: 6px; text-align: center; }
.pl__day b { font-family: var(--round); font-weight: 400; font-size: .95rem; color: var(--ink-2); }
.pl__day > span { border-radius: 8px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; font-family: var(--round); font-size: .85rem; padding: 6px 2px; }
.pl__off { border: 2px dashed var(--line); color: var(--line); justify-content: center !important; }
.pl__blk { background: linear-gradient(to top, var(--c, #fbd0c4) calc(var(--h, 3) / 7 * 100%), #f7f1e5 0); border: 2px solid var(--ink); }
.pl__blk i { font-style: normal; font-size: .75rem; color: var(--ink-2); }
.pl--a { --c: #fbd0c4; } .pl--b { --c: #fde98f; } .pl--c { --c: #d3e7c6; }
.pl__blk--c { background: var(--c); border: 2px solid var(--ink); justify-content: center !important; }
.pl__note { font-size: .95rem; color: var(--ink-2); }

/* 路線 */
.route { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 26px; counter-reset: r; position: relative; }
.route li { position: relative; background: var(--paper); border-radius: 12px; padding: 22px 20px 18px; border: 2px solid var(--ink); }
.route li:not(:nth-child(3n))::after { content: '⇢'; position: absolute; right: -24px; top: 30px; font-size: 1.4rem; color: var(--ink); }
.rt__n { position: absolute; top: -18px; left: 16px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-family: var(--round); border: 2px solid var(--ink); }
.route h3 { font-size: 1.12rem; margin-top: 4px; }
.route p { font-size: .95rem; color: var(--ink-2); }
.files { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 30px; }
.files a { text-decoration: none; background: #fff; border: 2px dashed var(--ink); border-radius: 10px; padding: 12px 18px; font-family: var(--round); }
.files small { display: block; font-family: var(--hand); color: var(--ink-2); }

/* 名詞卡 */
.idx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.idx { background: #fff; border-radius: 6px; padding: 30px 18px 16px; position: relative; box-shadow: 0 6px 14px rgba(58, 46, 40, .1);
  background-image: linear-gradient(var(--red), var(--red)), repeating-linear-gradient(#fff, #fff 29px, #d9e6ef 29px, #d9e6ef 30px); background-size: 100% 3px, 100% 100%; background-repeat: no-repeat; background-position: 0 24px, 0 0; }
.idx::before { content: ''; position: absolute; top: 8px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.idx dt { font-family: var(--round); font-size: 1.12rem; color: var(--navy); }
.idx dd { font-size: .95rem; color: var(--ink-2); line-height: 1.9; }

/* 防詐 */
.sub { font-family: var(--round); font-weight: 400; font-size: 1.15rem; margin: 26px 0 14px; }
.yao { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.yao li { background: #fff; border-radius: 12px; padding: 20px; border: 2px solid var(--ink); text-align: center; }
.stamp { display: inline-grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; border: 3px double var(--red); color: var(--red); font-family: var(--round); font-size: 1.2rem; transform: rotate(-10deg); margin-bottom: 10px; }
.yao p { font-size: .96rem; color: var(--ink-2); text-align: left; }
.bu { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.bu li { background: #fff; border-radius: 12px; padding: 16px; display: grid; gap: 8px; border: 2px solid var(--line); }
.ban { font-family: var(--round); font-size: 1.05rem; display: flex; align-items: center; gap: 8px; color: var(--red); }
.ban::before { content: ''; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--red); background: linear-gradient(45deg, transparent 44%, var(--red) 44%, var(--red) 56%, transparent 56%); flex: none; }
.bu p { font-size: .92rem; color: var(--ink-2); }
.torn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 26px; }
.torn { background: #fffdf5; padding: 22px 22px 28px; box-shadow: 0 8px 18px rgba(58, 46, 40, .12);
  clip-path: polygon(0 0, 100% 0, 100% 96%, 94% 100%, 86% 97%, 77% 100%, 68% 96%, 58% 100%, 48% 97%, 38% 100%, 28% 96%, 18% 100%, 9% 97%, 0 100%); }
.torn--b { background: #eef5fa; }
.torn h3 { font-size: 1.15rem; margin-bottom: 8px; }
.torn li { padding-left: 1.3em; position: relative; font-size: .96rem; margin-bottom: 6px; }
.torn li::before { content: '•'; position: absolute; left: .2em; color: var(--red); }

/* 聊天問答 */
.chat { display: grid; gap: 12px; max-width: 820px; margin-top: 26px; padding: 26px; background: #eae4d6; border-radius: 22px; border: 2px solid var(--ink); }
.msg { display: flex; gap: 10px; align-items: flex-end; }
.msg p { padding: 12px 16px; border-radius: 18px; max-width: 78%; font-size: .98rem; line-height: 1.75; }
.msg--q { justify-content: flex-end; }
.msg--q p { background: #fde98f; border-bottom-right-radius: 4px; font-family: var(--round); }
.msg--a img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; flex: none; }
.msg--a p { background: #fff; border-bottom-left-radius: 4px; }

/* 結尾便條 */
.end__in { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
.end__fig img { aspect-ratio: 5 / 6; }
.memo { position: relative; background: #fde98f; padding: 36px clamp(22px, 4vw, 40px); box-shadow: 0 16px 30px rgba(58, 46, 40, .2); transform: rotate(-1deg); }
.memo__pin { position: absolute; top: -12px; left: 50%; width: 24px; height: 24px; border-radius: 50%; background: var(--red); border: 2px solid var(--ink); transform: translateX(-50%); }
.memo h2 { margin-bottom: 12px; }
.memo__row { display: flex; gap: 20px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.memo__row img { background: #fff; padding: 8px; border: 2px solid var(--ink); }
.memo__row div { display: grid; gap: 12px; justify-items: start; }
.memo__row b { font-family: var(--round); font-weight: 400; font-size: 1.2rem; }

.colophon { border-top: 2px dashed var(--line); padding: 40px 0 90px; font-size: .95rem; }
.colophon__in { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.colophon b { font-family: var(--round); font-weight: 400; font-size: 1.1rem; }
.colophon p { color: var(--ink-2); }
.colophon dl { margin: 8px 0; }
.colophon dl div { display: flex; gap: 12px; }
.colophon dt { color: var(--ink-2); min-width: 4.5em; }
.colophon a { color: var(--red); }
.colophon__links { display: grid; gap: 4px; align-content: start; }
.colophon__copy { grid-column: 1 / -1; font-size: .85rem; }

.fab { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #06c755; color: #fff; text-decoration: none; font-family: var(--round); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-8deg); }

@media (max-width: 1080px) {
  .tabs a { padding: 6px 9px 8px; font-size: .88rem; }
}
@media (max-width: 900px) {
  html { scroll-padding-top: 116px; }
  .bar__in { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 8px 12px; }
  .bar__line { margin-left: auto; padding: 6px 14px; }
  .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; padding-top: 6px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; }
  .open__in, .pg__two, .end__in, .calc, .torn-row, .colophon__in { grid-template-columns: 1fr; }
  .polaroid--r { max-width: 420px; margin-inline: auto; }
  .pg__fig { max-width: 420px; margin-inline: auto; }
  .end__fig { max-width: 320px; margin-inline: auto; order: 2; }
  .notes { grid-template-columns: 1fr 1fr; }
  .checks { grid-template-columns: 1fr; }
  .pl { grid-template-columns: 1fr; }
  .pl header { grid-row: auto; border-right: 0; border-bottom: 2px dashed var(--line); padding: 0 0 12px; }
  .route { grid-template-columns: 1fr 1fr; }
  .route li::after { display: none; }
  .yao { grid-template-columns: 1fr; }
  .yao li { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; text-align: left; }
  .stamp { margin: 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .pl__week { gap: 4px; }
  .pl__day { grid-template-rows: auto 80px; }
  .pl__day > span { font-size: .72rem; }
  .route { grid-template-columns: 1fr; gap: 30px; }
  .chat { padding: 16px 12px; }
  .msg p { max-width: 86%; }
  .bu { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

.calc > *, .calc__form > * { min-width: 0; }
@media (max-width: 1000px) { .calc { grid-template-columns: minmax(0, 1fr) !important; } }
.nw { white-space: nowrap; }
.chatgrid { display: grid; grid-template-columns: minmax(0, 820px) minmax(0, 300px); gap: 40px; align-items: start; margin-top: 26px; }
.chatgrid .chat { margin-top: 0; }
.chatside { position: sticky; top: 96px; display: grid; gap: 22px; padding-top: 8px; }
.chatside__note span { display: block; margin-top: 6px; line-height: 1.7; }
.chatside__btn { display: inline-block; margin-top: 14px; padding: 9px 16px; background: var(--ink); color: #fff; border-radius: 999px; font-family: var(--round); text-decoration: none; font-size: .95rem; }
@media (max-width: 960px) { .chatgrid { grid-template-columns: 1fr; } .chatside { position: static; grid-template-columns: 1fr 1fr; } .chatside .note--b { grid-column: 1 / -1; } }
@media (max-width: 520px) { .chatside { grid-template-columns: 1fr; } }
