/* =====================================================================
   v3 — 4 clear steps, one Morandi look, email-style cards, watercolour bg
   ===================================================================== */
body { background-image:
        radial-gradient(circle at 0 0, var(--rose-tint) 0, transparent 38%),
        radial-gradient(circle at 100% 18%, var(--sage-tint) 0, transparent 34%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='%23E2D4C1' opacity='.55'%3E%3Cellipse cx='24' cy='26' rx='5' ry='4.3'/%3E%3Ccircle cx='18.5' cy='19.5' r='2'/%3E%3Ccircle cx='23' cy='16.5' r='2'/%3E%3Ccircle cx='28' cy='17' r='2'/%3E%3Ccircle cx='31' cy='21.5' r='2'/%3E%3C/g%3E%3Ccircle cx='72' cy='70' r='1.6' fill='%23E2D4C1'/%3E%3C/svg%3E"); }
main, .foot { position: relative; z-index: 1; }
.dict { top: 140px; }

/* watercolour 喵财神 behind everything */
.wc-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.wc-bg img { position: absolute; opacity: .2; mix-blend-mode: multiply; transition: opacity .8s; }
.wc-bg .wc1 { right: -60px; bottom: -40px; width: min(520px, 48vw); transform: rotate(-6deg); }
.wc-bg .wc2 { left: -70px; top: 160px; width: min(300px, 30vw); transform: rotate(8deg); opacity: .14; }
.wc-bg img:not([src]) { opacity: 0; }

/* header + numbered steps */
.tabs { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; width: 100%; overflow-x: auto; scrollbar-width: none; padding-top: 8px; }
.tabs::-webkit-scrollbar { display: none; }
.steps, .extras { display: flex; gap: 4px; flex: none; }
.tabs button { flex: none; border: 2px solid var(--line); border-bottom: 0; background: var(--paper-2); color: var(--ink-soft); font: 800 .9rem var(--sans);
    padding: 7px 14px; border-radius: 14px 14px 0 0; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: background .25s, color .25s; }
.tabs button:hover { background: var(--card); color: var(--ink); }
.tabs .steps button i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; background: var(--white); border: 2px solid var(--line); color: var(--ink-soft); }
.tabs button.on { background: var(--rose); color: var(--white); border-color: var(--rose); }
.tabs .steps button.on i { background: var(--white); color: var(--rose); border-color: var(--white); }
.tabs .extras button { font-size: .84rem; padding: 6px 12px; background: transparent; border-color: transparent; }
.tabs .extras button.on { background: var(--sage); border-color: var(--sage); color: var(--white); }
.tabs em { font-style: normal; background: var(--rose); color: var(--white); border-radius: 10px; padding: 0 7px; font-size: .74rem; }
.tabs button.on em { background: var(--white); color: var(--rose); }

/* page heads */
.pagehead { display: flex; align-items: center; gap: 18px; margin: 4px 0 16px; }
.pagehead img { width: 118px; height: auto; flex: none; animation: sway 3.4s ease-in-out infinite; transform-origin: 50% 90%; }
.pagehead h1 { font: 400 1.85rem/1.25 var(--title); letter-spacing: .05em; margin: 0 0 .25em; }
.pagehead h1 span { color: var(--rose); }
.pagehead p { margin: 0; max-width: 680px; color: var(--ink-soft); }
.pagehead .stepno { display: inline-block; font: 800 .78rem var(--sans); letter-spacing: .12em; color: var(--white); background: var(--sage); padding: 1px 12px; border-radius: 999px; margin: 0 0 6px; }

/* who am I (quick pass chips) */
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 2px dashed var(--line); font-size: .86rem; }
.wchip { border: 2px solid var(--line); background: var(--white); border-radius: 999px; padding: 2px 12px; font: 800 .84rem var(--sans); color: var(--ink-soft); cursor: pointer; }
.wchip.on { background: var(--sage); border-color: var(--sage); color: var(--white); }
.tag.good { background: var(--sage-tint); color: var(--sage); }
.job .meta .mailtag { background: var(--rose-tint); color: var(--rose); font-weight: 800; }

/* sticky "next step" bar */
.nextbar { position: sticky; bottom: 12px; z-index: 5; margin-top: 16px; }
.nextin { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: var(--white); border-radius: 999px; padding: 8px 8px 8px 20px; box-shadow: 0 10px 26px rgba(59, 74, 90, .25); flex-wrap: wrap; }
.nextin .btn { box-shadow: none; border-color: var(--white); }
.nextrow { display: flex; justify-content: flex-end; margin: 4px 0 20px; }

/* readiness */
.ready { margin-bottom: 14px; }
.readyin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 10px 14px; }
.readyin.all { background: var(--sage-tint); border-color: var(--sage-soft); }
.readyin b { margin-right: 6px; }
.rchip { border: 2px dashed var(--rose-soft); background: var(--white); border-radius: 999px; padding: 2px 12px; font: 800 .82rem var(--sans); color: var(--rose); cursor: pointer; }
.rchip.ok { border-style: solid; border-color: var(--sage-soft); color: var(--sage); background: var(--sage-tint); }

/* paste box */
.pastebox summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; list-style: none; }
.pastebox summary::-webkit-details-marker { display: none; }
.pastebox summary::after { content: '展开 ▾'; margin-left: auto; font-size: .82rem; color: var(--rose); font-weight: 800; }
.pastebox[open] summary::after { content: '收起 ▴'; }
.pastebox[open] summary { margin-bottom: 12px; }
.tips2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }

/* prep sub tabs */
.segtabs button.on { background: var(--rose); color: var(--white); border-color: var(--rose); }
.sidebox { position: sticky; top: 140px; }
.sidebox .preview { position: static; }
.kitout { margin-top: 8px; }

/* letter: subjects + live email preview */
.lettergrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.subjects { display: grid; gap: 8px; margin: 6px 0 12px; }
.subj { text-align: left; border: 2px solid var(--line); background: var(--white); border-radius: 14px; padding: 9px 14px; cursor: pointer; font: inherit; color: var(--ink); }
.subj b { display: block; font-size: .92rem; }
.subj small { display: block; font-size: .78rem; }
.subj.on { border-color: var(--rose); background: var(--rose-tint); box-shadow: 0 3px 0 var(--rose-soft); }
.mail { background: var(--white); border: 2px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 22px rgba(59, 74, 90, .08); position: relative; }
.mailhead { background: var(--paper-2); padding: 10px 14px; font-size: .84rem; display: grid; gap: 3px; }
.mailhead span { display: inline-block; width: 62px; color: var(--ink-soft); font-weight: 800; font-size: .76rem; }
.subjline b { color: var(--ink); }
.mailbody { padding: 14px 16px; white-space: pre-wrap; font: 500 .9rem/1.6 Arial, 'Nunito', sans-serif; color: #2D3742; max-height: 560px; overflow: auto; word-break: break-word; }
.mailbody a { color: #1A5FB4; }

/* send page */
.timetip { background: var(--card); border: 2px solid var(--line); border-left: 6px solid var(--mustard-soft); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; font-size: .9rem; }
.timetip .muted { display: block; margin-top: 4px; font-size: .82rem; }
.warnline { margin-top: 6px; color: var(--rose); font-weight: 800; }
.openedbar { position: sticky; top: 118px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; background: var(--mustard-tint); border: 2px solid var(--mustard-soft); border-radius: 16px; padding: 10px 14px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(126, 104, 52, .15); }
.openedbar span { flex: 1; min-width: 200px; }
.group { margin-bottom: 22px; }
.grouphead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.grouphead h2 { font-size: 1.25rem; margin: 0; }
.grouphead h2 b { font: 800 .9rem var(--sans); background: var(--rose); color: var(--white); border-radius: 999px; padding: 1px 10px; vertical-align: middle; }
label.inline { display: flex; align-items: center; gap: 6px; margin: 0; }
label.inline select { width: auto; margin: 0; }
.qitem { transition: border-color .3s, background .3s; }
.qitem.isopened { border-color: var(--mustard-soft); background: #FFFBF0; }
.qhead { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.qhead h3 { font: 800 1.02rem/1.35 var(--sans); margin: 0; }
.qhead .co { color: var(--ink-soft); font-size: .86rem; font-weight: 700; }
.badge.small { font-size: .72rem; padding: 0 8px; border-width: 1.5px; vertical-align: 1px; }
.pill { flex: none; font: 800 .78rem var(--sans); border-radius: 999px; padding: 3px 12px; background: var(--paper-2); color: var(--ink-soft); border: 2px solid var(--line); white-space: nowrap; }
.pill.opened { background: var(--mustard-tint); color: var(--mustard); border-color: var(--mustard-soft); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(214, 189, 132, .25); } }
.mailmini { margin-top: 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--white); overflow: hidden; }
.mrow { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 10px; border-bottom: 1.5px solid var(--paper-2); }
.mrow span { width: 58px; flex: none; font-size: .76rem; color: var(--ink-soft); }
.mrow input { border: 0; margin: 0; padding: 5px 2px; background: transparent; border-radius: 0; }
.mrow input:focus { box-shadow: none; }
.mailmini details { padding: 6px 10px; }
.mailmini summary { cursor: pointer; font-weight: 800; color: var(--ink-soft); font-size: .84rem; }
.mailmini textarea { margin-top: 6px; font-size: .85rem; }

/* tracker */
.trow .due { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .84rem; }

/* tips */
.tipgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tipcard { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: 0 4px 0 var(--paper-2); }
.tipcard h3 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; color: var(--rose); }
.tipcard h3 span { width: 36px; height: 36px; border-radius: 50%; background: var(--rose-tint); display: grid; place-items: center; font-size: 1.1rem; }
.tipcard ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: .9rem; }
.tipcard li::marker { color: var(--rose-soft); }

/* game */
.gamecard .score { text-align: center; background: var(--rose-tint); border: 2px solid var(--rose-soft); border-radius: 18px; padding: 4px 18px; position: relative; }
.gamecard .score span { display: block; font-size: .75rem; color: var(--rose); font-weight: 800; }
.gamecard .score b { font: 800 1.6rem/1.1 'Nunito', sans-serif; color: var(--rose); }
.mute { position: absolute; right: -12px; top: -12px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--white); cursor: pointer; font-size: .85rem; }
.gamebox { position: relative; margin-top: 12px; border-radius: 18px; overflow: hidden; border: 3px solid var(--ink); touch-action: none; }
.gamebox canvas { display: block; width: 100%; }
.gamestart { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; background: rgba(247, 239, 228, .82); text-align: center; padding: 16px; }
.gamestart img { width: min(260px, 60%); height: auto; }
.gamestart p { margin: 0; color: var(--ink-soft); font-weight: 700; }

/* paw prints left by clicks */
.prints { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 150; pointer-events: none; }
.print { position: absolute; width: 30px; height: 30px; transform: rotate(var(--r)); animation: stampin .25s ease-out, fadeprint 6s ease-in forwards; opacity: .55; }
.print svg { width: 100%; height: 100%; }
@keyframes stampin { from { transform: rotate(var(--r)) scale(1.6); opacity: 0; } }
@keyframes fadeprint { 0%, 55% { opacity: .55; } 100% { opacity: 0; } }

@media (max-width: 900px) {
    .lettergrid { grid-template-columns: 1fr; }
    .mail, .sidebox { position: static; }
    .wc-bg .wc2 { display: none; }
}
@media (max-width: 760px) {
    /* phones: little extras row on top, the 4 steps as a swipeable row below */
    .tabs { flex-direction: column-reverse; align-items: stretch; gap: 4px; overflow: visible; padding-top: 2px; }
    .extras { justify-content: flex-end; }
    .tabs .extras button { padding: 2px 8px; font-size: .8rem; border-radius: 999px; }
    .steps { overflow-x: auto; scrollbar-width: none; }
    .steps::-webkit-scrollbar { display: none; }
    .pagehead img { width: 84px; }
    .pagehead h1 { font-size: 1.4rem; }
    .tips2 { grid-template-columns: 1fr; }
    .openedbar { top: 150px; }
}
@media (max-width: 560px) {
    .pagehead { gap: 10px; align-items: flex-start; }
    .pagehead img { width: 70px; }
    .pagehead p { font-size: .86rem; }
    .tabs button { padding: 6px 10px; font-size: .84rem; }
    .qhead { flex-direction: column-reverse; gap: 6px; }
    .wc-bg .wc1 { width: 70vw; opacity: .14; }
    .nextin { border-radius: 18px; }
}
