/* 小掌櫃會員區樣式　色票與字級照 brand/DESIGN.md v2 */

:root{
  --navy:#16395C; --navy-deep:#0E2740; --navy2:#1E4A75;
  --orange:#E8833A; --orange-deep:#cf6d27;
  --gold:#E8B24A; --gold-soft:#F4D58A;
  --seal:#C0392B;
  --paper:#F7F1E4; --paper2:#FBF7EE;
  --ink:#2C2620; --ink-soft:#6B6155;
  --cream-line:#E7DDC8;
  --line-green:#06C755;
  --shadow:0 12px 30px rgba(20,40,64,.10);
}

*{margin:0;padding:0;box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;}
body{
  font-family:"PingFang TC","Noto Sans TC","Microsoft JhengHei",sans-serif;
  color:var(--ink); background:var(--paper2);
  line-height:1.75; font-size:17px; -webkit-font-smoothing:antialiased;
  min-height:100vh; display:flex; flex-direction:column;
}
.serif{font-family:"Songti TC","Noto Serif TC",serif;}
a{color:var(--navy2);}

/* ===== 頁首 ===== */
header{background:var(--navy); border-bottom:3px solid var(--gold);}
.head-in{
  max-width:1000px; margin:0 auto; padding:0 20px;
  height:64px; display:flex; align-items:center; gap:12px;
}
.brand{display:flex; align-items:center; gap:10px; text-decoration:none;}
.brand img{width:38px; height:38px; border-radius:50%; flex:none;}
.brand b{color:#fff; font-size:19px; font-weight:900; line-height:1.15;}
.brand b i{color:var(--orange); font-style:normal;}
.brand .zh{display:inline-block;}
.brand small{display:block; font-size:10px; letter-spacing:3px; color:var(--gold-soft); font-weight:700;}
.head-right{margin-left:auto; display:flex; align-items:center; gap:16px;}
.head-right a{color:#fff; text-decoration:none; font-size:15px; font-weight:700; opacity:.9;}
.head-right a:hover{opacity:1;}

/* ===== 版心 ===== */
main{flex:1; width:100%; max-width:1000px; margin:0 auto; padding:44px 20px 64px;}
.narrow{max-width:440px; margin:0 auto;}

h1{font-size:28px; font-weight:900; color:var(--navy); line-height:1.4; letter-spacing:.5px;}
h2{font-size:22px; font-weight:900; color:var(--navy); line-height:1.4;}
.lead{color:var(--ink-soft); font-size:15px; margin-top:8px;}

/* ===== 卡片與表單 ===== */
.card{
  background:#fff; border:1px solid var(--cream-line); border-radius:16px;
  padding:30px 26px; box-shadow:var(--shadow);
}
.card + .card{margin-top:18px;}
.card-head{text-align:center; margin-bottom:22px;}
.card-head img{
  width:66px; height:66px; margin-bottom:12px; border-radius:50%;
  box-shadow:0 4px 12px rgba(20,40,64,.18);
}

.field{margin-bottom:16px;}
.field label{display:block; font-size:14px; font-weight:700; color:var(--navy); margin-bottom:6px;}
.field .hint{font-size:13px; color:var(--ink-soft); font-weight:400; margin-left:4px;}
.field input[type=text], .field input[type=email], .field input[type=password]{
  width:100%; padding:12px 14px; font-size:16px; font-family:inherit; color:var(--ink);
  background:var(--paper2); border:1px solid var(--cream-line); border-radius:11px;
}
.field input:focus{outline:none; border-color:var(--orange); background:#fff;}

.check{display:flex; gap:10px; align-items:flex-start; margin:20px 0 6px;}
.check input{width:19px; height:19px; margin-top:3px; flex:none; accent-color:var(--orange);}
.check label{font-size:14px; color:var(--ink-soft); line-height:1.6;}

/* ===== 按鈕 ===== */
.btn{
  display:block; width:100%; padding:14px; border:none; border-radius:13px;
  background:var(--orange); color:#fff; font-size:17px; font-weight:900;
  font-family:inherit; cursor:pointer; text-align:center; text-decoration:none;
}
.btn:hover{background:var(--orange-deep);}
.btn.ghost{background:var(--paper); color:var(--navy); border:1px solid var(--cream-line);}
.btn.ghost:hover{background:var(--cream-line);}

.alt{text-align:center; margin-top:20px; font-size:14px; color:var(--ink-soft);}
.alt a{color:var(--navy2); font-weight:700;}

/* ===== 提示訊息 ===== */
.msg{
  padding:13px 16px; border-radius:11px; font-size:15px; margin-bottom:20px;
  border-left:4px solid;
}
.msg.err{background:#FDF0EE; border-color:var(--seal); color:#8E2A1F;}
.msg.ok{background:#EEF6EF; border-color:#2F7D4F; color:#245F3C;}
.msg.info{background:var(--paper); border-color:var(--gold); color:#6A4E12;}

/* ===== 我的工具包 ===== */
.packs{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px; margin-top:22px;}
.pack{
  background:#fff; border:1px solid var(--cream-line); border-radius:15px; padding:20px;
  display:flex; flex-direction:column; gap:8px;
}
.pack .ico{font-size:30px; line-height:1;}
.pack h3{font-size:17px; font-weight:900; color:var(--navy);}
.pack p{font-size:14px; color:var(--ink-soft); flex:1;}
.pack .btn{padding:11px; font-size:15px; margin-top:6px;}

.empty{
  background:#fff; border:1px dashed var(--cream-line); border-radius:15px;
  padding:36px 24px; text-align:center; color:var(--ink-soft); margin-top:22px;
}
.empty img{width:96px; margin-bottom:14px;}

/* ===== 頁尾 ===== */
footer{
  background:var(--navy-deep); color:#B9C7D6; text-align:center;
  padding:26px 20px; font-size:13px;
}
footer a{color:var(--gold-soft); text-decoration:none;}

@media (max-width:520px){
  body{font-size:16px;}
  main{padding:30px 16px 48px;}
  .card{padding:24px 18px;}
  h1{font-size:24px;}
  .brand small{display:none;}
}

/* ===== 導購區（還沒買的包） ===== */
.more{margin-top:44px; padding-top:32px; border-top:1px solid var(--cream-line);}
.pack.locked{background:var(--paper2);}
.pack.locked .ico{opacity:.55;}

/* ===== 安裝教學頁 ===== */
.back{font-size:15px; font-weight:700; text-decoration:none;}
.guide{margin-top:14px; overflow-wrap:break-word;}
.guide h1{font-size:24px; margin-bottom:6px;}
.guide h2{margin-top:28px;}
.guide h3{font-size:17px; font-weight:900; color:var(--navy); margin-top:20px;}
.guide p, .guide li{font-size:16px;}
.guide ul, .guide ol{padding-left:24px; margin:8px 0;}
.guide li{margin:4px 0;}
.guide hr{border:none; border-top:1px solid var(--cream-line); margin:24px 0;}
.guide code{
  font-family:ui-monospace,Menlo,monospace; font-size:14px;
  background:var(--paper); border:1px solid var(--cream-line);
  border-radius:6px; padding:1px 6px;
}
.guide pre{overflow-x:auto; background:var(--paper); border:1px solid var(--cream-line);
  border-radius:10px; padding:14px 16px; margin:10px 0;}
.guide pre code{background:none; border:none; padding:0;}
.guide table{border-collapse:collapse; width:100%; margin:12px 0; font-size:15px;}
.guide th, .guide td{border:1px solid var(--cream-line); padding:8px 10px; text-align:left;}
.guide th{background:var(--paper);}

/* ===== 窄螢幕導覽列（375px 實測字會斷行，鎖住不換行） ===== */
@media (max-width:480px){
  .head-in{gap:8px; padding:0 12px;}
  .brand b{font-size:15px;}
  .brand small{display:none;}
  .brand img{width:32px; height:32px;}
  .head-right{gap:10px;}
  .head-right a{font-size:13px; white-space:nowrap;}
}

/* ===== 開通後台 ===== */
.tbl-wrap{overflow-x:auto; margin-top:14px; background:#fff; border:1px solid var(--cream-line); border-radius:12px;}
.tbl-wrap table{border-collapse:collapse; width:100%; font-size:14px; min-width:640px;}
.tbl-wrap th, .tbl-wrap td{padding:9px 12px; border-bottom:1px solid var(--cream-line); text-align:left; white-space:nowrap;}
.tbl-wrap th{background:var(--paper); font-weight:900; color:var(--navy);}
.tbl-wrap tr:last-child td{border-bottom:none;}

/* ===================================================================
   結帳頁：左說明、右結帳（2026-09-10）
   桌機兩欄、結帳卡吸附；窄螢幕自動疊成上下，付款動線不變長。
   =================================================================== */

.buy-wrap{
  display:grid; gap:26px 34px; max-width:1080px; margin:0 auto;
  grid-template-columns:minmax(0,1fr) 420px;
  grid-template-areas:
    "head pay"
    "detail pay";
  align-items:start;
}
.bi-head{grid-area:head;}
.bi-detail{grid-area:detail; min-width:0;}
.buy-checkout{grid-area:pay;}

/* ---- 商品身分：書封＋名稱 ---- */
.bi-head{display:flex; gap:26px; align-items:flex-start;}
.bi-intro{padding-top:6px;}
.bi-intro h1{font-size:26px; margin-bottom:6px;}
.bi-intro .saves{
  display:inline-block; background:#FBEEE2; color:var(--orange-deep);
  border:1px solid #F0DCC6; font-size:12px; font-weight:800;
  padding:4px 11px; border-radius:999px; margin-bottom:10px;
}

.bi-block{
  background:#fff; border:1px solid var(--cream-line); border-radius:14px;
  padding:22px 24px; margin-bottom:16px; box-shadow:var(--shadow);
}
.bi-block h2{font-size:18px; margin-bottom:12px;}
.bi-block h3{font-size:16px; font-weight:900; color:var(--navy); margin-bottom:8px;}

.ticks{list-style:none;}
.ticks li{
  position:relative; padding-left:28px; margin-bottom:11px;
  font-size:15px; line-height:1.75; color:var(--ink);
}
.ticks li::before{
  content:"✓"; position:absolute; left:0; top:1px;
  width:19px; height:19px; border-radius:50%;
  background:var(--orange); color:#fff;
  font-size:12px; font-weight:900; line-height:19px; text-align:center;
}
.ticks li:last-child{margin-bottom:0;}

.files{list-style:none;}
.files li{
  display:flex; gap:12px; align-items:baseline; flex-wrap:wrap;
  padding:9px 0; border-bottom:1px dashed var(--cream-line);
}
.files li:last-child{border-bottom:none;}
.files code{
  flex:none; background:var(--paper); border:1px solid var(--cream-line);
  border-radius:6px; padding:2px 8px; font-size:13px; color:var(--navy);
  font-family:"SF Mono",Menlo,Consolas,monospace;
}
.files span{font-size:14px; color:var(--ink-soft);}
.bi-note{margin-top:12px; font-size:14px; color:var(--ink-soft); line-height:1.7;}
.bi-note b{color:var(--navy);}

.bi-block.need{background:var(--paper); border-left:4px solid var(--gold);}
.bi-block.need p{font-size:14.5px; line-height:1.8; color:var(--ink-soft);}
.bi-block.need b{color:var(--navy);}

.bi-promise{display:flex; gap:10px; flex-wrap:wrap; margin-top:4px;}
.bi-promise .stamp{
  display:inline-flex; align-items:center; gap:7px;
  background:#fff; border:1px solid var(--cream-line); border-radius:999px;
  padding:7px 15px 7px 8px; font-size:13.5px; font-weight:800; color:var(--navy);
}
.bi-promise .stamp i{
  width:22px; height:22px; border-radius:5px; flex:none;
  background:var(--seal); color:#fff; font-style:normal;
  font-family:"Songti TC",serif; font-size:13px; font-weight:700;
  line-height:22px; text-align:center;
}

/* ---- 線裝書封（與官網武器庫同一套視覺） ---- */
.book3d{
  position:relative; width:158px; height:234px; flex:none;
  display:flex; align-items:flex-start; justify-content:center; padding-top:18px;
  border-radius:3px 6px 6px 3px;
  background:linear-gradient(150deg,#63809F,#44607F);
  box-shadow:
    2px 0 0 #EEF2F6, 3px 0 0 #CCD6DF,
    5px 0 0 #F5F8FA, 6px 0 0 #CCD6DF,
    8px 0 0 #F5F8FA, 9px 0 0 #C4CFD9,
    12px 18px 26px rgba(20,40,64,.22);
  transform:rotate(-1deg);
}
.book3d::before{
  content:""; position:absolute; left:0; top:12px; bottom:12px; width:12px;
  border-right:2px solid rgba(255,255,255,.72);
  background:repeating-linear-gradient(180deg,transparent 0 25px,rgba(255,255,255,.78) 25px 28px,transparent 28px 53px);
}
.book3d::after{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:linear-gradient(105deg,rgba(255,255,255,.14) 0 16%,transparent 34%);
}
.book3d .blabel{
  background:#F7F3E8; border:1px solid #B9B19D; border-radius:2px;
  box-shadow:inset 0 0 0 3px #F7F3E8, inset 0 0 0 4px #C9BFA4, 0 3px 9px rgba(0,0,0,.32);
  min-height:186px; padding:13px 9px 10px; margin:0 auto;
  display:flex; flex-direction:column; align-items:center;
  justify-content:space-between; gap:9px; position:relative; z-index:2;
}
.book3d .bcols{display:flex; flex-direction:row-reverse; gap:8px; align-items:flex-start; justify-content:center;}
.book3d .btitle{
  writing-mode:vertical-rl; text-orientation:upright;
  font-family:"Kaiti TC","BiauKai","DFKai-SB","Songti TC","Noto Serif TC",serif;
  font-weight:700; font-size:17px; letter-spacing:4px; line-height:1;
  color:#241F18; margin:0;
}
.book3d .bsub{
  writing-mode:vertical-rl; text-orientation:upright;
  font-family:"Kaiti TC","BiauKai","DFKai-SB","Songti TC","Noto Serif TC",serif;
  font-weight:400; font-size:10.5px; letter-spacing:2.5px; line-height:1;
  color:#7B7164; margin-top:5px;
}
.book3d .bseal{
  background:#C23B2E; color:#fff; font-family:"Songti TC",serif;
  font-size:11px; font-weight:700; line-height:1; padding:4px 5px; border-radius:2px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);
}

/* ---- 右欄：結帳卡 ---- */
.buy-checkout{position:sticky; top:20px;}
.checkout-card{padding:26px 24px;}

.co-price{
  text-align:center; padding-bottom:18px; margin-bottom:20px;
  border-bottom:1px dashed var(--cream-line);
}
.co-price .was{
  display:inline-block; text-decoration:line-through;
  color:#9B9184; font-size:15px; margin-right:8px;
}
.co-price .tag{
  display:inline-block; background:var(--seal); color:#fff;
  font-size:11.5px; font-weight:900; padding:3px 9px; border-radius:999px;
  vertical-align:2px;
}
.co-price .now{
  display:block; font-size:33px; font-weight:900; color:var(--navy);
  line-height:1.25; margin-top:6px; letter-spacing:.5px;
}
.co-price .co-once{display:block; font-size:13px; color:var(--ink-soft); margin-top:4px;}

/* ---- 加購橫幅（只是連到整套帶走的結帳頁，不動金額邏輯） ---- */
.upsell{
  display:block; margin-top:16px; text-decoration:none;
  background:linear-gradient(160deg,var(--navy),var(--navy-deep));
  border-radius:14px; padding:18px 20px; box-shadow:var(--shadow);
  transition:transform .15s;
}
.upsell:hover{transform:translateY(-2px);}
.upsell .up-tag{
  display:inline-block; background:var(--gold); color:#3A2A10;
  font-size:11.5px; font-weight:900; padding:3px 10px; border-radius:999px;
  margin-bottom:9px;
}
.upsell b{display:block; color:#fff; font-size:16px; line-height:1.6; margin-bottom:5px;}
.upsell .up-sub{display:block; color:#C9D5E2; font-size:13.5px; line-height:1.7;}
.upsell .up-go{white-space:nowrap; color:var(--gold-soft); font-weight:800;}

/* ---- 窄螢幕：疊成上下，說明收斂、付款動線不變長 ---- */
@media (max-width:900px){
  .buy-wrap{
    grid-template-columns:minmax(0,1fr); gap:20px; max-width:520px;
    grid-template-areas:
      "head"
      "pay"
      "detail";
  }
  .buy-checkout{position:static;}
  .bi-head{gap:18px;}
}
@media (max-width:560px){
  /* 窄螢幕檔名與用途分兩行，用途縮排對齊，不要一長串黏在一起 */
  .files li{flex-direction:column; gap:4px; padding:10px 0;}
  .files span{padding-left:2px;}
  .bi-block{padding:20px 18px;}
}
@media (max-width:420px){
  .bi-head{flex-direction:column; align-items:center; text-align:center;}
  .book3d{width:140px; height:208px;}
  .book3d .blabel{min-height:164px;}
}
