
/* Layout: personal-brand doctor blog — sticky nav, night-forest hero with the name, About Me, featured post, filterable post grid, tools, contact band */
:root{
  --bg:#FFFFFF; --soft:#F2F5F0; --ink:#1D2420; --muted:#67716B; --line:#E1E6DE;
  --forest:#1E3B31; --forest-2:#2C5445; --moss:#4F7A4A; --on-dark:#F4F1E8; --amber:#E2A53F;
  --t1:#F1E2C4; --t2:#D6E5EE; --t3:#DAE7D7; --t4:#F2DDDF; --t5:#E4DEF0;
  --f-brand:"Fraunces","Noto Serif TC",Georgia,serif;
  --f-display:"Noto Serif TC","Songti TC","PMingLiU",serif;
  --f-body:"Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;
  --r:10px;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#121614; --soft:#1A201D; --ink:#E8ECE6; --muted:#A2ACA5; --line:#2C3530;
  --forest:#0E1D18; --forest-2:#1E3A30; --moss:#8DBB86; --on-dark:#F0EDE4; --amber:#E9B456;
  --t1:#3A3122; --t2:#1F2F38; --t3:#22332A; --t4:#3A2528; --t5:#2C2738; color-scheme:dark }}
:root[data-theme="dark"]{
  --bg:#121614; --soft:#1A201D; --ink:#E8ECE6; --muted:#A2ACA5; --line:#2C3530;
  --forest:#0E1D18; --forest-2:#1E3A30; --moss:#8DBB86; --on-dark:#F0EDE4; --amber:#E9B456;
  --t1:#3A3122; --t2:#1F2F38; --t3:#22332A; --t4:#3A2528; --t5:#2C2738; color-scheme:dark }
.c-t1{--t:var(--t1)} .c-t2{--t:var(--t2)} .c-t3{--t:var(--t3)} .c-t4{--t:var(--t4)} .c-t5{--t:var(--t5)}

*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink)}
body{font:16px/1.8 var(--f-body);-webkit-font-smoothing:antialiased}
img{max-width:100%;display:block}
a{color:inherit}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--amber);outline-offset:2px}
h1,h2,h3{font-family:var(--f-display);font-weight:700;text-wrap:balance;line-height:1.35;margin:0}
.wrap{max-width:1140px;margin:0 auto;padding:0 24px}
.muted{color:var(--muted)}
.num{font-variant-numeric:tabular-nums}

/* nav */
.bar{position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.bar .wrap{display:flex;align-items:center;gap:24px;height:74px}
.wordmark{font-family:var(--f-brand);font-weight:700;font-size:23px;letter-spacing:-.01em;text-decoration:none;white-space:nowrap;line-height:1}
.menu{display:flex;align-items:center;gap:2px;margin-left:auto}
.menu > a,.menu .dd > a{display:block;padding:8px 15px;text-decoration:none;font-size:18px;font-weight:500;color:var(--ink);opacity:.78;border-radius:8px;white-space:nowrap}
.menu > a:hover,.menu .dd > a:hover,.menu a.on{opacity:1}
.menu a.cta{opacity:1;font-size:16px;margin-left:10px}
.menu > a:hover,.menu .dd > a:hover,.menu a.on{color:var(--ink)}
.menu a.on{box-shadow:inset 0 -2px 0 var(--moss);border-radius:0}
.dd{position:relative}
.dd > a::after{content:"";display:inline-block;width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin:0 0 3px 8px}
.dd .sub{position:absolute;top:100%;left:0;min-width:180px;background:var(--bg);border:1px solid var(--line);border-radius:var(--r);padding:6px;box-shadow:0 16px 32px -16px rgba(0,0,0,.25);display:none}
.dd:hover .sub,.dd:focus-within .sub{display:block}
.sub a{display:block;padding:9px 14px;border-radius:6px;text-decoration:none;font-size:16px}
.sub a:hover{background:var(--soft)}
.cta{margin-left:8px}
.burger{display:none;margin-left:auto;background:none;border:1px solid var(--line);border-radius:8px;width:42px;height:38px;cursor:pointer;padding:0}
.burger span{display:block;width:18px;height:2px;background:var(--ink);margin:4px auto}
.mpanel{border-top:1px solid var(--line);padding:8px 0 16px}
.mpanel a{display:block;padding:10px 0;text-decoration:none;font-size:17px;border-bottom:1px solid var(--line)}
.mpanel a.indent{padding-left:18px;font-size:15px;color:var(--muted)}
.adminbar{background:var(--amber);color:#1D2420;font-size:14px}
.adminbar .wrap{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:42px;flex-wrap:wrap;padding-top:4px;padding-bottom:4px}
.adminbar .btn{background:rgba(255,255,255,.55);border-color:transparent;color:#1D2420;padding:4px 12px}
.adminbar .btn.primary{background:#1D2420;color:#fff}

/* buttons */
.btn{display:inline-flex;align-items:center;gap:6px;padding:9px 18px;border-radius:999px;border:1px solid var(--line);background:var(--bg);cursor:pointer;text-decoration:none;font-size:15px;font-weight:500;line-height:1.4;white-space:nowrap}
.btn:hover{border-color:var(--ink)}
.btn.primary{background:var(--forest);border-color:var(--forest);color:var(--on-dark)}
.btn.primary:hover{background:var(--forest-2)}
.btn.light{background:var(--on-dark);border-color:var(--on-dark);color:#1D2420}
.btn.ghost{background:transparent;border-color:rgba(255,255,255,.5);color:var(--on-dark)}
.btn.danger{color:#B3403A;border-color:#B3403A}
.btn.danger.solid{background:#B3403A;color:#fff}
.btn:disabled{opacity:.5;cursor:default}
.link{background:none;border:0;padding:0;color:var(--moss);cursor:pointer;font-weight:700;text-decoration:none}
.link:hover{text-decoration:underline}

/* hero */
.hero{position:relative;background:var(--forest);color:var(--on-dark);overflow:hidden;min-height:480px;display:flex;align-items:flex-end}
.hero canvas,.hero .himg{position:absolute;inset:0;width:100%;height:100%}
.hero .himg{object-fit:cover}
.hero .shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(10,22,18,.15) 0%,rgba(10,22,18,.25) 45%,rgba(10,22,18,.78) 100%)}
.hero .wrap{position:relative;width:100%;padding-top:96px;padding-bottom:56px}
.hero .alias{font-family:var(--f-display);font-size:18px;letter-spacing:.2em;opacity:.85;margin:0 0 4px}
.hero h1{font-family:var(--f-brand);font-weight:700;font-size:clamp(52px,10vw,112px);line-height:.95;letter-spacing:-.025em}
.hero .tag{font-size:clamp(17px,2.2vw,21px);max-width:36ch;margin:18px 0 26px;opacity:.92;line-height:1.7}

/* sections */
.section{padding:72px 0}
.section.soft{background:var(--soft)}
.sh{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:28px;flex-wrap:wrap}
.sh h2{font-size:clamp(26px,3.4vw,34px)}
.sh p{margin:4px 0 0;color:var(--muted)}

/* about */
.about{display:grid;grid-template-columns:260px 1fr;gap:56px;align-items:center}
.avatar{width:100%;aspect-ratio:1;border-radius:50%;overflow:hidden;background:var(--forest);display:grid;place-items:center;color:var(--on-dark);font-family:var(--f-brand);font-weight:700;font-size:72px;box-shadow:0 0 0 8px var(--soft),0 0 0 9px var(--line)}
.avatar img{width:100%;height:100%;object-fit:cover}
.about h2{font-size:clamp(28px,3.6vw,38px)}
.about .role{color:var(--moss);font-weight:700;margin:6px 0 14px}
.about .bio{white-space:pre-line;max-width:60ch;margin:0 0 20px;font-size:17px}
.tags{display:flex;gap:8px;flex-wrap:wrap}
.tags a{text-decoration:none;font-size:14px;padding:5px 14px;border-radius:999px;border:1px solid var(--line);background:var(--bg)}
.tags a:hover{border-color:var(--moss);color:var(--moss)}
.hint{font-size:14px;color:var(--muted);border:1px dashed var(--line);border-radius:var(--r);padding:10px 14px;margin:0 0 16px}

/* cards */
.thumb{position:relative;aspect-ratio:16/10;border-radius:var(--r);overflow:hidden;background:var(--t)}
.thumb img{width:100%;height:100%;object-fit:cover;transition:transform .4s ease}
.thumb .ph{position:absolute;inset:0;display:flex;align-items:flex-end;justify-content:space-between;padding:16px 18px}
.thumb .ph b{font-family:var(--f-display);font-size:clamp(26px,3vw,34px);opacity:.38}
.thumb .ph svg{width:44px;height:44px;opacity:.28}
.card{text-decoration:none;display:flex;flex-direction:column;gap:10px}
.card:hover img{transform:scale(1.03)}
.card:hover h3{color:var(--moss)}
.cat{font-size:13px;font-weight:700;color:var(--moss);letter-spacing:.02em}
.card h3{font-size:20px;line-height:1.45}
.card p{margin:0;color:var(--muted);font-size:15px;line-height:1.75;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.by{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);flex-wrap:wrap}
.by .mini{width:24px;height:24px;border-radius:50%;overflow:hidden;background:var(--forest);color:var(--on-dark);display:grid;place-items:center;font-family:var(--f-brand);font-size:12px;font-weight:700;flex:none}
.by .mini img{width:100%;height:100%;object-fit:cover}
.by b{color:var(--ink);font-weight:500}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:40px 28px}
.feature{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:40px;align-items:center;text-decoration:none}
.feature .thumb{aspect-ratio:3/2}
.feature h3{font-size:clamp(26px,3.4vw,36px);margin:8px 0 12px}
.feature p{margin:0 0 18px;color:var(--muted);font-size:17px}
.feature:hover img{transform:scale(1.03)}

/* filter row */
.filters{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);margin-bottom:32px;flex-wrap:wrap}
.ftabs{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;margin-bottom:-1px}
.ftabs::-webkit-scrollbar{display:none}
.ftabs button{background:none;border:0;border-bottom:2px solid transparent;padding:10px 14px;cursor:pointer;color:var(--muted);font-size:17px;white-space:nowrap}
.ftabs button.on{color:var(--ink);border-bottom-color:var(--moss);font-weight:700}
.search{position:relative;margin-bottom:8px;display:block}
.filters > *{min-width:0;max-width:100%}
html,body{overflow-x:clip}
.search input{width:220px;padding:8px 14px 8px 36px;border:1px solid var(--line);border-radius:999px;background:var(--bg);font-size:14px}
.search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:16px;height:16px;opacity:.5}
.empty{border:1px dashed var(--line);border-radius:var(--r);padding:40px 24px;text-align:center;color:var(--muted)}
.empty b{display:block;font-family:var(--f-display);font-size:22px;color:var(--ink);margin-bottom:6px}
.empty .row{justify-content:center;margin-top:16px}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

/* category page head */
.phead{background:var(--soft);padding:56px 0 44px}
.phead .crumb{font-size:14px;color:var(--muted);margin-bottom:6px}
.phead .crumb a{text-decoration:none;color:var(--moss);font-weight:500}
.phead h1{font-size:clamp(34px,5vw,50px)}
.phead p{margin:8px 0 0;color:var(--muted);font-size:17px}
.subtabs{display:flex;gap:8px;flex-wrap:wrap;margin-top:22px}
.subtabs a{text-decoration:none;font-size:14px;padding:6px 16px;border-radius:999px;border:1px solid var(--line);background:var(--bg)}
.subtabs a.on{background:var(--forest);border-color:var(--forest);color:var(--on-dark)}

/* article */
.post{padding:56px 0 24px}
.post .head{max-width:760px;margin:0 auto;text-align:center}
.post .head .crumb{font-size:14px}
.post .head .crumb a{text-decoration:none;color:var(--moss);font-weight:700}
.post h1{font-size:clamp(30px,5vw,46px);margin:14px 0 18px;line-height:1.3}
.post .by{justify-content:center}
.post .cover{max-width:1000px;margin:36px auto 0;border-radius:var(--r);overflow:hidden}
.prose{max-width:700px;margin:44px auto 0;font-size:17.5px;line-height:2}
.prose p{margin:0 0 1.2em}
.prose h2{font-size:27px;margin:1.7em 0 .6em}
.prose h3{font-size:22px;margin:1.5em 0 .5em}
.prose h4{font-size:19px;margin:1.3em 0 .4em;font-family:var(--f-display)}
.prose ul,.prose ol{padding-left:1.4em;margin:0 0 1.2em}
.prose li{margin:.25em 0}
.prose blockquote{margin:1.6em 0;padding:4px 0 4px 22px;border-left:3px solid var(--moss);font-family:var(--f-display);font-size:20px;line-height:1.8}
.prose figure{margin:1.8em 0}
.prose img{border-radius:var(--r);margin:0 auto}
.prose hr{border:0;border-top:1px solid var(--line);margin:2.4em auto;width:120px}
.prose a{color:var(--moss)}
.authorbox{max-width:700px;margin:56px auto 0;display:grid;grid-template-columns:72px 1fr;gap:18px;padding:24px;background:var(--soft);border-radius:var(--r);align-items:center}
.authorbox .avatar{font-size:28px;box-shadow:none}
.authorbox b{font-family:var(--f-brand);font-size:20px}
.authorbox p{margin:2px 0 0;color:var(--muted);font-size:15px;white-space:pre-line}
.pn{max-width:700px;margin:28px auto 0;display:grid;grid-template-columns:1fr 1fr;gap:16px}
.pn a{text-decoration:none;border:1px solid var(--line);border-radius:var(--r);padding:14px 18px;font-family:var(--f-display);font-weight:700;line-height:1.5}
.pn a:hover{border-color:var(--moss)}
.pn small{display:block;font-family:var(--f-body);font-weight:400;font-size:13px;color:var(--muted)}

/* tools */
.tools{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px}
.tool{background:var(--bg);border:1px solid var(--line);border-radius:var(--r);padding:26px;display:flex;flex-direction:column;gap:6px}
.tool .ico{width:44px;height:44px;border-radius:12px;background:var(--forest);color:var(--on-dark);display:grid;place-items:center;margin-bottom:8px}
.tool .ico svg{width:22px;height:22px}
.tool h3{font-size:21px}
.tool p{margin:0;color:var(--muted);font-size:15px;flex:1}
.tool .row{margin-top:14px}

/* contact + footer */
.contact{background:var(--forest);color:var(--on-dark);padding:72px 0}
.contact .wrap{display:grid;grid-template-columns:1fr auto;gap:32px;align-items:end}
.contact h2{font-size:clamp(28px,4vw,40px)}
.contact p{margin:10px 0 0;opacity:.85;max-width:46ch}
.contact .mail{font-family:var(--f-brand);font-size:clamp(20px,2.6vw,26px);margin-top:18px;word-break:break-all}
footer{background:var(--forest);color:var(--on-dark);border-top:1px solid rgba(255,255,255,.12)}
footer .wrap{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:20px;padding-bottom:28px;font-size:13px;opacity:.75}
.note{background:var(--soft);border-left:4px solid var(--amber);padding:10px 16px;border-radius:6px;font-size:14px;margin:20px 0}

/* forms */
.pagehead{padding:48px 0 8px}
.pagehead h1{font-size:clamp(30px,4.6vw,42px)}
.pagehead p{margin:4px 0 0;color:var(--muted)}
.form{display:flex;flex-direction:column;gap:16px;max-width:860px;padding-bottom:64px}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:14px;font-weight:700}
.field small{color:var(--muted);font-size:13px}
.check{display:flex;align-items:center;gap:8px;font-size:15px}
input[type=text],input[type=url],input[type=email],select,textarea{width:100%;padding:10px 14px;border:1px solid var(--line);border-radius:var(--r);background:var(--bg)}
textarea{resize:vertical;line-height:1.8}
#ed-body{min-height:420px;font-size:16px}
.title-input{font-family:var(--f-display);font-size:26px !important;font-weight:700}
.two{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line)}
.tabs button{background:none;border:0;padding:8px 14px;cursor:pointer;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px}
.tabs button.on{color:var(--ink);border-bottom-color:var(--moss);font-weight:700}
.toolbar{display:flex;gap:6px;flex-wrap:wrap;padding:8px 0}
.toolbar button{padding:4px 12px;font-size:13px}
.preview{border:1px solid var(--line);border-radius:var(--r);padding:8px 24px 20px;min-height:420px}
.preview.prose{max-width:none;margin:0}
.coverbox{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.coverbox .thumb{width:200px}
.coverbox .avatar{width:96px;font-size:32px;box-shadow:none}
.status{font-size:14px;color:var(--muted);min-height:1.5em}
.status.bad{color:#B3403A}
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;padding-top:14px;border-top:1px solid var(--line)}
.actions .spacer{flex:1}
.panel{background:var(--soft);border-radius:var(--r);padding:22px;margin:16px 0}
.help{font-size:13px;color:var(--muted);line-height:1.7}
.help code{font-size:12px;background:var(--soft);padding:1px 6px;border-radius:6px}
.list{display:flex;flex-direction:column;gap:20px}
.edsplit{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;align-items:start}
.livewrap{display:none}
.livelabel{font-size:13px;color:var(--muted);font-weight:700;padding:14px 0 8px}
#ed-body.drag{outline:3px dashed var(--moss);outline-offset:-8px;background:var(--soft)}
.toolbar .imgbtn{font-size:14px;padding:5px 14px}
@media (min-width:1100px){ .edsplit{grid-template-columns:minmax(0,1fr) minmax(0,1fr)} .livewrap{display:block;position:sticky;top:90px} #ed-live{max-height:calc(100vh - 150px);overflow:auto;min-height:420px} #edform .tabs{display:none} #edform{max-width:none} }
.prose figcaption{text-align:center;font-size:14px;color:var(--muted);margin-top:10px;line-height:1.6}
.avwrap{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%}
.avwrap .avatar{cursor:pointer}
.avwrap .status{text-align:center}
#catlist{display:flex;flex-direction:column;gap:14px}
.catgroup{border:1px solid var(--line);border-radius:var(--r);padding:14px;display:flex;flex-direction:column;gap:10px;background:var(--bg)}
.catrow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}
.catrow.sub{margin-left:24px;padding-left:14px;border-left:2px solid var(--line)}
.catf{display:grid;grid-template-columns:minmax(0,200px) minmax(0,1fr);gap:8px}
.catrow:not(.sub) [data-f="name"]{font-weight:700}
.catc{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.catc .n{font-size:13px;color:var(--muted);min-width:3.5em;text-align:right}
.catc select{width:auto;max-width:220px;padding:6px 10px;font-size:14px}
.btn.sm{padding:4px 10px;font-size:13px}
.addsub{align-self:flex-start;margin-left:24px;font-size:14px}
@media (max-width:760px){ .catrow{grid-template-columns:1fr} .catf{grid-template-columns:1fr} .catc .n{text-align:left;min-width:0} }

@media (max-width:1000px){
  .menu{display:none}
  .burger{display:block}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .feature{grid-template-columns:1fr;gap:20px}
  .about{grid-template-columns:1fr;gap:28px;justify-items:start}
  .about .avatar{width:160px}
}
@media (max-width:600px){
  .wrap{padding:0 18px}
  .grid{grid-template-columns:1fr;gap:36px}
  .section{padding:52px 0}
  .hero{min-height:420px}
  .hero .wrap{padding-bottom:40px}
  .filters{flex-direction:column-reverse;align-items:stretch}
  .search input{width:100%}
  .contact .wrap,.two,.pn{grid-template-columns:1fr}
  .prose{font-size:16.5px}
  .authorbox{grid-template-columns:56px 1fr;padding:18px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

section[id$="-sec"]{scroll-margin-top:72px}

.card[hidden]{display:none!important}
.prose figure img{max-width:100%;max-height:min(80vh,820px);width:auto;height:auto;margin:0 auto;display:block}
.post .cover img{max-height:70vh;width:auto;margin:0 auto}
.srclink{max-width:700px;margin:28px auto 0;font-size:14px;color:var(--muted)}
.srclink a{color:var(--moss)}
