/* Mail Majiang - 纯静态站点样式表（零 JS / 零外部资源） */

:root {
  --dark: #393D49;
  --dark-b: #404553;
  --teal: #009688;
  --teal-d: #00766C;
  --amber: #FFB800;
  --red: #FF0000;
  --orange: #FF4400;
  --green: #047857;
  --bg: #FAF7F2;
  --line: #E6E6E6;
  --line2: #F2F2F2;
  --txt: #333;
  --txt2: #666;
  --txt3: #888;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Tahoma, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  padding-top: 61px;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-d); }

table { border-collapse: collapse; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* ---------------- 顶栏 ---------------- */

.hdr {
  position: fixed; left: 0; top: 0; width: 100%; height: 60px; z-index: 1000;
  background: var(--dark); border-bottom: 1px solid var(--dark-b);
}
.hdr-inner {
  width: 100%; max-width: 1170px; margin: 0 auto; padding: 0 15px;
  height: 60px; display: flex; align-items: center;
}

.brand { flex: none; display: flex; flex-direction: column; justify-content: center; margin-right: 16px; }
.brand:hover { text-decoration: none; }
.brand-name {
  color: #fff; font-weight: 700; font-size: 19px; line-height: 1.1;
  letter-spacing: .3px; white-space: nowrap;
}
.brand-sub {
  color: rgba(255, 255, 255, .62); font-size: 10.5px; line-height: 1.3;
  letter-spacing: .2px; white-space: nowrap;
}

.nav { display: flex; align-items: center; margin-left: 16px; }
.nav a {
  padding: 0 20px; line-height: 60px; height: 60px;
  font-size: 14px; color: rgba(255, 255, 255, .85);
}
.nav a:hover { color: #fff; }
.nav a.on { color: #fff; }

.bal { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.bal-label { color: rgba(255, 255, 255, .7); font-size: 13px; }
.bal-num { color: #fff; font-family: Arial, sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .8px; }
.bal-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #4b5162;
  border: 1px solid #5a6072; color: rgba(255, 255, 255, .8);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}

/* 汉堡按钮 + 抽屉（纯 CSS :target） */
.menu-btn {
  display: none; margin-left: auto; padding: 8px 4px;
  flex-direction: column; gap: 4px;
}
.menu-btn span { width: 20px; height: 2px; background: #fff; display: block; }

/* fixed 容器：:target 时浏览器不会滚动页面，抽屉开合不影响阅读位置 */
.drawer { display: none; position: fixed; inset: 0; z-index: 1100; }
.drawer:target { display: block; }
.drawer-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); display: block; }
.drawer-panel {
  position: absolute; left: 0; top: 0; bottom: 0; width: 200px;
  background: var(--dark); padding: 14px 0; overflow-y: auto;
}
.drawer-hd { color: rgba(255, 255, 255, .5); font-size: 12px; padding: 0 20px 12px; }
.drawer-panel a {
  display: block; color: rgba(255, 255, 255, .85);
  padding: 0 20px; line-height: 44px; font-size: 14px;
}
.drawer-panel a.on { color: #fff; background: rgba(255, 255, 255, .06); }

/* ---------------- 布局 ---------------- */

.wrap { flex: 1; width: 100%; max-width: 1170px; margin: 0 auto; padding: 15px 15px 0; }
.narrow-wrap { max-width: 760px; margin: 0 auto; }
.mid-wrap { max-width: 820px; margin: 0 auto; }
.wide-wrap { max-width: 900px; margin: 0 auto; }

.sec-title {
  height: 40px; display: flex; align-items: center; width: 100%;
  margin: 0 0 5px; font-weight: 700; font-size: 14px; color: var(--txt);
}
.sec-title::before, .sec-title::after { content: ""; flex-grow: 1; height: 1px; background: var(--line2); }
.sec-title span { margin: 0 5px; }

/* ---------------- 公告 ---------------- */

.notice {
  background: #fff; border-left: 5px solid var(--teal); border-radius: 0 2px 2px 0;
  padding: 15px; line-height: 22px; margin: 0 0 10px; color: var(--txt2); font-size: 14px;
}
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin-bottom: 0; }
.notice .warn { color: var(--red); }
.notice strong { color: var(--txt); }
.notice .rate { color: var(--teal); }
.notice a { font-weight: 700; text-decoration: underline; }

/* ---------------- 商品列表 ---------------- */

.group { background: #fff; border-radius: 2px; margin-bottom: 15px; }

.group-hd {
  display: grid;
  grid-template-columns: 40px 1fr 100px 84px 96px 120px;
  align-items: center; gap: 0 10px;
  background: #F2F2F2; border: 1px solid var(--line);
  padding: 9px 15px; min-height: 39px;
}
.group-title { grid-column: 1 / 3; margin: 0; font-size: 16px; font-weight: 600; color: #1F1F1F; }
.col-h { font-size: 14px; font-weight: 400; color: var(--txt2); text-align: center; }
.group-count { display: none; font-size: 12px; color: var(--txt3); }

.row {
  display: grid;
  grid-template-columns: 40px 1fr 100px 84px 96px 120px;
  align-items: center; gap: 0 10px;
  background: #fff; border: 1px solid var(--line); border-top: 0;
  padding: 9px 15px;
}
.row:hover { background: #FAFAFA; }

.thumb {
  width: 40px; height: 40px; flex: none; border-radius: 2px;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; text-align: center;
}
.p-title { font-size: 14px; color: var(--txt2); line-height: 20px; }

.cell-mode, .cell-stock, .cell-price, .cell-act { text-align: center; }

.badge {
  display: inline-block; height: 20px; line-height: 20px; padding: 0 6px;
  border-radius: 2px; background: var(--teal); color: #fff; font-size: 12px;
}
.stock { font-weight: 700; font-size: 15px; white-space: nowrap; color: var(--green); }
.stock.out { color: #9CA3AF; }
.price {
  color: var(--red); font-family: Arial, sans-serif; font-weight: 700;
  font-size: 16px; letter-spacing: .8px; white-space: nowrap;
}

.btn {
  display: inline-block; height: 30px; line-height: 30px; padding: 0 20px;
  border: 0; border-radius: 2px; background: var(--amber); color: #fff;
  font-size: 14px; text-align: center; cursor: pointer;
}
.btn:hover { background: #F0AC00; color: #fff; }
.btn.out { background: #D8D8D8; cursor: not-allowed; }
.btn.out:hover { background: #D8D8D8; }
.btn-teal { background: var(--teal); }
.btn-teal:hover { background: var(--teal-d); }

/* ---------------- 文章 / 标签 ---------------- */

.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.news-box { border: 1px solid var(--line2); background: #fff; }
.news-hd {
  background: var(--line2); padding: 0 15px; line-height: 2.5;
  overflow: hidden; font-size: 14px; color: var(--txt);
}
.news-hd .more { float: right; color: var(--teal); font-size: 14px; }
.news-list { padding: 0 10px; margin: 0; list-style: none; }
.news-list li {
  line-height: 30px; border-bottom: 1px solid var(--line2);
  display: flex; align-items: center; gap: 8px;
}
.news-list li:last-child { border-bottom: 0; }
.n-idx {
  flex: none; width: 19px; height: 20px; line-height: 20px; text-align: center;
  background: var(--teal); color: #fff; font-size: 12px; border-radius: 2px;
}
.n-title {
  flex: 1; min-width: 0; font-size: 14px; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.n-date { flex: none; font-size: 14px; color: var(--txt3); }

.center-act { text-align: center; margin: 20px 0 10px; }

.tags { text-align: center; }
.tag {
  display: inline-block; height: 30px; line-height: 30px; padding: 0 10px;
  margin: 0 3px 8px; border-radius: 2px; background: #EFEFEF;
  color: #6E6A6A; font-size: 12px; white-space: nowrap;
}
.tag:hover { background: #E4E4E4; color: #6E6A6A; }

/* ---------------- 表单 / 卡片 ---------------- */

.panel { background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 15px; }
.panel-hd {
  background: var(--line2); padding: 0 15px; line-height: 2.5;
  font-size: 14px; color: var(--txt);
  display: flex; align-items: center; justify-content: space-between;
}

.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.tabs a {
  padding: 0 15px; line-height: 36px; font-size: 14px;
  color: var(--txt2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.on { color: var(--teal); border-bottom-color: var(--teal); }

.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row input {
  flex: 1; min-width: 220px; height: 38px; border: 1px solid var(--line);
  border-radius: 2px; padding: 0 10px; outline: none; color: var(--txt2);
  font: inherit; background: #fff;
}
.form-row input:focus { border-color: var(--teal); }
.btn-lg { height: 38px; line-height: 38px; padding: 0 24px; }

.hint { font-size: 12px; color: var(--txt3); margin-top: 10px; }
.hint strong { font-family: Arial, sans-serif; }

.kv { width: 100%; font-size: 14px; color: var(--txt2); }
.kv th {
  text-align: left; width: 110px; padding: 9px 15px;
  border: 1px solid var(--line); background: #FAFAFA; font-weight: 400;
}
.kv td { padding: 9px 15px; border: 1px solid var(--line); }
.kv .num { font-family: Arial, sans-serif; font-weight: 700; }
.kv .total { color: var(--orange); font-family: Arial, sans-serif; font-weight: 700; font-size: 16px; }

.acct-box { padding: 15px; }
.acct-label { font-size: 12px; color: var(--txt3); margin-bottom: 8px; }
.acct {
  display: block; background: #FAFAFA; border: 1px dashed #DBDBDB; border-radius: 2px;
  padding: 9px 12px; margin-bottom: 8px; font-family: var(--mono);
  letter-spacing: 1px; font-size: 14px; color: var(--txt); word-break: break-all;
  user-select: all;
}

/* ---------------- 常见问题 ---------------- */

.faq { background: #fff; border: 1px solid var(--line); border-radius: 2px; }
.faq details { border-bottom: 1px solid var(--line2); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  padding: 12px 15px; cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--txt); font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--teal); font-size: 16px; line-height: 1; margin-left: auto; }
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { background: #FAFAFA; }
.faq .answer { padding: 0 15px 14px; color: var(--txt2); line-height: 24px; font-size: 14px; }

/* ---------------- 钱包 ---------------- */

.wallet-top {
  background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 15px;
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 15px;
}
.wallet-cap {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .8px;
  text-transform: uppercase; color: #999; margin-bottom: 6px;
}
.wallet-num {
  color: var(--orange); font-family: Arial, sans-serif; font-weight: 700;
  font-size: 32px; letter-spacing: .8px; line-height: 1;
}
.wallet-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.wallet-btns .btn { padding: 0 16px; }

.scroll-x { overflow-x: auto; }
.rec { width: 100%; min-width: 520px; font-size: 14px; color: var(--txt2); }
.rec th {
  text-align: left; padding: 9px 15px; border: 1px solid var(--line);
  background: #FAFAFA; font-weight: 400;
}
.rec td { padding: 9px 15px; border: 1px solid var(--line); }
.rec tr:hover td { background: #FAFAFA; }
.rec .time { font-family: Arial, sans-serif; }
.rec .amt { text-align: right; font-family: Arial, sans-serif; font-weight: 700; }
.rec .amt.minus { color: var(--red); }
.rec .amt.plus { color: var(--green); }

/* ---------------- 客服 / 页脚 / 浮动按钮 ---------------- */

.qr-wrap {
  max-width: 1190px; margin: 32px auto 8px; padding: 0 15px;
  display: flex; justify-content: center; scroll-margin-top: 76px;
}
.qr-card {
  display: flex; align-items: center; gap: 18px; padding: 14px 18px;
  background: #FDFDFB; border: 1px solid var(--line); border-radius: 6px;
}
.qr-img {
  width: 96px; height: 96px; flex: none; padding: 6px; background: #fff;
  border: 1px solid #EEE; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #999; font-size: 11px; text-align: center; line-height: 1.4;
}
.qr-txt { display: flex; flex-direction: column; gap: 5px; }
.qr-cap {
  font-family: var(--mono); font-size: 10.5px; line-height: 1;
  text-transform: uppercase; letter-spacing: .8px; color: #999;
}
.qr-name { font-weight: 700; font-size: 16px; line-height: 1.2; color: #222; }
.qr-desc { font-size: 12px; line-height: 1.45; color: var(--txt3); max-width: 190px; }

.foot { background: #F1F1F1; color: var(--txt3); font-size: 13px; padding: 20px; text-align: center; }

.fabs {
  position: fixed; right: 24px; bottom: 24px; z-index: 80;
  display: flex; flex-direction: column; gap: 10px;
}
.fab {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .12); font-size: 18px;
}
.fab-qr { background: linear-gradient(135deg, #009688, #00766C); color: #fff; }
.fab-qr:hover { color: #fff; }
.fab-top { background: #fff; color: #444; }
.fab-top:hover { color: #444; }
.fab:hover { box-shadow: 0 4px 16px rgba(0, 150, 136, .28); }

/* ---------------- 移动端 ---------------- */

@media (max-width: 767px) {
  .nav, .bal { display: none; }
  .menu-btn { display: flex; }

  .wrap { padding: 15px 15px 0; }

  /* 商品行改为卡片布局 */
  .group-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 15px 18px; border: 0; border-radius: 2px 2px 0 0;
  }
  .group-title { position: relative; padding: 0 2px; font-size: 16px; font-weight: 700; }
  .group-title::after {
    content: ""; position: absolute; left: -2px; right: -2px; bottom: -6px; height: 4px;
    background: linear-gradient(90deg, #E1251B 0%, #F59E0B 100%);
    border-radius: 6px 6px 999px 4px; transform: rotate(-0.4deg);
  }
  .col-h { display: none; }
  .group-count { display: inline; }

  .row {
    grid-template-columns: 70px auto 1fr 60px;
    grid-template-areas:
      "thumb mode  mode  act"
      "thumb title title act"
      "thumb stock price act";
    gap: 3px 10px; padding: 10px;
    border: 0; border-bottom: 1px solid #DBDBDB;
  }
  .row .thumb { grid-area: thumb; width: 70px; height: 70px; font-size: 13px; align-self: center; }
  .cell-main { grid-area: title; min-width: 0; }
  .cell-mode { grid-area: mode; text-align: left; }
  .cell-stock { grid-area: stock; text-align: left; }
  .cell-price { grid-area: price; text-align: left; }
  .cell-act { grid-area: act; align-self: center; }

  .p-title {
    line-height: 22px; color: #4B566A;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .stock {
    background: #EFEFEF; color: #6E6A6A; font-size: 12px; font-weight: 400;
    border-radius: 2px; padding: 1px 6px;
  }
  .stock::before { content: "库存 "; }
  .price { font-size: 14px; }
  .cell-act .btn { width: 60px; padding: 0; font-size: 13px; }

  .news-grid { grid-template-columns: 1fr; }

  .qr-card { padding: 12px 14px; gap: 14px; }
  .qr-desc { max-width: 100%; }

  .fabs { right: 14px; bottom: 14px; }
}

@media (max-width: 380px) {
  .brand-sub { display: none; }
}
