:root{--navy:#102a43;--ink:#243b53;--muted:#627d98;--teal:#087e78;--border:#d9e2ec;--paper:#f4f7f9;--white:#fff}*{box-sizing:border-box}body{margin:0;background:var(--paper);font:15px/1.75 -apple-system,BlinkMacSystemFont,"Noto Sans TC","Microsoft JhengHei",sans-serif;color:var(--ink)}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:not-allowed}a{color:#087e78}.site-header{background:var(--navy);color:white}.header-inner{max-width:1260px;margin:auto;padding:15px 22px;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px}.site-header a{color:white;text-decoration:none}.brand{font-size:17px;font-weight:750}.brand span{font-size:12px;margin-left:5px;color:#b5d7d5}.site-header nav{display:flex;gap:20px;font-size:13px}main{max-width:1260px;margin:auto;padding:25px 20px 38px}.intro{display:flex;align-items:center;justify-content:space-between;gap:25px;margin-bottom:20px}.intro h1{font-size:clamp(24px,3vw,32px);color:var(--navy);line-height:1.3;margin:2px 0 10px}.intro p{margin:0;color:var(--muted)}.eyebrow{font-size:11px;letter-spacing:.17em;color:var(--teal)!important;font-weight:800}.summary{display:flex;flex-direction:column;min-width:150px;padding:15px 20px;border:1px solid var(--border);border-radius:13px;background:white}.summary strong{font-size:27px;line-height:1.2;color:var(--navy)}.summary span{font-size:12px}.summary small,.subtle{font-size:12px;color:var(--muted)}.notice{border:1px solid #a5d8d2;border-radius:9px;background:#effaf7;color:#155e58;padding:10px 14px;margin-bottom:16px;font-size:13px;white-space:pre-wrap}.notice.error{background:#fff2f0;border-color:#e3b8b5;color:#a32e2c}.layout{display:grid;grid-template-columns:minmax(260px,330px) minmax(0,1fr);gap:18px;align-items:start}.question-panel,.practice-panel,.backup-panel{border:1px solid var(--border);border-radius:14px;background:var(--white);box-shadow:0 8px 22px #102a4309}.question-panel{padding:16px}.panel-heading{display:flex;justify-content:space-between;gap:10px;align-items:center}.panel-heading h2{font-size:17px;margin:0 0 12px;color:var(--navy)}.panel-heading button{font-size:12px;padding:6px 9px;border:1px solid var(--border);border-radius:7px;background:white}.question-panel label{font-size:12px;font-weight:700;display:block;margin:10px 0 5px}.question-panel select,.question-panel input{width:100%;border:1px solid #bfcdd7;background:white;border-radius:7px;padding:10px;font-size:14px}.question-list{max-height:70vh;overflow:auto;display:grid;align-content:start;gap:8px;margin-top:12px}.question-entry{border:1px solid var(--border);background:#f9fbfc;border-radius:8px;width:100%;padding:12px;text-align:left;color:var(--ink)}.question-entry.active{border-color:var(--teal);background:#eaf7f5;box-shadow:inset 4px 0 var(--teal)}.question-entry strong,.question-entry small{display:block}.question-entry strong{line-height:1.5;font-size:13px;margin:4px 0}.question-entry small{font-size:11px;color:#627d98}.practice-panel{padding:25px}.empty{min-height:320px;display:flex;align-items:center;justify-content:center;color:var(--muted)}[hidden]{display:none!important}.question-top{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;color:var(--muted);font-size:12px}.question-top #saved{color:var(--teal)}.practice-panel h2{font-size:21px;color:var(--navy);margin:12px 0}.question-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:2;border-top:1px solid var(--border);padding:15px 0 20px}.timer-area{border:1px solid #b9e1de;border-radius:12px;background:#effaf8;padding:16px;display:flex;gap:15px;flex-wrap:wrap;justify-content:space-between;align-items:center}.timer-area>div:first-child{display:flex;flex-direction:column}.timer-caption{font-size:12px;color:var(--muted)}.timer{font-size:32px;font-variant-numeric:tabular-nums;line-height:1.4;color:var(--navy)}.timer.expired{color:#b5443c}.timer-area small{font-size:11px;color:var(--muted)}.timer-actions{display:flex;gap:8px;flex-wrap:wrap}.timer-actions button,.backup-actions button{min-height:40px;padding:8px 13px;border-radius:8px;border:1px solid var(--border);background:white}.primary{background:var(--teal)!important;color:white;border:1px solid var(--teal)!important;border-radius:8px;padding:11px 18px;min-height:45px;font-weight:700}.secondary{background:white!important;color:var(--ink)}.answer-heading{display:flex;justify-content:space-between;gap:15px;align-items:center;margin:24px 0 8px}.answer-heading label,.ai-panel label{font-weight:700}.answer-heading span{font-size:12px;color:var(--muted)}textarea{width:100%;resize:vertical;border:1px solid #bfcdd7;border-radius:8px;padding:15px;line-height:1.9;font-size:15px;color:var(--ink)}textarea:focus,input:focus,select:focus,button:focus-visible{outline:2px solid #48a9a2;outline-offset:2px}#answer{min-height:290px}.answer-actions{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:12px;margin:4px 0 20px}.answer-actions label{color:var(--ink)}.ai-panel{border:1px solid #bddbd6;background:#f5faf9;border-radius:11px;padding:19px;margin:18px 0}.ai-panel h3{font-size:18px;margin:0 0 4px;color:var(--navy)}.ai-panel p{font-size:12px;color:var(--muted);margin:0 0 12px}.ai-panel .full{width:100%}.ai-panel label{display:block;font-size:13px;margin:13px 0 6px}.ai-panel textarea{background:white;min-height:170px}.ai-panel #copyStatus,.ai-panel #feedbackStatus{margin:7px 0}.references{border-top:1px solid var(--border);padding-top:18px}.references summary{cursor:pointer;color:var(--teal);font-weight:700}.references h3{font-size:15px}.reference-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.85}.references small{font-size:12px;color:var(--muted)}.backup-panel{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;padding:20px;margin-top:18px}.backup-panel h2{margin:0 0 4px;font-size:17px}.backup-panel p{margin:0;font-size:12px;color:var(--muted)}.backup-actions{display:flex;gap:8px;flex-wrap:wrap}.backup-actions button.danger{color:#ae3434;border-color:#e4b9b9;background:#fff7f6}footer{padding:24px 0;color:var(--muted);font-size:12px}@media(max-width:780px){main{padding:16px 12px 30px}.layout{grid-template-columns:minmax(0,1fr)}.intro{align-items:flex-start}.intro .summary{display:none}.question-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:235px}.practice-panel{padding:18px}.question-text{font-size:15px}.site-header nav{gap:10px}}@media(max-width:480px){.site-header nav{font-size:11px}.question-list{grid-template-columns:1fr}.question-list{max-height:210px}.timer-area{align-items:stretch}.timer-actions button{flex:1}.backup-actions button{flex:1}.backup-actions{width:100%}}

/* Mobile layout polish — 2026-10-17.
   The shared offline.js appends its trigger as the third header nav item.
   Keep it in its own row so it doesn't crowd the navigation links. */
@media (max-width:600px){
  .header-inner{padding:18px 17px 21px;gap:14px}
  .site-header nav{
    display:grid;
    grid-template-columns:max-content minmax(0,1fr);
    column-gap:18px;
    row-gap:10px;
    width:100%;
    align-items:center;
    font-size:13px
  }
  .site-header nav a{min-width:0;overflow-wrap:break-word;line-height:1.5}
  .site-header nav .offline-entry{
    grid-column:1 / -1;
    justify-self:start;
    margin-top:9px;
    padding:9px 17px;
    min-height:44px
  }
}
/* Timer: put the controls below the countdown, not beside it. */
@media (max-width:780px){
  .timer-area{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
  .timer-area>div:first-child{min-width:0}
  .timer-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%;min-width:0}
  .timer-actions button{
    width:100%;min-width:0;
    padding:11px 6px;
    white-space:nowrap;overflow-wrap:normal;word-break:keep-all;
    font-size:14px;line-height:1.45;min-height:46px
  }
  /* Three concise buttons must stay on one neat row at phone widths. */
  .backup-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%;min-width:0}
  .backup-actions button{
    min-width:0;width:100%;min-height:46px;
    padding:9px 5px;font-size:13px;line-height:1.5;
    white-space:nowrap;overflow-wrap:normal;word-break:keep-all
  }
}
@media (max-width:350px){
  .site-header nav{column-gap:12px;font-size:12px}
  .timer-actions button{font-size:13px}
  .backup-actions button{font-size:12px;padding-inline:3px}
}

/* v2.5.4 essay workbench: four independent outline cells + full written answer. */
.essay-workspace{border-top:1px solid var(--border);margin:22px 0 0;padding-top:18px}
.essay-workspace-heading{display:flex;align-items:start;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.essay-workspace-heading h3{font-size:19px;color:var(--navy);margin:0}
.essay-workspace-heading p{font-size:12px;color:var(--muted);margin:3px 0 0}
.essay-workspace-heading #draftWordCount{font-size:12px;color:var(--muted);white-space:nowrap;align-self:center}
.essay-draft-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.essay-draft-field{min-width:0;background:#f7faf9;border:1px solid #dce8e4;border-radius:10px;padding:12px}
.essay-draft-field label{font-size:13px;display:block;font-weight:750;color:var(--navy);margin:0 0 7px}
.essay-draft-field textarea{min-height:150px;display:block;width:100%;background:white;padding:11px 12px;font-size:14px;line-height:1.75}
.essay-workspace .answer-heading{margin-top:22px}
.essay-workspace-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:12px 0 4px}
.essay-workspace-actions button{min-height:44px;border-radius:8px;border:1px solid var(--border);background:#fff;padding:9px 15px;font-weight:650;white-space:normal}
.essay-workspace-actions #exportEssayStatus{flex:1}
@media(max-width:680px){
  .essay-draft-grid{grid-template-columns:minmax(0,1fr);gap:10px}
  .essay-draft-field{padding:11px}
  .essay-draft-field textarea{min-height:118px;font-size:16px}
  .essay-workspace-heading h3{font-size:18px}
  .essay-workspace-actions button{width:100%}
}

/* Compact navigation on desktop and mobile.
   The shared offline.js appends its control into header nav. */
.header-inner{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;column-gap:26px;row-gap:10px;padding:12px 20px}
.header-inner .brand{white-space:nowrap}
.site-header nav{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px 16px;min-width:0;width:100%;font-size:13px}
.site-header nav a{line-height:1.55;overflow-wrap:normal;word-break:keep-all}
.site-header nav .offline-entry{grid-column:auto;justify-self:auto;margin:0;padding:8px 12px;min-height:38px;line-height:1.5;font-size:13px}
@media (max-width:780px){
  .header-inner{grid-template-columns:minmax(0,1fr);gap:8px;padding:12px 16px 13px}
  .header-inner .brand{white-space:normal}
  .site-header nav{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:7px 13px;width:100%;font-size:13px}
  .site-header nav a{min-width:0;overflow-wrap:normal;line-height:1.55;word-break:keep-all}
  .site-header nav .offline-entry{
    grid-column:auto;justify-self:auto;flex:0 0 auto;margin:0;
    padding:7px 11px;min-height:36px
  }
}
@media (max-width:350px){
  .site-header nav{column-gap:10px;row-gap:6px;font-size:12px}
  .site-header nav .offline-entry{font-size:12px;min-height:36px;padding:6px 9px}
}
