/* GLOWMAG 原型共享样式 · 对齐《前端完整设计文档》Design Tokens */
:root {
  --rose: #E8B4B8;
  --rose-light: #F5D8DA;
  --rose-pale: #FBF0F1;
  --plum: #6D2E46;
  --plum-dark: #552338;
  --cream: #FDFBF9;
  --ink: #1F1B1E;
  --gray: #8A8288;
  --gray-light: #EFEAEC;
  --coral: #FF6B6B;
  --gold: #C9A227;
  --success: #3EBD93;
  --warn: #F5A623;
  --error: #E5484D;
  --white: #fff;
  --radius-card: 12px;
  --radius-btn: 999px;
  --radius-input: 8px;
  --shadow-card: 0 2px 8px rgba(31,27,30,.06);
  --shadow-pop: 0 12px 32px rgba(31,27,30,.14);
  --font-title: "Playfair Display", "Noto Serif SC", Georgia, serif;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--ink); background: var(--cream); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ===== 布局 ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ===== 公告栏 ===== */
.announce { background: var(--plum); color: #fff; font-size: 13px; text-align: center; padding: 8px 16px; }
.announce b { color: var(--rose); }

/* ===== Header ===== */
.header { background: var(--white); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--gray-light); }
.header-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.logo { font-family: var(--font-title); font-size: 26px; font-weight: 700; letter-spacing: .5px; color: var(--plum); }
.logo span { color: var(--rose); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: all .15s; }
.nav a:hover { background: var(--rose-pale); color: var(--plum); }
.nav a.sale { color: var(--coral); font-weight: 700; }
.header-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; position: relative; transition: background .15s; }
.icon-btn:hover { background: var(--rose-pale); }
.icon-btn svg { width: 20px; height: 20px; stroke: var(--ink); }
.cart-badge { position: absolute; top: 2px; right: 0; background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.mobile-only { display: none; }

/* ===== 按钮 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-btn); font-weight: 600; font-size: 14px; padding: 0 24px; height: 44px; transition: all .15s ease-out; white-space: nowrap; }
.btn-primary { background: var(--plum); color: #fff; }
.btn-primary:hover { background: var(--plum-dark); transform: translateY(-1px); }
.btn-secondary { border: 1.5px solid var(--plum); color: var(--plum); background: transparent; }
.btn-secondary:hover { background: var(--plum); color: #fff; }
.btn-ghost { color: var(--plum); }
.btn-ghost:hover { background: var(--rose-pale); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { filter: brightness(.95); }
.btn-lg { height: 52px; padding: 0 36px; font-size: 15px; }
.btn-sm { height: 34px; padding: 0 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn.loading { color: transparent !important; position: relative; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }

/* ===== 徽章角标 ===== */
.badge { position: absolute; top: 10px; left: 10px; font-size: 10px; font-weight: 700; letter-spacing: .5px; padding: 3px 8px; border-radius: 4px; color: #fff; z-index: 2; }
.badge-new { background: var(--ink); }
.badge-sale { background: var(--coral); }
.badge-best { background: var(--gold); }
.badge-out { background: var(--gray); }

/* ===== 商品卡 ===== */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.pcard { position: relative; }
.pcard-img { position: relative; border-radius: var(--radius-card); overflow: hidden; aspect-ratio: 1; background: var(--rose-pale); }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s ease-out, transform .5s ease-out; }
.pcard-img img.img-hover { position: absolute; inset: 0; opacity: 0; }
.pcard:hover .pcard-img img.img-hover { opacity: 1; }
.pcard:hover .pcard-img img.img-main { opacity: 0; }
.pcard-quick { position: absolute; bottom: 10px; left: 10px; right: 10px; background: rgba(255,255,255,.95); border-radius: 8px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--plum); opacity: 0; transform: translateY(8px); transition: all .2s ease-out; backdrop-filter: blur(4px); }
.pcard:hover .pcard-quick { opacity: 1; transform: translateY(0); }
.pcard-quick:hover { background: var(--plum); color: #fff; }
.pcard-info { padding: 10px 2px 0; }
.pcard-title { font-size: 14px; font-weight: 600; }
.pcard-price { font-size: 14px; font-weight: 700; color: var(--plum); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pcard-price .compare { color: var(--gray); text-decoration: line-through; font-weight: 400; font-size: 13px; margin-left: 6px; }
.pcard-price .off { color: var(--coral); font-size: 12px; margin-left: 6px; font-weight: 700; }
.pcard-stock { font-size: 12px; color: var(--warn); margin-top: 2px; font-weight: 600; }

/* ===== 区块标题 ===== */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.section-title { font-family: var(--font-title); font-size: 32px; font-weight: 700; color: var(--ink); }
.section-link { font-size: 14px; font-weight: 600; color: var(--plum); border-bottom: 1.5px solid transparent; }
.section-link:hover { border-color: var(--plum); }

/* ===== 表单 ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input { width: 100%; height: 44px; border: 1.5px solid var(--gray-light); border-radius: var(--radius-input); padding: 0 14px; background: #fff; transition: border .15s; outline: none; }
.input:focus { border-color: var(--plum); }
.input.error { border-color: var(--error); }
.field-msg { font-size: 12px; color: var(--error); margin-top: 4px; display: none; }
.field.error .field-msg { display: block; }

/* ===== 卡片 ===== */
.card { background: #fff; border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 24px; border: 1px solid var(--gray-light); }

/* ===== toast ===== */
.toast-wrap { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-pop); animation: toastIn .25s ease-out; display: flex; align-items: center; gap: 8px; }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

/* ===== 抽屉/弹窗 ===== */
.overlay { position: fixed; inset: 0; background: rgba(31,27,30,.4); z-index: 200; opacity: 0; pointer-events: none; transition: opacity .25s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: -420px; width: 400px; max-width: 92vw; height: 100vh; background: #fff; z-index: 201; transition: right .25s ease-out; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
.drawer.open { right: 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--gray-light); font-weight: 700; font-size: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-foot { border-top: 1px solid var(--gray-light); padding: 16px 20px; background: #fff; }

.modal { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 16px; padding: 32px; max-width: 480px; width: 92vw; box-shadow: var(--shadow-pop); position: relative; animation: popIn .25s ease-out; max-height: 88vh; overflow-y: auto; }
.modal-x { position: absolute; top: 14px; right: 14px; }

/* ===== 进度条（免邮） ===== */
.ship-bar { background: var(--rose-pale); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.ship-bar b { color: var(--plum); }
.ship-track { height: 6px; background: #fff; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.ship-fill { height: 100%; background: linear-gradient(90deg, var(--rose), var(--plum)); border-radius: 3px; transition: width .4s ease-out; }

/* ===== 评分星 ===== */
.stars { color: var(--gold); font-size: 14px; letter-spacing: 1px; }
.stars .off { color: var(--gray-light); }

/* ===== 表格 ===== */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--gray); padding: 10px 12px; border-bottom: 2px solid var(--gray-light); font-weight: 700; }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--gray-light); vertical-align: middle; }
.table tr:hover td { background: var(--rose-pale); }

/* ===== 状态标签 ===== */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.tag-paid { background: #E5F6F0; color: var(--success); }
.tag-pending { background: #FEF4E0; color: var(--warn); }
.tag-ship { background: #E8EEFB; color: #3B6FD4; }
.tag-done { background: var(--gray-light); color: var(--gray); }
.tag-error { background: #FDE9EA; color: var(--error); }

/* ===== Cookie 同意横幅 ===== */
.consent-banner { position: fixed; left: 20px; bottom: 20px; z-index: 400; width: 360px; max-width: calc(100vw - 40px); background: #fff; border-radius: 14px; box-shadow: var(--shadow-pop); border: 1px solid var(--gray-light); padding: 18px; animation: fadeUp .3s ease-out both; }
.consent-banner a { color: var(--plum); text-decoration: underline; }

/* ===== 开关 ===== */
.switch { position: relative; width: 42px; height: 24px; background: var(--gray-light); border-radius: 12px; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--success); }
.switch.on::after { left: 20px; }

/* ===== 手风琴 ===== */
.acc { border: 1px solid var(--gray-light); border-radius: 10px; margin-bottom: 10px; background: #fff; overflow: hidden; }
.acc-q { width: 100%; text-align: left; padding: 16px 18px; font-weight: 600; font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.acc-q::after { content: "+"; font-size: 20px; color: var(--plum); transition: transform .2s; }
.acc.open .acc-q::after { transform: rotate(45deg); }
.acc-a { max-height: 0; overflow: hidden; transition: max-height .25s ease-out; font-size: 14px; color: var(--gray); }
.acc.open .acc-a { max-height: 420px; padding: 0 18px 16px; }
.acc-a > div { line-height: 1.7; }

/* ===== 页脚 ===== */
.footer { background: var(--plum); color: #fff; margin-top: 24px; }
.footer a { color: rgba(255,255,255,.75); font-size: 13px; }
.footer a:hover { color: var(--rose); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 56px 0 40px; }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; color: var(--rose); }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 20px 0; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: rgba(255,255,255,.55); }
.pay-icons { display: flex; gap: 8px; }
.pay-icons span { background: #fff; border-radius: 4px; padding: 2px 8px; font-size: 10px; font-weight: 700; color: var(--ink); }

/* ===== 面包屑 ===== */
.crumbs { font-size: 13px; color: var(--gray); padding: 18px 0; }
.crumbs a:hover { color: var(--plum); }

/* ===== 动画 ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .4s ease-out both; }

/* ===== 组件库 v2（各页重复样式统一上收）===== */
/* 排版令牌 */
.page-title { font-family: var(--font-title); font-size: 36px; line-height: 1.15; }
.page-sub { color: var(--gray); font-size: 15px; }

/* 双栏布局（≤768px 自动折叠单列） */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.split-side { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.split-wide { display: grid; grid-template-columns: 1fr 400px; gap: 32px; align-items: start; }
.acct { display: grid; grid-template-columns: 230px 1fr; gap: 28px; align-items: start; }

/* 账户侧导航 */
.acct-nav { position: sticky; top: 84px; }
.acct-nav a { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--gray); }
.acct-nav a.on, .acct-nav a:hover { background: var(--rose-pale); color: var(--plum); font-weight: 600; }
.acct-nav .sep { border-top: 1px solid var(--gray-light); margin: 10px 6px; }

/* 订单行卡 */
.ocard { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--gray-light); align-items: center; }
.ocard img { width: 64px; height: 64px; border-radius: 10px; }

/* 物流/订单时间线 */
.timeline { display: grid; }
.titem { display: grid; grid-template-columns: 28px 1fr; gap: 14px; position: relative; padding-bottom: 22px; }
.titem::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--gray-light); }
.titem:last-child::before { display: none; }
.titem .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--gray-light); display: flex; align-items: center; justify-content: center; font-size: 13px; z-index: 1; }
.titem.done .dot { background: var(--success); color: #fff; }
.titem.now .dot { background: var(--plum); color: #fff; animation: pulse 1.5s infinite; }
.titem b { font-size: 14px; }
.titem .tmeta { font-size: 12.5px; color: var(--gray); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(109,46,70,.4); } 50% { box-shadow: 0 0 0 8px rgba(109,46,70,0); } }

/* RMA 进度条 */
.rma-steps { display: flex; gap: 4px; margin-top: 10px; }
.rma-steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--gray-light); }
.rma-steps span.done { background: var(--success); }
.rma-steps span.now { background: var(--plum); }

/* 可选行（套装/配送/支付选项） */
.setopt { display: flex; gap: 12px; align-items: center; border: 1.5px solid var(--gray-light); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-size: 14px; transition: all .15s; background: #fff; margin-bottom: 10px; }
.setopt:hover { border-color: var(--rose); }
.setopt.sel { border-color: var(--plum); background: var(--rose-pale); }
.setopt input { accent-color: var(--plum); }

/* 偏好行 */
.prefrow { display: flex; justify-content:space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--gray-light); }
.prefrow:last-child { border: none; }

/* 数量步进器（全站统一） */
.qtybox { display: inline-flex; align-items: center; border: 1.5px solid var(--gray-light); border-radius: 10px; background: #fff; }
.qtybox button { width: 32px; height: 34px; font-size: 16px; color: var(--plum); border-radius: 8px; }
.qtybox button:hover { background: var(--rose-pale); }
.qtybox span { width: 36px; text-align: center; font-weight: 700; font-size: 14px; }

/* 购物车行 */
.crow { display: flex; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--gray-light); }
.crow img { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; }

/* 积分流水行 */
.led { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gray-light); font-size: 13.5px; }
.led .amt { font-weight: 700; font-variant-numeric: tabular-nums; }

/* 分类标签（非状态语义专用；tag-paid/pending/ship/done/error 只用于状态） */
.tag-cat { background: var(--rose-pale); color: var(--plum); }

/* 文章排版 */
.prose p { margin-bottom: 14px; line-height: 1.8; color: #3A3438; }
.prose li { margin: 0 0 8px 20px; line-height: 1.7; color: #3A3438; }
.prose h2 { font-family: var(--font-title); font-size: 24px; margin: 32px 0 12px; }
.prose .callout { background: var(--rose-pale); border-radius: 12px; padding: 16px 18px; margin: 20px 0; font-size: 14px; }

/* 星级计数 */
.stars .cnt { color: var(--gray); font-size: 12px; }

/* 焦点可达性 + 弹窗关闭钮 */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
.modal-x:hover { background: var(--rose-pale); border-radius: 8px; }

/* 商品卡悬停微缩放 */
.pcard:hover .pcard-img img { transform: scale(1.05); }

/* ===== 移动端导航抽屉 + 底部 TabBar ===== */
.mnav { position: fixed; top: 0; left: -300px; width: 280px; max-width: 82vw; height: 100vh; background: #fff; z-index: 201; transition: left .25s ease-out; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
.mnav.open { left: 0; }
.mnav-links { padding: 10px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.mnav-links a { padding: 12px 14px; border-radius: 10px; font-size: 15px; font-weight: 600; }
.mnav-links a:hover { background: var(--rose-pale); color: var(--plum); }
.mnav-links .sep { border-top: 1px solid var(--gray-light); margin: 10px 6px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; background: #fff; border-top: 1px solid var(--gray-light); display: none; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--gray); flex: 1; position: relative; }
.tabbar a svg { width: 22px; height: 22px; stroke: var(--gray); }
.tabbar a.on, .tabbar a:hover { color: var(--plum); }
.tabbar a.on svg, .tabbar a:hover svg { stroke: var(--plum); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split-wide { grid-template-columns: 1fr; }
  .split-side { grid-template-columns: 200px 1fr; }
}
@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-only { display: inline-flex; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .section-title { font-size: 26px; }
  .page-title { font-size: 30px; }
  .pcard-quick { opacity: 1; transform: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .split, .split-side, .split-wide, .acct { grid-template-columns: 1fr; }
  .grid-m-1 { grid-template-columns: 1fr !important; }
  .grid-m-2 { grid-template-columns: repeat(2, 1fr) !important; }
  .acct-nav { position: static; }
  .tabbar { display: flex; }
  body.has-tabbar { padding-bottom: 62px; }
  .consent-banner { left: 12px; right: 12px; bottom: 74px; width: auto; }
  .toast-wrap { top: 70px; width: calc(100vw - 32px); }
  .drawer { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
