:root{
  color-scheme:light; --paper:#f8f6f0; --white:#fffefa; --ink:#22362e; --muted:#50665d;
  --deep:#164e47; --green:#246559; --mint:#e1ebe2; --line:#d3dbcf; --rust:#934a2e;
  --serif: "Songti TC","Noto Serif TC","PMingLiU",serif;
  font-family: "PingFang TC","Noto Sans TC","Microsoft JhengHei",system-ui,sans-serif;
  color:var(--ink); background:var(--paper); font-size:16px; line-height:1.65;
}
*{box-sizing:border-box}
body{margin:0}
[hidden]{display:none!important}
button,input,textarea{font:inherit}
button,a,input,textarea{touch-action:manipulation}
button{cursor:pointer}
button:disabled{opacity:.6;cursor:wait}
:focus-visible{outline:3px solid #b76532;outline-offset:3px}
button,a{ -webkit-tap-highlight-color:transparent}
.skip{position:absolute;z-index:4;top:-5rem;left:1rem;padding:.5rem 1rem;background:white}
.skip:focus{top:.5rem}
.mast{background:var(--deep);color:#fffdf5}
.mast-inner{max-width:1100px;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:0 2.25rem;height:62px}
.brand{display:flex;align-items:center;gap:.7rem;font-family:var(--serif);font-size:1.2rem;letter-spacing:.08em;font-weight:650}
.book-icon{display:block;width:22px;height:22px;border:1.5px solid #d9ecdc;border-left:4px double #d9ecdc;border-radius:2px;transform:rotate(-6deg);position:relative}
.book-icon::after{content:"";position:absolute;left:3px;right:3px;top:5px;border-top:1px solid #d9ecdc}
.mast-button{background:transparent;color:#fff;border:1px solid #84a79a;border-radius:5px;padding:.24rem .8rem;min-height:36px}
.initial,noscript{display:block;text-align:center;margin:5rem 1rem;color:var(--muted)}
h1,h2,h3,p{margin:0}
h1,h2{font-family:var(--serif);font-weight:650;line-height:1.27}
h1{font-size:clamp(2.05rem,4.4vw,3.5rem);letter-spacing:.02em}
h2{font-size:clamp(1.35rem,2.5vw,1.7rem)}
.primary,.secondary{border-radius:6px;border:1px solid var(--green);min-height:44px;padding:.48rem 1rem;font-weight:620}
.primary{background:var(--deep);color:white}
.primary:hover{background:#266452}
.secondary{color:var(--deep);background:var(--white)}
.secondary:hover{background:#edf3ea}
.wide{width:100%}
.login-panel{max-width:420px;margin:clamp(3rem,10vh,7rem) auto 2rem;background:var(--white);border:1px solid var(--line);border-top:4px solid var(--deep);border-radius:6px;padding:2.25rem;box-shadow:0 10px 36px #173e290b}
.login-panel h1{font-size:2.15rem}
.login-panel>p{margin:.7rem 0 1.65rem;color:var(--muted)}
label{font-weight:600;display:block;margin-bottom:.35rem}
input:not([type=checkbox]),textarea{color:var(--ink);background:white;width:100%;border:1px solid #93a395;border-radius:5px;padding:.65rem .75rem;font-size:16px;min-width:0}
textarea{resize:vertical}
.password-field{position:relative;margin-bottom:1.15rem}
.password-field input{padding-right:4rem}
.password-field button{position:absolute;right:4px;top:3px;bottom:3px;min-width:3.2rem;background:transparent;border:0;color:var(--green);font-size:.88rem;font-weight:650}
.journal{max-width:1100px;margin:auto;padding:2.8rem 2.25rem 4rem}
.page-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.subtle{color:var(--muted);font-size:.88rem}
#updated-at{margin-top:.45rem;min-height:1.35rem}
.nav{margin-top:1.6rem;display:flex;gap:.4rem;border-bottom:1px solid #a8b9ab}
.nav button{min-width:5.6rem;padding:.55rem .9rem .65rem;border:0;border-bottom:3px solid transparent;background:none;color:var(--muted);min-height:46px;font-weight:620}
.nav button[aria-current=page]{color:var(--deep);border-bottom-color:var(--deep)}
.nav button:hover{background:#e7ede3}
#view{margin-top:1.6rem;overflow-wrap:anywhere}
#view:focus{outline:none}
.highlights{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1.5rem}
.highlight{width:100%;border:1px solid #c5d6c8;border-radius:8px;background:#e5eee3;color:var(--deep);padding:1.05rem 1.3rem;text-align:left;display:flex;flex-direction:column;align-items:flex-start;gap:.18rem}
.highlight:hover{border-color:var(--green);background:#deeadc}
.highlight-date{background:#f4eadc;border-color:#e1cfb2;color:#65412f}
.highlight-date:hover{border-color:#967155;background:#f3e6d4}
.summary-label{font-size:.89rem;font-weight:650}
.summary-value{font-family:var(--serif);font-size:clamp(1.45rem,3.2vw,2rem);font-weight:700;line-height:1.3;margin:.15rem 0}
.summary-detail{font-size:.88rem}
.overview-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:1.25rem;align-items:start}
.panel,.editor{background:var(--white);border:1px solid var(--line);border-radius:8px;overflow:hidden}
.section-head{display:flex;gap:1rem;align-items:center;justify-content:space-between;padding:1.2rem 1.35rem .9rem;border-bottom:1px solid var(--line)}
.text-button{border:0;background:transparent;color:var(--green);padding:.4rem 0 .4rem .5rem;min-height:40px;white-space:nowrap;font-weight:600}
.text-button:hover{text-decoration:underline}
.item{border-bottom:1px solid #e3e7dd;padding:1rem 1.35rem}
.item:last-child{border-bottom:0}
.task{display:grid;grid-template-columns:1.7rem minmax(0,1fr);gap:.45rem}
.task-check{width:22px;height:22px;accent-color:var(--green);margin:.27rem 0 0;cursor:pointer}
.task-title{margin:0;cursor:pointer;font-size:1.02rem;font-weight:660}
.done .task-title{text-decoration:line-through;color:#617066}
.item h3{font-size:1.03rem;font-weight:650}
.copy{font-size:.94rem;line-height:1.7;white-space:pre-wrap;margin-top:.3rem}
.meta{font-size:.81rem;line-height:1.6;color:var(--muted);margin-top:.42rem;display:flex;flex-wrap:wrap;gap:.22rem .7rem}
.source-link{color:var(--deep);text-underline-offset:.18em}
.event-date{font-size:.83rem;font-weight:600;color:var(--green);font-variant-numeric:tabular-nums}
.event .meta{margin-top:.2rem;margin-bottom:.25rem}
.empty{padding:1.25rem;color:var(--muted)}
.doc-link{color:var(--deep);font-weight:650;text-decoration:underline;text-underline-offset:.19em;display:inline-block;min-height:32px}
.editor{padding:1.4rem;margin-top:1.35rem;border-top:3px solid var(--green)}
.editor h2{margin-bottom:1.05rem}
.editor-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(8rem,13rem);gap:1rem;margin-bottom:.9rem}
.actions{display:flex;gap:.6rem;margin-top:.8rem}
.form-error,.error{color:#8a3826}
.form-error{margin:.75rem 0}
.notice{margin:.9rem 0 .4rem;color:var(--green)}
.notice.error{color:#8a3826}
@media(max-width:760px){
  .mast-inner{padding:0 1.15rem;height:54px}.journal{padding:1.65rem 1rem 3rem}
  .overview-grid{grid-template-columns:1fr}
  .nav{margin-top:1rem;gap:0}.nav button{flex:1;min-width:0}
  .highlight{padding:.85rem}.highlights{gap:.6rem;margin-bottom:.9rem}
  .section-head,.item{padding-left:1rem;padding-right:1rem}
  .login-panel{margin-left:auto;margin-right:auto;width:calc(100% - 2.4rem);padding:1.65rem}
}
@media(max-width:450px){
  .editor-fields{grid-template-columns:1fr}.page-heading{align-items:flex-start;gap:.4rem}
  .page-heading>.primary{padding:.4rem .65rem;font-size:.91rem}
  .summary-label,.summary-detail{font-size:.8rem}.highlight{padding:.7rem}
  .editor{padding:1rem}.editor input[type=date]{min-height:44px}
}
