:root{
  --bg:#faf8f4; --surface:#fff; --ink:#14213d; --muted:#667085; --line:#e6e2da;
  --accent:#1f4fa3; --accent-soft:#eaf0fb; --ok:#1e7a4f; --ok-soft:#e8f5ee;
  --warn:#b45309; --warn-soft:#fdf2e3;
  --radius:20px; --top:64px; --bottom:0px;
  --shadow:0 1px 2px rgba(20,33,61,.05),0 8px 28px rgba(20,33,61,.06);
  --sans:"Inter","Noto Sans TC",system-ui,-apple-system,"Segoe UI","PingFang TC","Microsoft JhengHei",sans-serif;
  --serif:"Noto Serif TC","Songti TC","PMingLiU",Georgia,serif;
}
*{box-sizing:border-box;margin:0}
[hidden]{display:none!important}
html,body{height:100%}
body{font-family:var(--sans);background:var(--bg);color:var(--ink);line-height:1.6;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:8px}

/* Top bar */
.topbar{position:fixed;inset:0 0 auto 0;height:var(--top);display:flex;align-items:center;justify-content:space-between;
  padding:0 clamp(16px,4vw,40px);background:rgba(250,248,244,.9);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);z-index:20}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:18px;letter-spacing:-.01em}
.brand-mark{width:32px;height:32px;border-radius:10px;background:var(--accent);color:#fff;display:grid;place-items:center;font-family:var(--serif);font-size:18px}
.nav-desktop{display:flex;gap:6px}
.nav-desktop a{padding:8px 16px;border-radius:999px;color:var(--muted);font-weight:500;font-size:15px;transition:.15s}
.nav-desktop a:hover{color:var(--ink);background:#f0ece4}
.nav-desktop a.active{color:var(--accent);background:var(--accent-soft)}
.topbar-right{display:flex;align-items:center;gap:12px;min-width:90px;justify-content:flex-end}
.lang{display:flex;border:1px solid var(--line);border-radius:999px;padding:2px;background:var(--surface)}
.lang button{padding:3px 11px;border-radius:999px;font-size:13px;font-weight:600;color:var(--muted)}
.lang button.on{background:var(--ink);color:#fff}

main{padding-top:var(--top);min-height:100%}
.view{min-height:calc(100vh - var(--top));min-height:calc(100dvh - var(--top))}

/* Ask home */
#view-ask{display:flex;flex-direction:column}
.ask-home{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  padding:32px 20px 80px;max-width:820px;width:100%;margin:0 auto}
.greet-pill{font-size:14px;color:var(--muted);margin-bottom:18px}
.greet-pill b{color:var(--ink);font-weight:600}
.ask-home h1{font-family:var(--serif);font-size:clamp(34px,6vw,56px);line-height:1.2;letter-spacing:-.01em}
.sub{margin:14px 0 32px;font-size:clamp(16px,2.2vw,19px);color:var(--muted)}
#composerSlot{width:100%}
.chips{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:22px}
.chip{padding:9px 16px;border:1px solid var(--line);background:var(--surface);border-radius:999px;font-size:14.5px;transition:.15s;text-align:left}
.chip:hover{border-color:var(--accent);color:var(--accent);transform:translateY(-1px)}
.notice-link{margin-top:30px;display:inline-flex;gap:8px;align-items:center;color:var(--accent);font-weight:600;font-size:15px;padding:8px 14px;border-radius:12px}
.notice-link:hover{background:var(--accent-soft)}

/* Composer */
.composer{display:flex;align-items:flex-end;gap:6px;background:var(--surface);border:1.5px solid var(--line);border-radius:28px;padding:10px 10px 10px 22px;box-shadow:var(--shadow);transition:.15s;width:100%;max-width:760px;margin:0 auto}
.composer:focus-within{border-color:var(--accent);box-shadow:0 0 0 4px rgba(31,79,163,.1),var(--shadow)}
.composer textarea{flex:1;border:0;outline:0;resize:none;font:inherit;font-size:18px;line-height:1.5;padding:10px 0;background:transparent;color:var(--ink);max-height:160px}
.composer textarea::placeholder{color:#98a2b3}
.icon-btn{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:var(--muted);flex:none}
.icon-btn:hover{background:#f0ece4;color:var(--ink)}
.send{width:46px;height:46px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;flex:none;transition:.15s}
.send:hover{background:#173d80}
.send:disabled{background:#cbd2dd;cursor:default}
.ask-home .composer{padding:14px 14px 14px 26px}
.ask-home .composer textarea{font-size:clamp(17px,2.4vw,20px)}

/* Chat */
.chat{flex:1;width:100%;max-width:760px;margin:0 auto;padding:16px 20px 24px}
.chat-head{margin-bottom:8px}
.ghost{color:var(--muted);font-size:14px;padding:6px 10px;border-radius:10px}
.ghost:hover{background:#f0ece4;color:var(--ink)}
.messages{display:flex;flex-direction:column;gap:22px}
.msg-user{align-self:flex-end;background:var(--ink);color:#fff;padding:11px 18px;border-radius:20px 20px 6px 20px;max-width:85%}
.msg-ai{background:var(--surface);border:1px solid var(--line);border-radius:6px 22px 22px 22px;padding:22px;box-shadow:var(--shadow);animation:rise .25s ease}
@keyframes rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.answer{font-size:clamp(18px,2.4vw,21px);font-weight:600;line-height:1.5;letter-spacing:-.005em}
.answer-more{margin-top:8px;color:var(--muted);font-size:15.5px}
.facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-top:16px}
.fact{background:var(--bg);border-radius:14px;padding:11px 14px}
.fact small{display:block;color:var(--muted);font-size:12.5px}
.fact span{font-weight:600;font-size:15.5px}
.steps{margin:14px 0 0;padding-left:22px;font-size:15.5px}
.steps li{margin:4px 0}
.source{margin-top:18px;padding-top:14px;border-top:1px dashed var(--line);font-size:14px;color:var(--muted)}
.source a{color:var(--accent);font-weight:500;text-decoration:underline;text-underline-offset:3px}
.verified{display:inline-flex;gap:6px;align-items:center;margin-top:10px;color:var(--ok);background:var(--ok-soft);font-weight:600;font-size:13.5px;padding:4px 12px;border-radius:999px}
.actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.btn{padding:10px 18px;border-radius:999px;font-weight:600;font-size:14.5px;border:1.5px solid var(--accent);color:var(--accent);transition:.15s;display:inline-block}
.btn:hover{background:var(--accent-soft)}
.btn.primary{background:var(--accent);color:#fff}
.btn.primary:hover{background:#173d80}
.followups{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.followups .chip{font-size:13.5px;padding:6px 13px;background:var(--bg)}
.typing{display:flex;gap:5px;padding:6px 2px}
.typing i{width:8px;height:8px;border-radius:50%;background:#b8c0cf;animation:bl 1s infinite}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes bl{50%{opacity:.3;transform:translateY(-3px)}}
#view-ask.chatting .composer{position:sticky;bottom:calc(var(--bottom) + 14px);margin-bottom:14px;width:calc(100% - 32px)}

/* Pages */
.page{max-width:960px;margin:0 auto;padding:40px 20px 60px}
.page h1{font-family:var(--serif);font-size:clamp(28px,4.5vw,40px);line-height:1.25}
.page .lead{color:var(--muted);margin:6px 0 28px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px 22px}
.card h3{font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600;margin-bottom:12px}
.today{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--accent);color:#fff;border-radius:var(--radius);padding:22px 26px;margin-bottom:18px}
.today small{opacity:.8;font-size:14px}
.today .big{font-size:clamp(26px,4vw,34px);font-weight:700;letter-spacing:-.01em}
.today .date{text-align:right;opacity:.9;font-size:15px}
.list{list-style:none;padding:0}
.list li{display:flex;align-items:center;gap:14px;padding:13px 0;border-top:1px solid var(--line)}
.list li:first-child{border-top:0}
.dot{width:10px;height:10px;border-radius:50%;background:var(--accent);flex:none}
.dot.test{background:var(--warn)}.dot.club{background:var(--ok)}
.list .t{flex:1;font-weight:500}
.when{font-size:13.5px;font-weight:600;padding:3px 11px;border-radius:999px;background:var(--accent-soft);color:var(--accent);white-space:nowrap}
.when.soon{background:var(--warn-soft);color:var(--warn)}
.ask-inline{display:flex;margin-top:18px;gap:10px;align-items:center;color:var(--muted);font-size:14.5px;flex-wrap:wrap}
.ask-inline a{color:var(--accent);font-weight:600}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px 20px;text-align:left;transition:.15s;display:flex;flex-direction:column;gap:6px}
.tile:hover{border-color:var(--accent);transform:translateY(-2px);box-shadow:var(--shadow)}
.tile h4{font-size:16.5px}
.tile p{color:var(--muted);font-size:14px}
.tile .tag{font-size:12.5px;color:var(--accent);font-weight:600}
.section-title{font-size:19px;font-weight:700;margin:32px 0 14px}
.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.tabs button{padding:7px 16px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-size:14.5px;font-weight:500}
.tabs button.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.empty{text-align:center;padding:60px 20px;color:var(--muted)}
.empty .btn{margin-top:16px}
.row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 0;border-top:1px solid var(--line)}
.row:first-of-type{border-top:0}
.row small{color:var(--muted);display:block}
.profile-head{display:flex;align-items:center;gap:18px;margin-bottom:24px}
.avatar{width:68px;height:68px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-size:28px;font-weight:700}
.seg{display:flex;border:1px solid var(--line);border-radius:999px;padding:2px}
.seg button{padding:5px 14px;border-radius:999px;font-size:14px;font-weight:600;color:var(--muted)}
.seg button.on{background:var(--ink);color:#fff}
.switch{width:46px;height:26px;border-radius:999px;background:#cfd5df;position:relative;transition:.2s}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:.2s}
.switch.on{background:var(--accent)}.switch.on::after{left:23px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:18px}

/* Notice sheet */
.sheet-backdrop{position:fixed;inset:0;background:rgba(20,33,61,.4);z-index:40;display:flex;align-items:center;justify-content:center;padding:20px}
.sheet{background:var(--bg);border-radius:24px;width:100%;max-width:640px;max-height:90vh;display:flex;flex-direction:column;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.sheet-head{display:flex;justify-content:space-between;align-items:center;padding:18px 20px 8px 26px}
.sheet-head h2{font-size:20px}
.sheet-body{padding:8px 26px 26px;overflow:auto}
.drop{border:2px dashed #cfc8ba;border-radius:18px;padding:28px 18px;text-align:center;color:var(--muted);background:var(--surface)}
.drop .btn{margin:12px 6px 0}
.doc{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 16px;display:flex;gap:12px;align-items:center;margin-bottom:14px;font-size:14.5px}
.doc b{display:block}
.doc small{color:var(--muted)}
.qa{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.qa .chip{padding:7px 14px;font-size:14px}
.qa .chip.on{background:var(--accent);color:#fff;border-color:var(--accent)}
.result{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:18px 20px}
.result h4{font-size:15px;color:var(--accent);margin-bottom:6px}
.result ol{padding-left:22px;font-size:16px}
.result li{margin:5px 0}
.result li b{color:var(--ink)}

/* Mobile nav */
.nav-mobile{display:none}
@media (max-width:760px){
  :root{--bottom:68px}
  .nav-desktop{display:none}
  .topbar-right{min-width:0}
  main{padding-bottom:calc(var(--bottom) + env(safe-area-inset-bottom))}
  .nav-mobile{display:flex;position:fixed;inset:auto 0 0 0;height:calc(var(--bottom) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:rgba(255,255,255,.96);backdrop-filter:blur(10px);border-top:1px solid var(--line);z-index:30}
  .nav-mobile a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11.5px;font-weight:600;color:var(--muted)}
  .nav-mobile svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .nav-mobile a.active{color:var(--accent)}
  .view{min-height:calc(100dvh - var(--top) - var(--bottom))}
  .ask-home{justify-content:flex-start;padding-top:12vh}
  .two{grid-template-columns:1fr}
  .today{flex-direction:column;align-items:flex-start}.today .date{text-align:left}
  .chips{justify-content:flex-start}
  .ask-home{text-align:left;align-items:stretch}
  .ask-home h1,.sub,.greet-pill{text-align:left}
  .notice-link{align-self:flex-start}
  .sheet-backdrop{align-items:flex-end;padding:0}
  .sheet{border-radius:24px 24px 0 0;max-height:92vh}
}
@media (min-width:761px) and (max-width:1024px){
  .nav-desktop a{padding:8px 12px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
