/* 口袋 AI 內容站 — 對齊 apps.html 品牌 token */
:root{
  --bg:#f5f7f6; --surface:#ffffff; --ink:#18231f; --muted:#5d6b66;
  --border:#e5eae8; --shadow:0 1px 2px rgba(20,40,34,.05),0 8px 24px rgba(20,40,34,.06);
  --radius:16px; --maxw:1120px; --accent:#0E7D70; --accent2:#B83A2A;
  --navbg:#13201c; --navink:#eaf1ee;
}
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]){
  --bg:#0f1411; --surface:#18201d; --ink:#e9efec; --muted:#95a39e; --border:#283330;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px rgba(0,0,0,.35); --navbg:#0b120f; }}
:root[data-theme="dark"]{ --bg:#0f1411; --surface:#18201d; --ink:#e9efec; --muted:#95a39e; --border:#283330;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px rgba(0,0,0,.35); --navbg:#0b120f; }
*{box-sizing:border-box} html,body{margin:0}
body{background:var(--bg); color:var(--ink); line-height:1.7;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans TC","Noto Sans JP",Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased}
a{color:var(--accent); text-decoration:none} a:hover{text-decoration:underline}
.wrap{max-width:var(--maxw); margin:0 auto; padding:0 16px}
img{max-width:100%}

/* ===== header:brand bar + nav ===== */
.site{position:sticky; top:0; z-index:20; background:var(--bg); box-shadow:0 4px 16px rgba(20,40,34,.08)}
.brandbar{display:flex; align-items:center; gap:12px; flex-wrap:wrap; max-width:var(--maxw); margin:0 auto; padding:12px 16px; background:var(--bg)}
.logo{display:flex; align-items:center; gap:11px; color:var(--ink)} .logo:hover{text-decoration:none}
.logomark{width:30px; height:30px; border-radius:9px; background:linear-gradient(135deg,var(--accent),var(--accent2)); box-shadow:0 2px 8px rgba(14,125,112,.35); flex:0 0 auto}
.logotext{font-weight:900; font-size:1.3rem; letter-spacing:-.01em; display:flex; align-items:baseline; gap:7px}
.logotext em{font-style:normal; font-weight:700; font-size:.78rem; color:var(--muted); letter-spacing:.02em}
/* header 搜尋框 */
.search{margin-left:auto; display:flex; align-items:center; background:var(--surface); border:1px solid var(--border); border-radius:999px; overflow:hidden; flex:0 1 260px; min-width:150px}
.search input{flex:1; min-width:0; border:none; background:transparent; color:var(--ink); font:inherit; font-size:.9rem; padding:8px 6px 8px 15px; outline:none}
.search button{border:none; background:transparent; cursor:pointer; padding:8px 13px 8px 4px; font-size:.95rem; line-height:1; color:var(--muted)}
.search:focus-within{border-color:var(--accent)}
.mainnav{background:var(--navbg); border-top:3px solid var(--accent)}
.navinner{max-width:var(--maxw); margin:0 auto; padding:0 6px; display:flex; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch}
.navinner::-webkit-scrollbar{display:none}
.mainnav a{color:var(--navink); font-weight:700; font-size:.95rem; padding:13px 16px; white-space:nowrap; border-bottom:3px solid transparent; flex:0 0 auto}
.mainnav a:hover{text-decoration:none; background:rgba(255,255,255,.06)}
.mainnav a.on{border-bottom-color:var(--accent); color:#fff}
/* 手機:搜尋框自成一行、logo 縮小 */
@media(max-width:560px){
  .brandbar{gap:10px; padding:10px 14px}
  .logotext{font-size:1.15rem} .logotext em{display:none}
  .search{order:3; flex-basis:100%; margin-left:0; min-width:0}
  .mainnav a{padding:12px 14px; font-size:.9rem}
}

/* ===== 搜尋頁 ===== */
.searchpage{padding:6px 0 20px}
.searchbig{width:100%; font:inherit; font-size:1.05rem; padding:14px 18px; border-radius:12px; border:1px solid var(--border); background:var(--surface); color:var(--ink); outline:none}
.searchbig:focus{border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
.scount{color:var(--muted); font-size:.85rem; margin:12px 2px}

/* ===== chips ===== */
.cat-chip{display:inline-block; background:var(--accent); color:#fff; font-size:.72rem; font-weight:800; padding:3px 9px; border-radius:6px}
.sub{display:inline-block; color:var(--accent); font-weight:800; font-size:.76rem; margin-bottom:3px}
.tag{font-size:.78rem; color:var(--muted); margin-right:8px}

/* ===== hero(首頁大圖)===== */
.hero{display:block; position:relative; border-radius:var(--radius); overflow:hidden; margin:20px 0 6px;
  min-height:300px; background-size:cover; background-position:center; box-shadow:var(--shadow)}
.hero:hover{text-decoration:none} .hero-txt{position:absolute; left:0; right:0; bottom:0; padding:22px 24px; color:#fff}
.hero-txt h1{margin:9px 0 6px; font-size:clamp(1.4rem,3.6vw,2.1rem); font-weight:900; line-height:1.25; text-wrap:balance; text-shadow:0 2px 12px rgba(0,0,0,.5)}
.hero-txt p{margin:0; font-size:.98rem; opacity:.92; max-width:46em; text-shadow:0 1px 8px rgba(0,0,0,.5)}

/* 首頁 hero 輪播(最新 12 則;自動輪播+箭頭/圓點/滑動)*/
.hero-carousel{position:relative; border-radius:var(--radius); overflow:hidden; margin:20px 0 6px;
  min-height:clamp(320px,42vw,440px); box-shadow:var(--shadow); background:var(--border)}
/* 輪播內標題/摘要限行數,避免內容超過固定高度被裁掉 */
.hero-carousel .hero-txt h1{display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden}
.hero-carousel .hero-txt p{display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden}
.hero-track{position:absolute; inset:0}
.hero-slide{position:absolute; inset:0; display:block; background-size:cover; background-position:center;
  opacity:0; visibility:hidden; transition:opacity .6s ease; pointer-events:none}
.hero-slide.active{opacity:1; visibility:visible; pointer-events:auto}
.hero-slide:hover{text-decoration:none}
.hero-arw{position:absolute; top:50%; transform:translateY(-50%); z-index:3; width:40px; height:40px;
  display:flex; align-items:center; justify-content:center; border:0; cursor:pointer; border-radius:50%;
  background:rgba(0,0,0,.42); color:#fff; font-size:1.6rem; line-height:1; -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px)}
.hero-arw:hover{background:rgba(0,0,0,.68)}
.hero-arw.prev{left:12px} .hero-arw.next{right:12px}
.hero-dots{position:absolute; top:14px; right:14px; z-index:3; display:flex; gap:6px; flex-wrap:wrap;
  max-width:62%; justify-content:flex-end}
.hero-dot{width:8px; height:8px; padding:0; border:0; cursor:pointer; border-radius:50%;
  background:rgba(255,255,255,.5); transition:width .2s ease, background .2s ease}
.hero-dot.active{background:#fff; width:20px; border-radius:5px}
@media(max-width:560px){.hero-arw{width:34px; height:34px; font-size:1.3rem}
  .hero-arw.prev{left:8px} .hero-arw.next{right:8px} .hero-dots{top:10px; right:10px}}

/* ===== 首頁 App 置頂帶 ===== */
.apphero{margin:18px 0 10px; padding:20px 20px 22px; border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow);
  background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 12%,var(--surface)),var(--surface) 60%)}
.apphero-head h2{margin:0 0 4px; font-size:1.2rem; font-weight:900}
.apphero-head p{margin:0 0 15px; color:var(--muted); font-size:.9rem; max-width:48em}
.apphero-grid{display:grid; gap:14px; grid-template-columns:1fr}
@media(min-width:620px){ .apphero-grid{grid-template-columns:1fr 1fr} }
.apphero-card{border:1px solid var(--border); border-left:4px solid var(--a); border-radius:14px; padding:16px; background:var(--surface); display:flex; flex-direction:column; gap:8px}
.ah-top{display:flex; align-items:baseline; gap:9px; flex-wrap:wrap}
.ah-top h3{margin:0; font-size:1.12rem; font-weight:900; color:var(--a)}
.ah-tag{color:var(--muted); font-weight:700; font-size:.82rem}
.apphero-card>p{margin:0; color:var(--muted); font-size:.9rem; flex:1}

/* ===== 首頁分欄目區塊 ===== */
.catsec{margin:26px 0 6px}
.catsec-head{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:13px}
.catsec-head .sec-h{margin:0}
.more{font-size:.85rem; font-weight:800; color:var(--accent); white-space:nowrap; flex:0 0 auto}
.more:hover{text-decoration:none; filter:brightness(1.1)}

/* ===== 首頁雙欄(main + 右側欄)===== */
.home{display:grid; gap:24px; grid-template-columns:1fr; grid-template-areas:"hero" "side" "main"; padding:18px 0 10px}
@media(min-width:900px){ .home{grid-template-columns:1fr 320px; gap:30px; grid-template-areas:"hero side" "main side"; align-items:start} }
.home-main{min-width:0}
.sec-h{font-size:1.15rem; font-weight:900; margin:6px 0 14px; padding-left:11px; border-left:4px solid var(--accent)}

/* 側欄:熱門文章框內置頂的兩款 App */
.pin-apps{margin-bottom:6px; padding-bottom:14px; border-bottom:2px solid var(--border)}
.pin-app{border:1px solid var(--border); border-top:3px solid var(--a); border-radius:12px; padding:12px 13px 13px; margin-bottom:10px; background:color-mix(in srgb,var(--a) 7%,var(--surface))}
.pin-app:last-child{margin-bottom:0}
.pa-name{font-weight:900; color:var(--a); font-size:1.02rem; margin-bottom:10px; line-height:1.3}
.pa-name span{display:block; color:var(--muted); font-weight:700; font-size:.76rem; margin-top:2px}
.pin-app .appbtns{gap:7px}
.pin-app .btn{font-size:.8rem; padding:7px 11px}
.hot-h{margin-top:4px}
.home-side .side-box{background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow); padding:16px; margin-bottom:18px}
.side-h{font-size:1rem; font-weight:900; margin:0 0 12px; padding-bottom:9px; border-bottom:2px solid var(--accent)}
.sideitem{display:flex; gap:11px; align-items:center; padding:8px 0; border-bottom:1px solid var(--border); color:var(--ink)}
.sideitem:last-child{border-bottom:none} .sideitem:hover{text-decoration:none; color:var(--accent)}
.sthumb{width:62px; height:46px; border-radius:8px; background-size:cover; background-position:center; flex:0 0 auto; background-color:var(--border)}
.scat{font-size:.68rem; color:var(--accent); font-weight:800} .stitle{font-size:.86rem; font-weight:650; line-height:1.4}
.about p{color:var(--muted); font-size:.9rem; margin:0 0 12px}

/* ===== 卡片 grid ===== */
.cardgrid{display:grid; gap:18px; grid-template-columns:1fr}
@media(min-width:560px){ .cardgrid{grid-template-columns:1fr 1fr} }
.card{display:block; background:var(--surface); border:1px solid var(--border); border-radius:14px; overflow:hidden; box-shadow:var(--shadow); color:var(--ink)}
.card:hover{text-decoration:none; transform:translateY(-2px); border-color:color-mix(in srgb,var(--ink) 16%,var(--border))}
.thumb{position:relative; aspect-ratio:16/9; background-size:cover; background-position:center; background-color:var(--border)}
.thumb .cat-chip{position:absolute; left:10px; top:10px}
.cardbody{padding:13px 15px 15px}
.card h3{margin:3px 0 6px; font-size:1.04rem; font-weight:800; line-height:1.4; letter-spacing:-.01em}
.card p{margin:0 0 8px; color:var(--muted); font-size:.9rem}
.card .meta{color:var(--muted); font-size:.78rem}

/* ===== 分類頁 ===== */
.cathead{padding:22px 0 10px} .cathead h1{margin:0 0 6px; font-size:clamp(1.5rem,4vw,2rem); font-weight:900}
.cathead p{margin:0; color:var(--muted); max-width:44em}
.subbar{display:flex; flex-wrap:wrap; gap:9px; padding:8px 0 20px}
.subchip{font:inherit; font-size:.86rem; font-weight:700; padding:7px 15px; border-radius:999px; cursor:pointer;
  border:1px solid var(--border); background:var(--surface); color:var(--ink)}
.subchip:hover{border-color:var(--accent)} .subchip.on{background:var(--accent); border-color:transparent; color:#fff}

/* ===== 文章頁 ===== */
.post{max-width:780px; margin:0 auto; padding:22px 0 6px}
.crumb{font-size:.82rem; color:var(--muted); margin-bottom:12px} .crumb a{color:var(--muted)} .crumb a:hover{color:var(--accent)}
.post h1{margin:6px 0 10px; font-size:clamp(1.5rem,4.6vw,2.1rem); font-weight:900; line-height:1.3; text-wrap:balance}
.post .meta{color:var(--muted); font-size:.85rem; margin-bottom:16px}
.hero-img{aspect-ratio:16/9; border-radius:14px; background-size:cover; background-position:center; background-color:var(--border); margin-bottom:22px; box-shadow:var(--shadow)}
.prose{font-size:1.05rem} .prose h2{margin:32px 0 12px; font-size:1.3rem; font-weight:900; padding-left:11px; border-left:4px solid var(--accent)}
.prose h3{margin:24px 0 10px; font-size:1.1rem; font-weight:800} .prose p{margin:0 0 16px}
.prose ul,.prose ol{margin:0 0 16px; padding-left:1.4em} .prose li{margin:5px 0} .prose strong{font-weight:800}
.prose a{text-decoration:underline; text-underline-offset:2px}
.prose img{border-radius:12px; display:block; margin:18px auto}
.prose figure{margin:20px 0} .prose figcaption{color:var(--muted); font-size:.82rem; text-align:center; margin-top:7px}
.prose blockquote{margin:18px 0; padding:12px 16px; border-left:3px solid var(--accent); background:var(--surface); border-radius:0 12px 12px 0; color:var(--muted)}
.prose table{width:100%; border-collapse:collapse; margin:18px 0; font-size:.94rem; display:block; overflow-x:auto}
.prose th,.prose td{border:1px solid var(--border); padding:9px 12px; text-align:left; vertical-align:top}
.prose th{background:color-mix(in srgb,var(--ink) 5%,transparent); font-weight:800}
.prose code{font-family:ui-monospace,Menlo,monospace; font-size:.9em; background:color-mix(in srgb,var(--ink) 8%,transparent); padding:2px 6px; border-radius:6px}
.prose hr{border:none; border-top:1px solid var(--border); margin:28px 0}
.src{max-width:780px; margin:22px auto 0; padding:12px 16px; background:var(--surface); border:1px solid var(--border); border-radius:12px; color:var(--muted); font-size:.85rem}
.post+.tags,.tags{max-width:780px; margin:14px auto 0}

/* ===== related ===== */
.related{max-width:900px; margin:34px auto 0} .related h2{font-size:1.15rem; font-weight:900; padding-left:11px; border-left:4px solid var(--accent); margin-bottom:14px}

/* ===== 團隊頁 ===== */
.teamintro{padding:4px 0 10px} .ti-lead{color:var(--muted); font-size:1rem; max-width:44em}
.teamgrid{display:grid; gap:18px; grid-template-columns:1fr; margin:14px 0 8px}
@media(min-width:720px){ .teamgrid{grid-template-columns:1fr 1fr} }
.teamapp{background:var(--surface); border:1px solid var(--border); border-top:4px solid var(--a); border-radius:16px; box-shadow:var(--shadow); padding:22px}
.ta-head{display:flex; align-items:baseline; gap:10px; flex-wrap:wrap} .ta-head h2{margin:0; font-size:1.3rem; font-weight:900; color:var(--a)}
.ta-tag{color:var(--muted); font-weight:700; font-size:.88rem} .ta-blurb{color:var(--muted); margin:8px 0 12px}
.ta-feat{list-style:none; padding:0; margin:0 0 16px} .ta-feat li{padding:5px 0; font-size:.94rem; border-bottom:1px dashed var(--border)}
.ta-feat li:last-child{border-bottom:none}

/* ===== buttons / cta ===== */
.appbtns{display:flex; flex-wrap:wrap; gap:9px}
.btn{font-size:.86rem; font-weight:700; padding:9px 15px; border-radius:10px; border:1px solid var(--border); color:var(--ink); background:transparent}
.btn:hover{text-decoration:none; border-color:var(--a,var(--accent))}
.btn.primary{background:var(--a,var(--accent)); border-color:transparent; color:#fff} .btn.primary:hover{filter:brightness(1.07)}
.cta{max-width:900px; margin:38px auto 10px; padding:24px 22px; background:var(--surface); border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow)}
.cta-h{margin:0 0 7px; font-size:1.2rem; font-weight:900} .cta-p{margin:0 0 16px; color:var(--muted); font-size:.95rem}
.appgrid{display:grid; gap:14px; grid-template-columns:1fr} @media(min-width:620px){ .appgrid{grid-template-columns:1fr 1fr} }
.appcard{border:1px solid var(--border); border-radius:14px; padding:17px; display:flex; flex-direction:column; gap:9px}
.appcard h3{margin:0; font-size:1.05rem; font-weight:800; color:var(--a)} .appcard h3 span{font-size:.8rem; color:var(--muted); font-weight:700; margin-left:6px}
.appcard p{margin:0; color:var(--muted); font-size:.9rem; flex:1}

/* ===== footer ===== */
.foot{margin-top:36px; padding:30px 16px; border-top:1px solid var(--border); background:var(--surface); text-align:center}
.foot-brand{font-weight:900; font-size:1.05rem} .foot-sub{color:var(--muted); font-size:.85rem; margin:6px auto 12px; max-width:40em}
.foot-links{display:flex; flex-wrap:wrap; gap:14px; justify-content:center; margin-bottom:12px}
.foot-links a{color:var(--muted); font-size:.88rem; font-weight:600} .foot-copy{color:var(--muted); font-size:.76rem}
.empty{color:var(--muted); text-align:center; padding:40px}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
a:focus-visible,.btn:focus-visible,.subchip:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.card,.btn,.hero{transition:transform .08s ease, border-color .15s ease, filter .15s ease}
