/* ==========================================================================
   红百灵（HBL）音响麦克风 — mic.vip
   布局策略（两套）：
   - 手机端：≤ 599px，单列堆叠，见文件末尾 @media
   - 非手机端：≥ 600px，宽屏布局，最大 1200px，适配 iPad 各尺寸
   ========================================================================== */

:root {
  --col: 1200px;
  --black: #000;
  --tab-bg: #1f1f1f;
  --yellow: #ffff00;
  --amber: #fcbf55;
  --red: #ff8080;
  --btn-face: #2e2e2e;
  --font: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  background: #fff;
  color: #fff;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- 非手机端布局（≥ 600px）：宽屏页面，内容按 900/1024 居中 ---------- */
/* 页面容器：最大 1200px 居中；手机上自动铺满（末尾 @media 覆盖） */
.app {
  position: relative;
  width: min(100%, var(--col));
  min-height: 100vh;
  margin: 0 auto;
  background: var(--black);
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部标题 ---------- */
.site-header {
  position: relative;
  height: 72px;
  flex: none;
  background: var(--black);
}

.brand {
  position: absolute;
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
  height: 27px;
  width: auto;
  max-width: calc(100% - 50px);
}

/* ---------- 标签栏 ---------- */
.nav-row {
  display: flex;
  align-items: center;
  background: var(--black);
}

.tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 8px;
  height: 50px;
  background: var(--black);
}

.tab {
  flex: 1;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--font);
  font-size: 25px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tab:hover { background: rgba(255, 255, 255, 0.18); }

.tab.active {
  color: var(--yellow);
  font-weight: 700;
}

.tab:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: -2px;
}

/* ---------- 内容区 ---------- */
.tabpanes {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pane {
  display: none;
  flex: 1;
  flex-direction: column;
}

.pane.active { display: flex; }

/* 视频 */
.pane-video { background: var(--black); }

.video-wrap {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding-top: 12px;
}

.video-wrap video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 483 / 300;
  background: #000;
  object-fit: cover;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 14px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 24px 40px;
}

.grid-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--btn-face);
  color: #fff;
  font-size: 22px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.grid-btn:hover { background: #3c3c3c; }

.grid-btn.highlight {
  color: var(--yellow);
  font-weight: 700;
}

/* 帮助 */
.pane-help {
  background: #fff;
  overflow: hidden;
}

.help-diagram {
  display: block;
  width: 560px;
  max-width: calc(100% - 40px);
  height: auto;
  aspect-ratio: 470 / 625;
  margin: 20px auto 0;
}

/* ---------- 订购 ---------- */
.pane-order {
  background: var(--black);
  overflow-y: auto;
}

.order-form {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 36px 44px 28px;
}

.order-head {
  display: flex;
  align-items: flex-start;
  margin-bottom: 28px;
}

.promo {
  color: var(--red);
  font-size: 16px;
  line-height: 24px;
}

.order-title {
  margin-left: 16px;
  color: var(--amber);
  font-size: 28px;
  letter-spacing: 4px;
  line-height: 1.2;
}

.form-row {
  display: flex;
  align-items: center;
  margin-top: 24px;
}

.form-row:first-of-type { margin-top: 0; }

.form-row .lbl {
  flex: none;
  width: 140px;
  color: #fff;
  font-size: 19px;
}

.form-row .inp {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #b5b8c8;
  background: #fff;
  color: #000;
  font-family: var(--font);
  font-size: 18px;
  outline: none;
}

.form-row .inp:focus { border-color: #4d90fe; }

.phone-label { width: 60px !important; margin-left: 32px; }

.choices {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding-left: 0;
  margin-top: 20px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  white-space: nowrap;
}

.choice input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #d0d0d0;
}

.price {
  color: var(--red);
  font-size: 17px;
  white-space: nowrap;
}

.total {
  position: absolute;
  right: 40px;
  top: 7px;
  color: #fff;
  font-size: 16px;
  white-space: nowrap;
}

.order-btns {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.order-btns .btn { width: 160px; }

/* 通用灰色渐变按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border: 1px solid #4f4f4f;
  border-radius: 7px;
  background: linear-gradient(#a3a3a3, #464646);
  color: #fff;
  font-family: var(--font);
  font-size: 19px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover { background: linear-gradient(#b3b3b3, #555); }

.btn:active {
  background: linear-gradient(#8a8a8a, #3a3a3a);
}

.order-note {
  max-width: 780px;
  margin-top: 20px;
}

.note-title {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 22px;
  letter-spacing: 2px;
}

.order-note p {
  margin: 0;
  color: #fff;
  font-size: 19px;
  line-height: 27px;
}

.order-note p + p { margin-top: 6px; }

.btn-copy {
  width: 150px;
  margin-top: 34px;
}

.order-bottom {
  display: flex;
  justify-content: flex-end;
  margin-top: 40px;
}

.order-bottom .btn { width: 160px; }

/* ---------- 售后 ---------- */
.pane-support {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: var(--black);
  padding: 28px 44px 0;
  overflow-y: auto;
}

.support-label {
  margin: 12px 0 1px;
  color: var(--amber);
  font-size: 20px;
  line-height: 23px;
  letter-spacing: 1px;
}

.msg-input,
.msg-history {
  display: block;
  width: 100%;
  border: 1px solid #808080;
  background: #000;
  color: #fff;
  font-family: var(--font);
  font-size: 19px;
  line-height: 1.5;
  padding: 6px 8px;
  outline: none;
  resize: none;
}

.msg-input { height: clamp(160px, 20vh, 220px); }

.msg-history {
  height: clamp(240px, 34vh, 380px);
  margin-top: 1px;
}

.msg-input:focus { border-color: #bfbfbf; }

.support-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.support-actions .btn { width: 160px; }

.support-note {
  max-width: 780px;
  margin: 28px 0 0;
  color: #fff;
  font-size: 19px;
  line-height: 27px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  flex: none;
  padding: 11px 0 64px;
  background: var(--black);
  color: #fff;
  font-size: 13px;
}

.footer-row {
  display: flex;
  align-items: flex-start;
  height: 25px;
  padding: 0 25px 0 30px;
  margin-bottom: 8px;
}

.phone-icon {
  width: 25px;
  height: 25px;
}

.phone-number {
  height: 17px;
  width: auto;
  margin-left: 9px;
}

.studio {
  margin-left: auto;
  font-size: 13px;
}

.site-footer p {
  margin: 0 0 13px 30px;
  line-height: 17px;
}

.site-footer p:last-child { margin-bottom: 0; }

.site-footer a { text-decoration: none; }

.site-footer a:hover { text-decoration: underline; }

/* 订购 / 售后 不显示页脚 */
.app.hide-footer .site-footer { display: none; }

/* 帮助页页脚在原设计中位置略低 */
.app.tab-help .site-footer {
  padding-top: 17px;
  padding-bottom: 44px;
}

/* ---------- 提示条 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 16px);
  padding: 10px 18px;
  border: 1px solid #555;
  border-radius: 8px;
  background: rgba(25, 25, 25, 0.95);
  color: var(--yellow);
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 99;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 手机端布局（≤ 599px）：单列堆叠 ---------- */
@media (max-width: 599px) {
  .app { width: 100%; }

  .site-header { height: 52px; }

  .nav-row {
    gap: 8px;
    padding-right: 10px;
  }

  .tabs { gap: 4px; height: 42px; }

  .tab { height: 42px; font-size: 20px; }

  .video-wrap video {
    height: auto;
    aspect-ratio: 483 / 300;
  }

  .help-grid { gap: 8px 6px; padding: 8px 6px 24px 5px; }

  .grid-btn { height: 38px; font-size: 17px; }

  .help-diagram { max-width: calc(100% - 10px); margin-top: 12px; }

  .order-form { padding: 22px 15px 20px; }

  .order-title { font-size: 24px; letter-spacing: 2px; }

  .form-row { flex-wrap: wrap; margin-top: 14px; }

  .form-row .lbl {
    width: 100% !important;
    margin-bottom: 6px;
    font-size: 17px;
  }

  .form-row .inp {
    width: 100%;
    flex: 1 1 100%;
    height: 38px;
    font-size: 16px;
  }

  .phone-label { margin-left: 0 !important; }

  .choices {
    grid-template-columns: 1fr;
    gap: 4px;
    margin-top: 14px;
  }

  .choice { font-size: 15px; }

  .price { margin-left: 17px; font-size: 15px; }

  .total { position: static; margin-top: 6px; font-size: 15px; }

  .order-btns { margin-top: 24px; justify-content: center; }

  .order-btns .btn {
    flex: 0 0 auto;
    width: 160px;
  }

  .order-note { max-width: none; }

  .order-note p { font-size: 16px; line-height: 24px; }

  .note-title { font-size: 19px; }

  .btn-copy { margin-top: 24px; }

  .order-bottom { margin-top: 24px; }

  .order-history { margin-top: 18px; padding-top: 14px; }

  .pane-support {
    max-width: none;
    padding: 14px 15px 0;
  }

  .support-label { font-size: 18px; }

  .msg-input { height: 140px; font-size: 16px; }

  .msg-history { height: 240px; font-size: 16px; }

  .support-note { max-width: none; font-size: 16px; line-height: 24px; }

  .footer-row { padding: 0 18px 0 20px; }

  .site-footer p { margin-left: 20px; }
}

/* ---------- 标题图片（原站雪碧图 1:1 拼接） ---------- */
.brand-img {
  position: absolute;
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
  display: block;
  width: min(700px, calc(100% - 150px));
  height: auto;
}

/* ---------- 账户入口 ---------- */
.account-btn {
  position: absolute;
  right: 20px;
  top: 36px;
  transform: translateY(-50%);
  z-index: 5;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #666;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--yellow);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
}

.account-btn:hover { background: rgba(255, 255, 255, 0.16); }
.account-btn.logged-in {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: #fff;
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  flex: none;
}

.account-tail { font-size: 13px; letter-spacing: 0.5px; }

/* 动态产品选择 */
.choices { grid-template-columns: 1fr auto; }

.choices .choice { white-space: normal; }

.choices .price { text-align: right; }

.choices .total {
  position: static;
  grid-column: 1 / -1;
  margin-top: 8px;
  text-align: right;
}

.choices-loading {
  grid-column: 1 / -1;
  color: #aaa;
  font-size: 15px;
}

.order-result {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #555;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 15px;
  line-height: 1.6;
}

.order-result strong { color: var(--yellow); }

.promo[hidden] { display: none; }
.promo[hidden] + .order-title { margin-left: 0; }

.order-contact {
  margin-top: 4px;
  color: #ccc;
  font-size: 13px;
  line-height: 1.6;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.guest-hint {
  margin: 0 0 10px;
  color: #888;
  font-size: 12px;
  line-height: 1.5;
}

.guest-actions {
  margin: 0 0 12px;
}

.order-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid #6a6a6a;
  border-radius: 3px;
  color: #bbb;
  font-size: 11px;
  font-weight: 400;
  vertical-align: middle;
}

.order-history {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #333;
}

.order-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.order-history-head h3 {
  margin: 0;
  color: var(--amber);
  font-size: 18px;
  font-weight: 500;
}

.support-login-hint {
  margin: 6px 0 0;
  color: #aaa;
  font-size: 14px;
}

/* ---------- 登录 / 个人中心弹层 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 20px 18px;
  border: 1px solid #555;
  border-radius: 12px;
  background: #0d0d0d;
  color: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 6px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal-title {
  margin: 0 0 16px;
  color: var(--yellow);
  font-size: 22px;
  font-weight: 700;
}

.auth-field {
  display: block;
  margin-bottom: 12px;
  color: #ddd;
  font-size: 15px;
}

.auth-field input {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 6px;
  padding: 0 10px;
  border: 1px solid #666;
  border-radius: 6px;
  background: #000;
  color: #fff;
  font-family: var(--font);
  font-size: 16px;
}

.auth-code-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.auth-code-row input { flex: 1; margin-top: 0; }
.auth-code-row .btn { flex: none; }

.auth-captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.auth-captcha-row img,
.auth-captcha-placeholder {
  width: 120px;
  height: 40px;
  border: 1px solid #808080;
  border-radius: 4px;
}

.auth-captcha-row img { background: #fff; }

.auth-captcha-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  background: #0b0b0b;
  color: #999;
  font-size: 12px;
  text-align: center;
}

.auth-captcha-row .btn { flex: none; }

.auth-hint {
  min-height: 20px;
  margin: 6px 0;
  color: var(--red);
  font-size: 14px;
  line-height: 1.4;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
}

.auth-links button {
  border: 0;
  background: none;
  color: var(--yellow);
  font-size: 14px;
  padding: 0;
  cursor: pointer;
}

.auth-links button[hidden] { display: none; }

.btn-small {
  height: 30px;
  padding: 0 10px;
  font-size: 14px;
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--yellow);
  font-size: 18px;
}

.account-section { margin-top: 18px; }

.account-section h3 {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 17px;
}

.order-card {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #111;
  font-size: 14px;
  line-height: 1.6;
}

.order-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
}

.badge {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid #666;
  border-radius: 10px;
  color: var(--yellow);
  font-size: 12px;
  line-height: 18px;
}

.order-meta { color: #888; font-size: 12px; }
.order-items { color: #ddd; }
.order-amount { margin: 4px 0; color: #fff; }
.order-card .btn { margin-top: 6px; }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat {
  padding: 8px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #111;
}

.stat b { display: block; color: var(--yellow); font-size: 16px; }
.stat span { color: #aaa; font-size: 12px; }

.share-list { margin-top: 10px; }

.share-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #333;
  font-size: 13px;
}

.share-row small { display: block; color: #888; }

.code-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #111;
}

.code-item small { display: block; color: #888; }
.empty { color: #888; font-size: 14px; }

@media (max-width: 599px) {
  .account-btn {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    flex: none;
    width: auto;
    min-width: 58px;
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }

  .account-btn.logged-in { gap: 5px; padding: 0 8px; }
  .account-tail { font-size: 12px; }

  .modal-card { padding: 18px 14px; }

  .brand-img {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: calc(100% - 20px);
    max-width: none;
  }
}

/* 订购项：与原站一致，仅名称 + 价格；售罄置灰 */
.choices {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 20px;
  text-align: left;
}

.choices .choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: start;
  gap: 10px;
  height: auto;
  padding: 4px 0;
  white-space: normal;
  text-align: left;
}

.choice-name { font-size: 17px; color: #fff; text-align: left; }

.choice-price {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  justify-self: end;
  gap: 6px;
  white-space: nowrap;
}

.price-original {
  color: #999;
  font-size: 14px;
  text-decoration: line-through;
}

.choice-discount {
  color: var(--red);
  font-size: 13px;
}

.price-final { font-weight: 700; }

.choice.sold-out { opacity: 0.55; cursor: not-allowed; }
.choice.sold-out .price,
.choice.sold-out .price-final { color: #999; }

.choices .price { margin-left: 0; text-align: right; }

.choices .total {
  position: static;
  grid-column: 1 / -1;
  margin-top: 8px;
  text-align: right;
}

@media (max-width: 599px) {
  .choices .choice {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .choice-name { font-size: 15px; }
  .choices .price { margin-left: 0; font-size: 15px; }
  .choice-price { gap: 4px; }
  .price-original, .choice-discount { font-size: 12px; }
}
