/* —— 全新淺色質感主題 —— */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root{
  --bg:#f4f6fb;
  --fg:#0f172a;
  --muted:#6b7280;
  --card:#ffffff;
  --line:#e5e7eb;
  --brand:#18a168;
  --brand-ink:#ffffff;
  --chip:#eef2ff;
  --shadow:0 20px 50px rgba(15,23,42,0.1);
  --glow:linear-gradient(135deg, rgba(24,161,104,.1), rgba(96,165,250,.1));
}
*{box-sizing:border-box}
html,body{
  margin:0;
  min-height:100%;
  background:radial-gradient(circle at 10% 10%, rgba(24,161,104,.08), transparent 32%), radial-gradient(circle at 85% 0%, rgba(96,165,250,.12), transparent 28%), var(--bg);
  color:var(--fg);
  font-family:'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing:antialiased;
}
.wrap{max-width:1100px;margin:0 auto;padding:22px 18px 32px}

  /* 頂部 */
  .top{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px 16px;box-shadow:var(--shadow);}
  .brand{display:flex;align-items:center;gap:12px}
  .brand .brand-logo,
  .brand .brand-logo img{
    width:auto;
    height:40px;
    display:block;
    object-fit:contain;
  }
  .brand .t1{font-weight:800;font-size:18px;letter-spacing:.2px}
  .brand .t2{font-size:12px;color:var(--muted)}
  @media(max-width:640px){
    .brand .brand-logo,
    .brand .brand-logo img{
      height:32px;
    }
  }
  .top-tools{display:flex;flex-direction:column;gap:12px;align-items:flex-start;width:100%;}
  .filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;}
  @media(min-width:720px){.filters{grid-template-columns:200px 200px 1fr 1fr}}
  @media(min-width:960px){
    .top-tools{flex-direction:row;align-items:flex-start;}
    .top-tools .filters{flex:1;}
  }
.top-actions-right{display:flex;gap:12px;align-items:center;flex-wrap:wrap;justify-content:flex-end;}
  select,input{width:100%;padding:11px 12px;border:1px solid var(--line);background:linear-gradient(180deg,#fff, #f8fafc);color:var(--fg);border-radius:12px;font-weight:600;box-shadow:inset 0 1px 0 rgba(255,255,255,0.8);}

.auth-widget{display:flex;align-items:center;gap:10px;padding:10px 16px;border-radius:999px;border:1px solid var(--line);background:#fff;box-shadow:0 8px 18px rgba(15,23,42,.08);min-height:52px;}
.auth-widget .auth-status{font-size:13px;font-weight:700;color:#475569;}
.auth-widget.is-authed .auth-status{color:#15803d;}
.auth-btn{border:none;border-radius:999px;padding:8px 14px;font-weight:700;font-size:14px;background:linear-gradient(135deg,#18a168,#1095d6);color:#fff;cursor:pointer;box-shadow:0 10px 20px rgba(16,149,214,.25);transition:transform .2s ease,filter .2s ease;}
.auth-btn:hover{transform:translateY(-1px);filter:brightness(1.05);}
.auth-btn:disabled{opacity:.6;cursor:not-allowed;transform:none;filter:none;}
.guardian-badge{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  min-width:140px;
  border-radius:999px;
  background:linear-gradient(135deg,#fef3c7,#fde68a);
  border:1px solid #fbbf24;
  font-weight:800;
  font-size:14px;
  color:#b45309;
  box-shadow:0 6px 18px rgba(249,115,22,0.18);
  justify-content:center;
  line-height:1.2;
}
.guardian-badge img{
  width:20px;
  height:20px;
  object-fit:contain;
  filter:drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  flex:0 0 auto;
}
.top-actions-right .member-menu button,
.top-actions-right .auth-widget,
.top-actions-right .guardian-badge{
  min-height:52px;
  height:52px;
  padding:10px 16px;
  width:auto;
}
@media(max-width:640px){
  .top-actions-right{
    flex-wrap:wrap;
    width:100%;
    align-items:stretch;
    gap:8px;
  }
  .top-actions-right .member-menu{flex:1 1 48%;}
  .top-actions-right .auth-widget{flex:1 1 48%;}
  .top-actions-right .guardian-badge{flex:1 0 100%; min-width:0;}
  .top-actions-right .member-menu button,
  .top-actions-right .auth-widget,
  .top-actions-right .guardian-badge{
    width:100%;
    justify-content:center;
    min-height:50px;
    height:50px;
    border-radius:16px;
  }
  .top-actions-right .auth-widget{
    height:auto;
  }
  .auth-widget{gap:8px;padding:10px 12px;}
  .auth-btn{font-size:13px;}
  .guardian-badge{
    padding:10px 12px;
    font-size:13px;
    gap:6px;
  }
  .guardian-badge img{width:18px;height:18px;}
}
.hero-guardian-badge{
  position:relative;
  justify-content:flex-start;
  background:linear-gradient(135deg,#0f172a,#111827);
  color:#e2e8f0;
  border:1px solid rgba(148,163,184,.35);
  box-shadow:0 18px 36px rgba(0,0,0,.25);
  padding:8px 14px;
}
.hero-guardian-badge .guardian-menu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  min-width:180px;
  display:none;
  flex-direction:column;
  gap:4px;
  padding:6px;
  border-radius:12px;
  background:#0b1022;
  border:1px solid rgba(148,163,184,.25);
  box-shadow:0 18px 36px rgba(0,0,0,.35);
  z-index:30;
}
.hero-guardian-badge .guardian-menu.guardian-menu--open{
  display:flex;
}
.hero-guardian-badge .guardian-menu button,
.hero-guardian-badge .guardian-menu a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  padding:8px 10px;
  border-radius:10px;
  background:transparent;
  border:0;
  color:#e2e8f0;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
  cursor:pointer;
}
.hero-guardian-badge .guardian-menu button:hover,
.hero-guardian-badge .guardian-menu a:hover{
  background:rgba(255,255,255,.08);
}
.hero-guardian-badge .guardian-menu-badge{
  margin-left:auto;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}
.hero-modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(15,23,42,.6);
  z-index:40;
}
.hero-modal.is-visible{
  display:flex;
}
.hero-modal__content{
  background:#fff;
  padding:24px;
  border-radius:16px;
  max-width:320px;
  text-align:center;
  box-shadow:0 20px 40px rgba(15,23,42,.25);
}
.hero-modal__content h3{
  margin-top:0;
  margin-bottom:12px;
  font-size:20px;
}
.hero-modal__intro{
  margin:0 0 8px;
  color:#0f172a;
  line-height:1.6;
}
.hero-modal__hint{
  margin:0 0 18px;
  font-size:14px;
  color:#475569;
}
.hero-modal__content p{
  margin:0 0 18px;
  color:#475569;
}
.hero-modal__actions{
  display:flex;
  justify-content:center;
  gap:10px;
}
/* Order qty controls */
.order-qty-box{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:2px 4px;
  border-radius:14px;
}
.order-qty-box button{
  width:30px;
  height:30px;
  border-radius:8px;
  border:1px solid #e5e7eb;
  background:#fff;
  cursor:pointer;
  font-size:15px;
  line-height:1;
}
.order-qty-box .order-qty-input{
  width:54px;
  height:32px;
  padding:3px 6px;
  border-radius:8px;
  border:1px solid #e5e7eb;
  text-align:center;
  font-size:13px;
}
@media(max-width:640px){
  .order-qty-box{gap:6px;}
  .order-qty-box button{width:28px;height:28px;font-size:14px;}
  .order-qty-box .order-qty-input{width:50px;height:30px;font-size:12px;}
}
@media(max-width:640px){
  .top{flex-direction:column;align-items:flex-start;}
  .top-actions-right{width:100%;justify-content:flex-start;gap:10px;}
  .member-menu button{padding:8px 12px;font-size:13px;min-width:0;}
  .auth-widget{
    width:100%;
    max-width:320px;
    justify-content:center;
    flex-direction:column;
    align-items:stretch;
    gap:6px;
    padding:8px 10px;
    border-radius:14px;
    align-self:flex-end;
    text-align:center;
  }
  .auth-widget .auth-status{
    font-size:12px;
    font-weight:600;
    color:#0f172a;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .auth-btn{
    font-size:12px;
    padding:8px 12px;
    width:100%;
    justify-content:center;
  }
}
.pill-btn{
  border:1px solid #e2e8f0;
  background:linear-gradient(180deg,#ffffff 0%, #f8fafc 100%);
  border-radius:999px;
  padding:9px 16px;
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  box-shadow:0 10px 22px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.8);
  display:flex;
  align-items:center;
  gap:8px;
  color:#0f172a;
  text-decoration:none;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.pill-btn:hover{
  border-color:rgba(24,161,104,.35);
  box-shadow:0 14px 26px rgba(15,23,42,.14), inset 0 1px 0 rgba(255,255,255,.9);
  transform:translateY(-1px);
}
.member-menu{position:relative;}
.member-menu button{
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:10px 16px;
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(15,23,42,.08);
  display:flex;
  align-items:center;
  gap:8px;
  min-width:140px;
  justify-content:center;
}
.member-menu button:hover{border-color:rgba(24,161,104,.35);}
.member-menu button .member-menu-badge{
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:800;
  display:none;
  align-items:center;
  justify-content:center;
}
.member-menu button .member-menu-badge.show{display:inline-flex;}
.member-menu-panel{
  position:absolute;
  right:0;
  top:calc(100% + 6px);
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 14px 40px rgba(15,23,42,.18);
  padding:8px;
  display:none;
  min-width:180px;
  z-index:20;
}
.member-menu-panel a{
  display:block;
  padding:12px 14px;
  border-radius:12px;
  color:#0f172a;
  text-decoration:none;
  font-weight:800;
  font-size:14px;
}
.member-menu-panel a.qna-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.member-menu-panel .qna-badge{
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:800;
  display:none;
  align-items:center;
  justify-content:center;
}
.member-menu-panel .qna-badge.show{display:inline-flex;}
.member-menu-panel a:hover{background:linear-gradient(135deg, rgba(24,161,104,.08), rgba(16,149,214,.08));}

  /* 商品格 */
  .grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:10px}
  @media(max-width:640px){.grid{grid-template-columns:1fr;}}
  @media(min-width:900px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

  .hot-section{
    margin:6px 0 16px;
    background:var(--card);
    border:1px solid var(--line);
    border-radius:18px;
    padding:14px;
    box-shadow:0 12px 28px rgba(15,23,42,.08);
  }
  .hot-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
  .hot-meta{display:flex;flex-direction:column;gap:2px;}
  .hot-title{font-weight:800;font-size:18px;}
  .hot-sub{font-size:12px;color:var(--muted);}
  @media(max-width:640px){
    #hotSection{display:none !important;}
    #svcHotSection{display:none !important;}
  }
  .hot-grid{margin-top:0;gap:12px;}
  .hot-grid .card{border-color:#fde68a;box-shadow:0 10px 24px rgba(245,158,11,.18);}
  .hot-grid .card:hover{border-color:#f59e0b;}

  .card{background:var(--card);border:1px solid var(--line);border-radius:16px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 10px 30px rgba(15,23,42,.08);transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease;}
  .card:hover{transform:translateY(-4px);border-color:rgba(24,161,104,.25);box-shadow:0 18px 40px rgba(15,23,42,.12);}
  .card .pic{position:relative;background:linear-gradient(135deg, #f8fafc, #edf2ff);}
  /* 以 1:1 方形預覽框，圖片完整顯示（contain），不再被裁切 */
  .card .pic::before{content:"";display:block;padding-top:100%}
  .card .pic img{position:absolute;inset:0;margin:auto;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;image-rendering:auto;transition:transform .2s}
  .card .pic:hover img{transform:scale(1.03)}
  .card .body{padding:14px 14px 16px}
  .name{font-weight:800;font-size:16px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;min-height:44px;margin:0 0 8px;word-break:break-word;overflow:hidden;}
  .meta{font-size:12px;color:var(--muted);display:flex;flex-wrap:wrap;gap:6px 8px;margin:0 0 8px;line-height:1.4;}
  .meta.meta-top{margin:2px 0 6px;}
  .meta.meta-bottom{margin:0 0 8px;}
  .card .meta .badge{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    color:#334155;
    font-weight:700;
    border-radius:999px;
    padding:3px 10px;
  }
  .card .meta .badge-deity{
    background:linear-gradient(135deg,#fff7ed,#ffedd5);
    border-color:#fed7aa;
    color:#9a3412;
  }
  .card .meta .badge-sold{
    background:#eef2ff;
    border-color:#c7d2fe;
    color:#4338ca;
  }
  .card .meta .badge-stock.ok{
    background:#ecfdf3;
    border-color:#86efac;
    color:#166534;
  }
  .card .meta .badge-stock.zero{
    background:#fef2f2;
    border-color:#fecaca;
    color:#b91c1c;
  }
  .card .meta .badge-limited{
    background:#fff1f2;
    border-color:#fecdd3;
    color:#be123c;
  }
  .card .meta .badge-remaining{
    background:#f0fdf4;
    border-color:#86efac;
    color:#166534;
  }
  .meta.meta-limited{margin:0 0 6px;}
  .price{font-weight:800;margin-top:6px;font-size:17px}
  .cta{display:flex;gap:8px;margin-top:12px}
  .btn{
    flex:1;
    appearance:none;
    border:1px solid var(--line);
    background:#f9fafb;
    color:#0f172a;
    border-radius:12px;
    padding:11px 12px;
    font-size:15px;
    font-weight:800;
    cursor:pointer;
    text-align:center;
    transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }
  .btn:hover{transform:translateY(-2px);border-color:rgba(24,161,104,.3);box-shadow:0 10px 20px rgba(15,23,42,.12);}
  .btn.primary{background:linear-gradient(135deg,#18a168,#1095d6);border-color:#1095d6;color:#fff;box-shadow:0 10px 20px rgba(16,149,214,.25);}
  .btn.primary:hover{filter:brightness(1.03);}
  .btn:disabled{opacity:.6;cursor:not-allowed;transform:none;box-shadow:none;}
  .btn-sm{
    font-size:13px;
    padding:8px 12px;
  }
  .btn.link{
  background:#facc15;        /* 金色或亮黃色底 */
  border-color:#eab308;
  color:#111;                /* 黑色字 */
  text-decoration:none;      /* 移除底線 */
}
.btn.link:hover{
  filter:brightness(1.1);
}
.wishlist-btn{
  flex:0 0 auto;
  min-width:110px;
  background:#fff;
  color:#0f172a;
}
.wishlist-btn.active{
  background:#fee2e2;
  border-color:#f87171;
  color:#b91c1c;
}
  .empty{opacity:.85;padding:20px;text-align:center;border:1px dashed var(--line);border-radius:14px;margin-top:12px;background:var(--card)}
  .footer{margin:28px 0 8px;color:var(--muted);font-size:12px;text-align:center}
  .footer-contact{display:grid;gap:2px;justify-items:center}
  .footer-logos{
    display:flex;
    flex-wrap:nowrap;
    gap:8px;
    justify-content:center;
    align-items:center;
    margin:0 auto 12px;
    max-width:100%;
    overflow-x:auto;
    padding:2px 6px 6px;
    -webkit-overflow-scrolling:touch;
  }
  .footer-logos .logo-item{
    width:80px;height:32px;border-radius:8px;
    display:inline-flex;align-items:center;justify-content:center;
    background:#fff;border:1px solid #d1d5db;color:#1f2937;
    transition:transform .15s ease, box-shadow .15s ease;
    box-shadow:0 2px 6px rgba(15,23,42,.08);
    overflow:hidden;
    flex:0 0 auto;
  }
  .footer-logos .logo-item:hover{transform:translateY(-1px);box-shadow:0 6px 14px rgba(15,23,42,.12)}
  .footer-logos img{
    width:80%;
    height:80%;
    max-width:none;
    max-height:none;
    object-fit:contain;
    padding:0;
    display:block;
  }
  .footer-logos .logo-item--ecpay img{width:90%;height:90%;}
  .footer-social{display:flex;gap:8px;justify-content:center;margin-bottom:6px;}
  .footer-social .logo-item{
    width:32px;height:32px;border-radius:0;
    display:inline-flex;align-items:center;justify-content:center;
    background:transparent;border:none;color:#1f2937;
    box-shadow:none;overflow:hidden;
  }
  .footer-social img{
    width:100%;height:100%;
    max-width:none;
    max-height:none;
    object-fit:contain;
    padding:0;
    display:block;
  }

  /* 詳情 Dialog（白底） */
  dialog{border:1px solid var(--line);border-radius:16px;background:#fff;color:var(--fg);max-width:920px;width:96%;box-shadow:0 18px 60px rgba(15,23,42,.25);}
  .closeBar{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line);background:linear-gradient(135deg, rgba(24,161,104,.08), rgba(255,255,255,.2));border-radius:16px 16px 0 0;}
  .xbtn{appearance:none;background:rgba(15,23,42,.06);border:1px solid var(--line);color:#111;font-size:18px;cursor:pointer;border-radius:10px;width:34px;height:34px;display:grid;place-items:center;}
.dlgBody{display:grid;grid-template-columns:1fr;gap:18px;padding:16px}
@media(min-width:820px){.dlgBody{grid-template-columns:1fr 1fr}}
.dlgTitleBlock{display:grid;gap:6px;margin:2px 0 6px}
.dlgName{font-weight:800;font-size:18px;letter-spacing:.2px}
.dlgTags{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.dlgTag{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:999px;font-size:12px;font-weight:700;border:1px solid #e2e8f0;background:#f8fafc;color:#0f172a}
.dlgTag--deity{background:linear-gradient(135deg,#0f172a,#1f2937);border-color:#1f2937;color:#facc15}
.dlgTag--sold{background:#fff7ed;border-color:#fed7aa;color:#c2410c}
.dlgTag--limited{background:#fff1f2;border-color:#fecdd3;color:#be123c}
.dlgTag--remaining{background:#f0fdf4;border-color:#86efac;color:#166534}
.dlgStockVal{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:36px;padding:6px 12px;border-radius:10px;
  border:1px dashed #e2e8f0;background:#f8fafc;color:#475569;
  font-weight:700;font-size:13px;
}
.dlgStockVal.ok{border-color:#86efac;background:#ecfdf3;color:#166534}
.dlgStockVal.zero{border-color:#fecaca;background:#fef2f2;color:#b91c1c}
  .bigBox{position:relative;background:#f8fafc;border:1px solid var(--line);border-radius:14px;overflow:hidden;box-shadow:inset 0 1px 0 rgba(255,255,255,.9);}
  .bigBox::before{content:"";display:block;padding-top:100%}
  .big{position:absolute;inset:0;margin:auto;max-width:100%;max-height:100%;object-fit:contain}
  .thumbs{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
  .thumbs img{width:70px;height:70px;border-radius:10px;border:1px solid var(--line);object-fit:cover;cursor:pointer;background:#fff;transition:transform .15s ease, box-shadow .15s ease;}
  .thumbs img:hover{transform:translateY(-2px);box-shadow:0 8px 16px rgba(0,0,0,.12);}
  .row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .row .field{display:flex;flex-direction:column;gap:6px}
  label{font-size:12px;color:var(--muted)}
  .chip{display:inline-block;background:var(--chip);border:1px solid var(--line);border-radius:999px;padding:4px 10px;font-size:12px;color:#374151}

  /* 評價區 */
  .reviews{margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
  .rvItem{border:1px solid var(--line);border-radius:12px;padding:12px;margin:8px 0;background:#f9fafb;box-shadow:inset 0 1px 0 rgba(255,255,255,.9);}
  .rvHead{font-size:12px;color:#6b7280;margin-bottom:6px;display:flex;justify-content:space-between;align-items:center;gap:8px;}
  textarea{width:100%;min-height:110px;border:1px solid var(--line);border-radius:12px;padding:12px;resize:vertical;font-family:inherit;}

/* --- 左側神祇介紹側欄 --- */
.store{display:grid;grid-template-columns:260px 1fr;gap:16px;align-items:start}
@media(max-width: 900px){
  .store{grid-template-columns:1fr;}
  .store #sideDeities{order:-1; position: static;}
}
#sideDeities{position:sticky; top:16px; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px; z-index: 10;}
#sideDeities h3{margin:6px 0 10px; font-size:16px; font-weight:800;}
#sideDeities .list{display:flex; flex-direction:column; gap:6px; max-height:70vh; overflow:auto;}
#sideDeities .list a{display:block; font-size:14px; padding:8px 10px; border-radius:10px; border:1px solid var(--line); text-decoration:none; color:inherit; background:rgba(255,255,255,0.6); transition:all .18s ease;}
#sideDeities .list a:hover{background:#eef2ff; border-color:rgba(24,161,104,.25);}
/* 小工具區塊 */
#sideDeities .tools-box{margin-top:12px;padding-top:10px;border-top:1px dashed var(--line);}
#sideDeities .tools-box h4{margin:0 0 6px 0;font-size:14px;font-weight:800;color:#111827;}
#sideDeities .tool-card{background:rgba(255,255,255,0.6);border:1px solid var(--line);border-radius:12px;padding:10px;box-shadow:0 4px 12px rgba(0,0,0,0.06);}
#sideDeities .guardian-panel{display:grid;gap:8px;margin-top:10px;}
#sideDeities .guardian-panel.guardian-panel--flash{
  box-shadow:0 0 0 2px rgba(234,179,8,.35), 0 8px 20px rgba(15,23,42,.12);
}
#sideDeities .guardian-panel-title{font-size:12px;font-weight:800;color:#0f172a;}
#sideDeities .guardian-panel-name{font-size:16px;font-weight:800;color:#0f172a;display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
#sideDeities .guardian-panel-code{font-size:11px;font-weight:700;color:#1e293b;background:#eef2ff;border:1px solid #c7d2fe;border-radius:999px;padding:2px 6px;}
#sideDeities .guardian-panel-desc{font-size:12px;color:#475569;line-height:1.6;}
#sideDeities .guardian-panel-actions{display:flex;gap:8px;flex-wrap:wrap;}
#sideDeities .guardian-panel-actions a{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700;text-decoration:none;border:1px solid #e2e8f0;background:#fff;color:#0f172a;box-shadow:0 4px 10px rgba(15,23,42,.08);}
#sideDeities .guardian-panel-actions a.primary{background:#111827;color:#fff;border-color:#111827;}
#sideDeities .guardian-panel-list{display:grid;gap:6px;}
#sideDeities .guardian-panel-list-title{font-size:12px;font-weight:700;color:#111827;}
#sideDeities .guardian-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border-radius:10px;border:1px solid #e2e8f0;background:#fff;font-size:12px;color:#0f172a;cursor:pointer;}
#sideDeities .guardian-item span{flex:1;}
#sideDeities .guardian-item em{font-style:normal;font-weight:700;color:#16a34a;}

.side-cart{margin-bottom:12px;}
#cartFab{
  position:relative;
  right:auto;
  top:auto;
  bottom:auto;
  width:100%;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 14px;
  cursor:pointer;
  user-select:none;
  box-shadow:0 4px 12px rgba(0,0,0,.12);
}
#cartFab:hover{background:#f3f4f6;}
#cartBadge{display:inline-block; min-width:20px; height:20px; line-height:20px; text-align:center; border-radius:10px;
  background:#ef4444; color:#fff; font-size:12px; padding:0 6px;}
#cartFab .lbl{font-weight:700; flex:1; text-align:left;}
@media(max-width:900px){
  .side-cart{margin-bottom:16px;}
  #cartFab{justify-content:center;}
  #cartFab .lbl{flex:unset; text-align:center;}
}
#dlgCart{border:none; border-radius:16px; padding:0; max-width:760px; width:95%;}
.cartWrap{padding:16px;}
.cartHead{display:flex; align-items:center; justify-content:space-between; font-weight:800; font-size:18px; padding:10px 6px 6px;}
.cartList{display:flex; flex-direction:column; gap:10px; margin-top:8px; max-height:50vh; overflow:auto;}
.cartItem{display:grid; grid-template-columns:64px 1fr auto; gap:10px; align-items:center; border:1px solid var(--line); border-radius:12px; padding:8px;}
.cartItem img{width:64px; height:64px; object-fit:cover; border-radius:8px;}
.cartTitle{font-weight:700;}
.cartCtl{display:flex; align-items:center; gap:6px;}
.cartCtl input{width:56px; padding:6px 8px; border:1px solid var(--line); border-radius:8px; background:transparent; color:inherit;}
.cartSum{display:flex; align-items:center; justify-content:space-between; margin-top:12px; padding:10px; background:var(--card); border:1px solid var(--line); border-radius:12px;}
  .cartActions{display:flex; gap:8px; justify-content:flex-end; margin-top:10px; flex-wrap:wrap;}
  .cartActions .btn{
    min-width:140px;
    font-size:16px;
    font-weight:700;
  }
  @media(max-width:640px){
    .cartActions{flex-direction:column;}
    .cartActions .btn{min-width:0;width:100%;}
  }
@media(max-width:560px){
  .cartItem{grid-template-columns:1fr; grid-template-rows:auto; }
  .cartItem img{display:none;}
}

/* 統一 7-11 按鈕樣式（無底線＋字體一致） */
#cartGo711, #pay711, a#cartGo711.btn, a#pay711.btn {
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}

/* 付款按鈕質感升級（信用卡／貨到付款） */
#cartPayCC, #payCC, .pay-cc {
  background: linear-gradient(135deg, #18a168 0%, #0ea5e9 100%);
  border-color: #0ea5e9;
  color: #fff;
  box-shadow: 0 12px 22px rgba(14, 165, 233, 0.22);
}
#cartPayCC:hover, #payCC:hover, .pay-cc:hover {
  filter: brightness(1.04);
}

#cartGo711, #pay711, .pay-711 {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 55%);
  border-color: #f97316;
  color: #111827;
  box-shadow: 0 10px 18px rgba(249, 115, 22, 0.18);
  gap: 8px;
  padding-right: 12px;
}
#cartGo711:hover, #pay711:hover, .pay-711:hover {
  filter: brightness(1.02);
}

#cartGo711::after, #pay711::after, .pay-711::after {
  content: "";
  width: 26px;
  height: 26px;
  background: url("/img/brand/logo-711.svg") no-repeat center / contain;
  display: inline-block;
  flex: 0 0 auto;
}

/* Step3 修改門市按鈕（更小、更精緻） */
.store-edit-btn{
  padding:6px 12px;
  font-size:13px;
  font-weight:700;
  border-radius:999px;
  background:linear-gradient(180deg,#ffffff,#f1f5f9);
  border:1px solid #e2e8f0;
  color:#0f172a;
  box-shadow:0 6px 14px rgba(15,23,42,.08);
  width:auto;
  align-self:flex-start;
  justify-self:flex-start;
}
.store-edit-btn:hover{
  border-color:#cbd5f5;
  box-shadow:0 8px 18px rgba(15,23,42,.12);
}

/* 購物車優惠券 Dialog（卡片版） */
.coupon-dialog-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,0.55);
  z-index:2147483000;
  display:flex;
  align-items:center;
  justify-content:center;
  backdrop-filter:blur(2px);
}
.coupon-dialog-panel{
  background:#fff;
  border-radius:16px;
  box-shadow:0 20px 40px rgba(15,23,42,0.25);
  padding:16px;
  width:min(760px, 92vw);
  max-height:80vh;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.coupon-dialog-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.coupon-dialog-title{
  font-weight:800;
  font-size:16px;
}
.coupon-dialog-close{
  border:none;
  background:#f1f5f9;
  color:#475569;
  width:32px;
  height:32px;
  border-radius:999px;
  font-size:18px;
  cursor:pointer;
}
.coupon-dialog-list{
  display:grid;
  gap:10px;
  overflow:auto;
}
.coupon-card{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  background:#fff;
  display:grid;
  gap:8px;
}
@media(min-width:640px){
  .coupon-card{
    grid-template-columns:1fr auto;
    align-items:center;
  }
}
.coupon-code{font-weight:800;font-size:16px;}
.coupon-meta{color:#6b7280;font-size:13px;line-height:1.6;}
.coupon-chips{margin-top:6px;display:flex;flex-wrap:wrap;gap:6px;}
.coupon-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  background:#eef2ff;
  border:1px solid #c7d2fe;
  font-size:12px;
  color:#1d4ed8;
  font-weight:700;
}
.coupon-chip.ok{background:#dcfce7;border-color:#16a34a;color:#166534;}
.coupon-actions{display:flex;justify-content:flex-end;}
.coupon-actions .btn{
  flex:0 0 auto;
  padding:8px 12px;
  font-size:13px;
}

  /* --- Stage 1 additions (safe & minimal) --- */
  .badge{background:#111827;color:#eab308;border:1px solid #2b2f3a;border-radius:999px;padding:2px 8px;font-size:12px;font-weight:700;white-space:nowrap}
  @media(max-width:640px){ .badge{font-size:11px} }

  .skeleton-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:10px}
  @media(min-width:900px){.skeleton-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
  .skeleton-card{background:var(--card);border:1px solid var(--line);border-radius:14px;overflow:hidden;box-shadow:0 2px 10px rgba(17,24,39,.04);animation:pulse 1.2s ease-in-out infinite}
  .skeleton-pic{position:relative;background:#f3f4f6}
  .skeleton-pic::before{content:"";display:block;padding-top:100%}
  .skeleton-line{height:12px;background:#eee;border-radius:8px;margin:8px 12px}
  .skeleton-line.w60{width:60%}
  @keyframes pulse{0%{opacity:.6}50%{opacity:.95}100%{opacity:.6}}

/* cart close size */
#cartClose{padding:6px 10px;font-size:13px;border-radius:8px}

/* toast */
#toast{position:fixed;right:16px;bottom:84px;background:#111827;color:#eab308;border:1px solid #2b2f3a;border-radius:10px;padding:10px 12px;font-weight:700;opacity:0;transform:translateY(10px);transition:.25s;z-index:60}
#toast.show{opacity:1;transform:translateY(0)}

/* Toast 修正版：確保手機也會顯示 */
#toast{
  position:fixed;
  left:50%;
  bottom:100px;
  transform:translateX(-50%) translateY(20px);
  background:rgba(17,17,17,0.9);
  color:#eab308;
  border-radius:10px;
  padding:12px 18px;
  font-weight:700;
  font-size:15px;
  text-align:center;
  opacity:0;
  z-index:9999;
  transition:opacity .3s ease, transform .3s ease;
}
#toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
@media(max-width:640px){
  #toast{
    bottom:120px; /* 手機螢幕往上移一點避免被按鈕擋住 */
    font-size:16px;
    padding:14px 20px;
  }
}

/* category inside sidebar */
#sideDeities .cats{margin-top:12px;padding-top:10px;border-top:1px dashed var(--line)}
#sideDeities .cats h4{margin:0 0 8px 0;font-size:14px;color:#eab308;letter-spacing:.5px}
#sideDeities .cats .list{display:flex;flex-direction:column;gap:8px}
#sideDeities .cats .list button,
#sideDeities .side-cat-btn{
  all:unset;
  cursor:pointer;
  display:block;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:#0f172a;
  font-weight:700;
  text-align:left;
}
#sideDeities .cats .list button.active,
#sideDeities .side-cat-btn.active{
  background:#fff7ed;
  border-color:#fdba74;
  color:#c2410c;
}
@media(max-width:900px){
  #sideDeities{order:-1}
}

/* Hide min/max price inputs (UI only) */
#fMin, #fMax { display:none !important; }

/* fix: 7-11 buttons vertical align */
#pay711, #cartGo711 {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-decoration:none !important;
  line-height:1.4 !important;
}


  /* === 查詢訂單：狀態顏色標籤 === */
  .ok-badge{display:inline-block;border:1px solid #e5e7eb;border-radius:999px;padding:2px 8px;font-size:12px;font-weight:700}
  .ok-paid{color:#f59e0b;background:rgba(245,158,11,.08);border-color:#f59e0b}
  .ok-ship{color:#60a5fa;background:rgba(96,165,250,.08);border-color:#60a5fa}
  .ok-done{color:#34d399;background:rgba(52,211,153,.08);border-color:#34d399}
  .ok-muted{color:#6b7280;font-size:13px}
  .ok-card{border:1px solid #e5e7eb;border-radius:12px;padding:10px;background:#fff}
  .ok-items-grid{display:flex;flex-direction:column;gap:12px;margin:10px 0;}
  .ok-item{display:flex;gap:12px;align-items:flex-start;}
  .ok-item-img{width:64px;height:64px;border-radius:12px;background-size:cover;background-position:center;background-color:#f1f5f9;flex-shrink:0;overflow:hidden;}
  .ok-item-img img{width:100%;height:100%;object-fit:cover;display:block;border-radius:inherit;}
  .ok-item-img.placeholder{background:#e5e7eb;}
  .ok-item-info .name{font-weight:700;font-size:14px;color:#0f172a;}
  .ok-item-info .meta{font-size:12px;color:#94a3b8;margin-top:4px;}

  .cartSum div:last-child{ min-width:96px; text-align:right; }
/* 強制固定購物車關閉鈕尺寸與排版（最後載入，優先級最高） */
.cartHead .btn{flex:0 0 auto !important;}
#cartClose.btn, #cartClose.btn.link{
  padding:6px 10px !important;
  font-size:13px !important;
  border-radius:8px !important;
  line-height:1.2 !important;
}

  /* === 查詢訂單：狀態顏色標籤 === */
  .ok-badge{display:inline-block;border:1px solid #e5e7eb;border-radius:999px;padding:2px 8px;font-size:12px;font-weight:700}
  .ok-paid{color:#f59e0b;background:rgba(245,158,11,.08);border-color:#f59e0b}
  .ok-ship{color:#60a5fa;background:rgba(96,165,250,.08);border-color:#60a5fa}
  .ok-done{color:#34d399;background:rgba(52,211,153,.08);border-color:#34d399}
  .ok-muted{color:#6b7280;font-size:13px}
  .ok-card{border:1px solid #e5e7eb;border-radius:12px;padding:10px;background:#fff}
  .ok-items-grid{display:flex;flex-direction:column;gap:12px;margin:10px 0;}
  .ok-item{display:flex;gap:12px;align-items:flex-start;}
  .ok-item-img{width:64px;height:64px;border-radius:12px;background-size:cover;background-position:center;background-color:#f1f5f9;flex-shrink:0;overflow:hidden;}
  .ok-item-img img{width:100%;height:100%;object-fit:cover;display:block;border-radius:inherit;}
  .ok-item-img.placeholder{background:#e5e7eb;}
  .ok-item-info .name{font-weight:700;font-size:14px;color:#0f172a;}
  .ok-item-info .meta{font-size:12px;color:#94a3b8;margin-top:4px;}

.line-support-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:800;
  color:#14532d;
  background:linear-gradient(135deg,#ecfdf3 0%, #f0fdf4 100%);
  padding:10px 14px;
  border-radius:10px;
  margin-top:12px;
  text-decoration:none;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  border:1px solid rgba(34,197,94,.35);
  box-shadow:0 10px 18px rgba(16,185,129,.12);
}
.line-support-btn::before{
  content:"";
  width:18px;
  height:18px;
  display:inline-block;
  background:url("/img/brand/logo-line.png") center/contain no-repeat;
}
.line-support-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 24px rgba(16,185,129,.18);
  border-color:rgba(16,185,129,.55);
}
.line-support-btn:active{
  transform:translateY(0);
  box-shadow:0 4px 10px rgba(16,185,129,.2);
}
.line-support-btn:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(16,185,129,.18), 0 6px 14px rgba(16,185,129,.28);
}
#sideDeities .list a.line-support-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:10px;
  border:1px solid rgba(34,197,94,.35);
  background:linear-gradient(135deg,#ecfdf3 0%, #f0fdf4 100%);
  color:#14532d;
  font-weight:800;
  text-decoration:none;
  box-shadow:0 10px 18px rgba(16,185,129,.12);
  margin-top:0;
}
#sideDeities .list a.line-support-btn:hover{
  background:linear-gradient(135deg,#ecfdf3 0%, #f0fdf4 100%);
  border-color:rgba(16,185,129,.55);
  box-shadow:0 14px 24px rgba(16,185,129,.18);
}
/* === QUIZ LINK BUTTON === */
.quiz-link-btn{
  display:block;
  text-align:center;
  font-weight:700;
  color:#111827;
  background: linear-gradient(90deg, #fdf2f8 0%, #f5f3ff 100%);
  padding:10px 14px;
  border-radius:10px;
  margin-top:12px;
  text-decoration:none;
  transition:transform .2s ease, box-shadow .2s ease, filter .2s ease;
  border:1px solid #e5e7eb;
}
.quiz-link-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 14px rgba(139,92,246,.18);
  filter:saturate(1.03);
}
.quiz-link-btn:active{
  transform:translateY(0);
  box-shadow:0 2px 6px rgba(139,92,246,.18);
}
.quiz-link-btn:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(139,92,246,.25), 0 6px 14px rgba(139,92,246,.18);
}
/* === DLG BANK — Consolidated, single source of truth === */

/* 1) Scope + reset to avoid external collisions */
#dlgBank, #dlgBank * { box-sizing: border-box !important; }

/* 2) Dialog sizing and scroll behavior */
#dlgBank{
  max-height:90vh !important;
  overflow:auto !important;
  width:min(680px,96vw) !important;
}

/* 3) Kill legacy title/grid that previously caused misalignment */
#dlgBank .bankInfoGrid,
#dlgBank .bankHeader .bankTitle{
  display:none !important;
}

/* 4) Layout: force single-column in the dialog (beats any global .row rules) */
#dlgBank .row,
#dlgBank .bankRow{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:10px !important;
}
#dlgBank .row *[class$="field"],
#dlgBank .bankRow *[class$="field"]{
  width:100% !important;
}

/* 5) Field wrappers should not constrain width */
#dlgBank .bank-field,
#dlgBank form > div,
#dlgBank .field{
  width:100% !important;
  max-width:100% !important;
  margin:0 0 10px 0 !important;
  display:block !important;
}

/* 6) Unified control styles */
#dlgBank input[type="text"],
#dlgBank input[type="tel"],
#dlgBank input[type="email"],
#dlgBank input[type="number"],
#dlgBank input[type="file"],
#dlgBank select{
  width:100% !important;
  height:44px !important;
  padding:10px 12px !important;
  font-size:14px !important;
  line-height:1.3 !important;
  border:1px solid #e5e7eb !important;
  border-radius:10px !important;
  background:#fff !important;
}

/* Make file input truly full-width and tidy filename label */
#dlgBank input[type="file"]{
  display:block !important;
  width:100% !important;
  min-height:44px !important;
  padding:6px 8px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

/* File input button normalization (Safari/Chromium) */
#dlgBank input[type="file"]::-webkit-file-upload-button{
  padding:8px 12px !important;
  margin-right:8px !important;
  border:1px solid #e5e7eb !important;
  border-radius:8px !important;
  background:#f9fafb !important;
  font-size:14px !important;
  line-height:1.2 !important;
  cursor:pointer !important;
}
#dlgBank input[type="file"]::file-selector-button{
  padding:8px 12px !important;
  margin-right:8px !important;
  border:1px solid #e5e7eb !important;
  border-radius:8px !important;
  background:#f9fafb !important;
  font-size:14px !important;
  line-height:1.2 !important;
  cursor:pointer !important;
}

/* 7) Textarea sizing — visually balanced but multi-line */
#dlgBank textarea{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-height:112px !important;
  padding:10px 12px !important;
  font-size:14px !important;
  line-height:1.5 !important;
  border:1px solid #e5e7eb !important;
  border-radius:10px !important;
  resize:vertical !important;
}

/* 8) Remove number spinners for consistency */
#dlgBank input[type="number"]{
  -moz-appearance:textfield !important;
}
#dlgBank input[type="number"]::-webkit-outer-spin-button,
#dlgBank input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance:none !important;
  margin:0 !important;
}

/* 9) Ensure the "four-line" bank info stays tidy */
#dlgBank .line16{
  font-size:16px !important;
  font-weight:800 !important;
  line-height:1.2 !important;
  margin:4px 0 !important;
}

/* 10) Ensure copy button is compact and aligned */
#dlgBank #bankCopyAll{
  padding:4px 8px !important;
  font-size:12px !important;
  border-radius:8px !important;
}

/* 11) Safety: any nested grids default to single column inside dialog */
#dlgBank [class*="row"]{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:10px !important;
}

/* 12) Extra padding to avoid right-edge clipping */
/* 確保商品卡片圖片容器有尺寸 */
  .card .pic{ position:relative; background:#fff; }
  .card .pic, .card .pic .img-box{ width:100%; }
  .card .pic{ aspect-ratio: 1 / 1; overflow:hidden; }

  /* 強制圖片顯示且自適應 */
  .card .pic img{
    display:block !important;
    width:100% !important;
    height:100% !important;
    object-fit:contain !important; /* 若要滿版可改 cover */
    opacity:1 !important;
    visibility:visible !important;
  }

/* --- Enhanced Review/Story Item Styling (v2) --- */
.rvItem {
  display: flex;
  gap: 16px; /* Space between image and text */
  padding: 20px 0;
  border-bottom: 1px solid #e5e7eb;
  background: none;
  border-radius: 0;
  margin: 0;
  border-top: none;
  border-left: none;
  border-right: none;
}
/* Remove border from the last item */
#rvList > .rvItem:last-child {
  border-bottom: none;
}

/* The link wrapping the image */
.rvItem > a {
  flex-shrink: 0;
}

.rvImage {
  display: block;
  width: 72px; /* Smaller thumbnail */
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #e5e7eb;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.rvImage:hover {
  opacity: 0.85;
}

/* Container for all text content */
.rvContent {
  flex-grow: 1;
  min-width: 0; /* Fix for flexbox overflow */
}

.rvHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.rvNick {
  font-weight: 600;
  color: var(--fg);
}
.rvDate {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.rvMsg {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap; /* Preserve line breaks */
  margin-top: 4px;
  color: var(--fg);
  word-break: break-word; /* Prevent long text from breaking layout */
}
/* Empty state for reviews */
#rvList:empty::before {
  content: "還沒有人分享故事，成為第一個分享的人吧！";
  display: block;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
  margin-top: 8px;
}
