/* ===================================================
   爱卡小店 · 发卡站前台样式（彩虹云商城风格）
   =================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --brand-1: #667eea;
  --brand-2: #764ba2;
  --price: #ff4757;
  --text: #2f3542;
  --text-2: #747d8c;
  --line: #eef0f4;
  --bg: #f5f6fa;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(31, 45, 61, .06);
  --shadow-hover: 0 10px 28px rgba(102, 126, 234, .18);
}
/* ---------- 全局字体：HarmonyOS Sans（华为鸿蒙） ---------- */
@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("/static/fonts/HarmonyOS-Sans-SC-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("/static/fonts/HarmonyOS-Sans-SC-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("/static/fonts/HarmonyOS-Sans-SC-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
body {
  font-family: "HarmonyOS Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; outline: none; }

/* ---------- 彩虹顶部条 ---------- */
.rainbow-bar {
  height: 4px;
  background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #1dd1a1, #a29bfe, #ff9ff3, #ff6b6b);
  background-size: 100% 100%;
}

/* ---------- 导航 ---------- */
.nav {
  background: #fff;
  box-shadow: 0 1px 10px rgba(31, 45, 61, .06);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  height: 64px; display: flex; align-items: center; gap: 28px;
}
.logo { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 700; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.logo-text {
  background: linear-gradient(90deg, #667eea, #a29bfe, #ff9ff3);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-menu { display: flex; gap: 4px; flex: 1; }
.nav-menu a {
  padding: 8px 16px; border-radius: 9px; color: var(--text-2);
  font-size: 14px; transition: all .12s ease;
}
.nav-menu a:hover, .nav-menu a.active { color: var(--brand-1); background: #f2f3ff; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.btn-nav {
  padding: 8px 18px; border-radius: 9px; font-size: 14px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  transition: all .12s ease; white-space: nowrap;
}
.btn-nav:hover { border-color: var(--brand-1); color: var(--brand-1); }
.btn-nav.primary {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; border-color: transparent;
}
.btn-nav.primary:hover { opacity: .9; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px; border-radius: 30px; background: #f7f8fc;
  cursor: pointer; position: relative;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #a29bfe);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.user-dropdown {
  position: absolute; right: 0; top: 46px; min-width: 130px;
  background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(31,45,61,.14);
  padding: 6px; display: none; z-index: 200;
}
.user-dropdown.show { display: block; }
.user-dropdown a { display: block; padding: 9px 14px; border-radius: 7px; font-size: 13.5px; color: var(--text-2); }
.user-dropdown a:hover { background: #f5f6fa; color: var(--brand-1); }

/* ---------- 容器 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 20px 50px; }

/* ---------- 公告 ---------- */
.notice {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, #fff5f5, #fff9f0);
  border: 1px solid #ffe3cc; border-radius: var(--radius);
  padding: 11px 16px; margin-bottom: 20px; overflow: hidden;
}
.notice-tag {
  flex-shrink: 0; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #ff9a44, #ff6b6b);
  padding: 2px 9px; border-radius: 6px;
}
.notice-body { flex: 1; overflow: hidden; white-space: nowrap; }
.notice-body span {
  display: inline; color: #e17055; font-size: 13.5px;
}
@keyframes noticeScroll { to { transform: translateX(-100%); } }

/* ---------- 搜索 / 查单条 ---------- */
.searchbar {
  display: flex; gap: 10px; background: #fff; border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); margin-bottom: 24px;
}
.searchbar input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 16px; background: #fafbfd; transition: all .12s ease;
}
.searchbar input:focus { border-color: var(--brand-1); background: #fff; box-shadow: 0 0 0 3px rgba(102,126,234,.1); }
.btn {
  padding: 11px 26px; border-radius: 10px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; font-size: 14px; font-weight: 500; transition: all .12s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { filter: brightness(.97); }
.btn-ghost { background: #fff; color: var(--brand-1); border: 1px solid var(--brand-1); }
.btn-gray { background: #f1f2f6; color: var(--text-2); }
.btn-block { width: 100%; display: block; padding: 14px; font-size: 15.5px; }
.btn-lg { padding: 13px 32px; font-size: 15px; }

/* ---------- 分类 Tab ---------- */
.cat-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.cat-tab {
  padding: 9px 22px; border-radius: 30px; background: #fff;
  border: 1px solid var(--line); cursor: pointer; font-size: 14px;
  color: var(--text-2); transition: all .12s ease;
}
.cat-tab:hover { color: var(--brand-1); border-color: #c9cffa; }
.cat-tab.active {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(102,126,234,.3);
}

/* ---------- 商品网格 ---------- */
.cat-group { margin-bottom: 34px; }
.cat-group.hide { display: none; }
.cat-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; margin-bottom: 15px;
}
.cat-title::before {
  content: ''; width: 4px; height: 18px; border-radius: 3px;
  background: linear-gradient(180deg, #667eea, #a29bfe);
}
.cat-title small { font-weight: 400; color: var(--text-2); font-size: 12.5px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }
.p-card {
  background: #fff; border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); transition: all .12s ease; cursor: pointer;
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid transparent; position: relative; overflow: hidden;
}
.p-card::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #a29bfe);
  opacity: 0; transition: opacity .12s ease;
}
.p-card:hover { box-shadow: var(--shadow-hover); border-color: #e6e9ff; }
.p-card:hover::after { opacity: 1; }
.p-head { display: flex; align-items: center; gap: 11px; }
.p-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff;
}
.p-icon.c1 { background: linear-gradient(135deg, #ff9a44, #ff6b6b); }
.p-icon.c2 { background: linear-gradient(135deg, #667eea, #a29bfe); }
.p-icon.c3 { background: linear-gradient(135deg, #1dd1a1, #48dbfb); }
.p-icon.c4 { background: linear-gradient(135deg, #f368e0, #ff9ff3); }
.p-icon.c5 { background: linear-gradient(135deg, #54a0ff, #5f27cd); }
.p-name { font-size: 15.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-desc { font-size: 12.5px; color: #a4b0be; line-height: 1.5; min-height: 19px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; }
.p-price { color: var(--price); font-weight: 700; font-size: 22px; line-height: 1; }
.p-price small { font-size: 12px; font-weight: 500; margin-right: 1px; }
.p-price span { font-size: 12px; font-weight: 400; color: var(--text-2); margin-left: 3px; }
.p-buy {
  padding: 7px 18px; border-radius: 22px; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 4px 12px rgba(102,126,234,.28);
}
.p-stock { font-size: 12px; color: var(--text-2); }
.p-stock.off { color: #e5484d; font-weight: 600; }
.p-buy.is-off {
  background: #f1f2f6; color: #98a2b3; box-shadow: none;
  cursor: not-allowed; font-weight: 500;
}
.p-card.is-off { opacity: .66; }
.p-card.is-off:hover { box-shadow: var(--shadow-card, 0 2px 10px rgba(31,45,61,.06)); border-color: var(--line); }

/* ---------- 卡片容器 ---------- */
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 18px;
}
.card-title {
  font-size: 16.5px; font-weight: 700; margin-bottom: 18px;
  padding-bottom: 13px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 9px;
}
.card-title::before {
  content: ''; width: 4px; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, #667eea, #a29bfe);
}

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13.5px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.form-row label .req { color: var(--price); margin-left: 3px; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 15px; border: 1px solid var(--line);
  border-radius: 10px; background: #fafbfd; transition: all .12s ease; color: var(--text);
}
.input:focus { border-color: var(--brand-1); background: #fff; box-shadow: 0 0 0 3px rgba(102,126,234,.1); }
select.input {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23747d8c' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px;
}
textarea.input { resize: vertical; min-height: 88px; }
.form-tip { font-size: 12.5px; color: #a4b0be; margin-top: 6px; }

/* ---------- 下单页 ---------- */
.buy-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.buy-product { display: flex; gap: 16px; align-items: center; }
.buy-product .p-icon { width: 58px; height: 58px; border-radius: 15px; font-size: 22px; }
.buy-pname { font-size: 19px; font-weight: 700; }
.buy-psum { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.buy-price-line {
  display: flex; align-items: baseline; gap: 10px; margin-top: 10px;
  padding-top: 14px; border-top: 1px dashed var(--line);
}
.buy-price-line .now { color: var(--price); font-size: 30px; font-weight: 700; }
.buy-price-line .now small { font-size: 15px; }
.summary-list { font-size: 13.5px; }
.summary-list .row {
  display: flex; justify-content: space-between; padding: 9px 0;
  border-bottom: 1px dashed #f0f1f5;
}
.summary-list .row:last-child { border-bottom: none; }
.summary-list .row .k { color: var(--text-2); }
.summary-list .row .v { font-weight: 500; }
.summary-list .row.total { font-size: 15px; font-weight: 700; padding-top: 14px; }
.summary-list .row.total .v { color: var(--price); font-size: 24px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
table.tb th {
  background: #fafbfd; padding: 13px 15px; text-align: left;
  font-weight: 600; color: var(--text-2); font-size: 13px;
  white-space: nowrap; border-bottom: 1px solid var(--line);
}
table.tb td { padding: 13px 15px; border-bottom: 1px solid #f6f7fa; vertical-align: middle; }
table.tb tr:last-child td { border-bottom: none; }
table.tb tbody tr:hover { background: #fbfbfe; }
.tb-empty { padding: 54px 20px; text-align: center; color: #b2bec3; }
.tb-empty .ico { font-size: 38px; margin-bottom: 10px; opacity: .5; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }

/* ---------- 状态标签 ---------- */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 20px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge.s0 { background: #fff4e5; color: #e67e22; }
.badge.s1 { background: #e8f0ff; color: #3b82f6; }
.badge.s2 { background: #e7f8f0; color: #10b981; }
.badge.s3 { background: #fdeaea; color: #ef4444; }

/* ---------- 认证页 ---------- */
.auth-wrap {
  min-height: calc(100vh - 68px); display: flex; align-items: center;
  justify-content: center; padding: 40px 20px;
  background: radial-gradient(circle at 15% 15%, rgba(162,155,254,.16), transparent 45%),
              radial-gradient(circle at 85% 85%, rgba(255,159,243,.14), transparent 45%);
}
.auth-card {
  width: 100%; max-width: 420px; background: #fff;
  border-radius: 18px; padding: 38px 34px;
  box-shadow: 0 18px 50px rgba(31,45,61,.1);
}
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo .mark {
  width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 12px;
  background: linear-gradient(135deg, #667eea, #a29bfe);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 700;
}
.auth-logo h2 { font-size: 20px; font-weight: 700; }
.auth-logo p { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.auth-foot { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--text-2); }
.auth-foot a { color: var(--brand-1); font-weight: 500; }
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; }
.code-btn {
  padding: 0 16px; border-radius: 10px; border: 1px solid var(--brand-1);
  background: #fff; color: var(--brand-1); font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: all .12s ease;
}
.code-btn:hover:not(:disabled) { background: #f2f3ff; }
.code-btn:disabled { opacity: .55; cursor: not-allowed; border-color: var(--line); color: var(--text-2); }
.captcha-row { display: flex; gap: 10px; }
.captcha-row .input { flex: 1; }
.captcha-img {
  width: 110px; height: 46px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); object-fit: cover; flex-shrink: 0;
}

/* ---------- 提示 ---------- */
.alert {
  padding: 11px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert.err { background: #fdeaea; color: #e74c3c; border: 1px solid #fadbd8; }
.alert.ok { background: #e7f8f0; color: #0e9f6e; border: 1px solid #c8f0dc; }
.alert.info { background: #eef2ff; color: #4f63d2; border: 1px solid #dde3ff; }

/* ---------- 成功页 ---------- */
.success-box { max-width: 540px; margin: 40px auto; text-align: center; }
.success-ico {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 22px;
  background: linear-gradient(135deg, #1dd1a1, #48dbfb);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #fff; box-shadow: 0 12px 30px rgba(29,209,161,.3);
}
.success-box h2 { font-size: 22px; margin-bottom: 8px; }
.success-box p.sub { color: var(--text-2); font-size: 13.5px; margin-bottom: 26px; }
.order-no-box {
  background: #fafbfd; border: 1px dashed #d6dbf5; border-radius: 12px;
  padding: 18px; margin-bottom: 22px;
}
.order-no-box .lbl { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.order-no-box .val { font-size: 19px; font-weight: 700; letter-spacing: .5px; color: var(--brand-1); font-family: ui-monospace, Consolas, monospace; }

/* ---------- 页脚 ---------- */
.footer {
  background: #fff; border-top: 1px solid var(--line);
  padding: 32px 20px; text-align: center; color: var(--text-2); font-size: 13px;
}
.footer .links { display: flex; justify-content: center; gap: 22px; margin-bottom: 12px; flex-wrap: wrap; }
.footer .links a:hover { color: var(--brand-1); }
.footer .cp { font-size: 12.5px; color: #b2bec3; }

/* ---------- 统计 ---------- */
.stats-bar { display: flex; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.stat-item {
  flex: 1; min-width: 140px; background: #fff; border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-item .n { font-size: 24px; font-weight: 700; color: var(--brand-1); line-height: 1.2; }
.stat-item .t { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }



/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 26px 0 10px; }
.pager .pg {
  display: inline-block; padding: 9px 20px; border-radius: 999px; background: #fff;
  color: var(--brand-1); font-size: 13.5px; font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: all .12s ease;
}
.pager .pg:hover { background: #f4f1ff; }
.pager .pg-cur { color: var(--text-2); font-size: 13.5px; }

/* ---------- 工单对话 ---------- */
.msg-list { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 78%; }
.msg-meta { font-size: 12px; color: #a0a6b5; margin-bottom: 5px; }
.msg-bubble {
  padding: 12px 15px; border-radius: 14px; font-size: 13.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.msg-user { align-self: flex-start; }
.msg-user .msg-bubble { background: #f5f6fa; color: #2b2f38; border-top-left-radius: 4px; }
.msg-admin { align-self: flex-end; text-align: right; }
.msg-admin .msg-bubble {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; border-top-right-radius: 4px; text-align: left;
}



/* ---------- 发货内容 ---------- */
.dlv-row td { background: #f7f9ff; }
.dlv-tag {
  display: inline-block; padding: 2px 10px; border-radius: 6px; margin-right: 10px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); color: #fff; font-size: 12px;
}
.dlv-body { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; color: #2b2f38; word-break: break-all; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .buy-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-inner { height: auto; padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
  /* 基础样式里 .nav-menu 是 flex:1（flex-basis:0），只写 width:100% 不会换行，
     必须把 flex-basis 改成 100% 才会独占一行 */
  .nav-menu { order: 3; flex: 0 0 100%; width: 100%; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-menu::-webkit-scrollbar { display: none; }
  .nav-menu a { padding: 7px 13px; font-size: 13.5px; white-space: nowrap; }
  .nav-right { margin-left: auto; }
  .wrap { padding: 16px 14px 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
  .p-card { padding: 14px; gap: 9px; }
  .p-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 15px; }
  .p-name { font-size: 14px; }
  .p-sub { font-size: 11.5px; }
  .p-desc { display: none; }
  .p-price { font-size: 19px; }
  .p-buy { padding: 6px 14px; font-size: 12.5px; }
  .searchbar { padding: 10px; gap: 8px; }
  .btn { padding: 10px 18px; font-size: 13.5px; }
  .card { padding: 18px 16px; border-radius: 12px; }
  .auth-card { padding: 30px 22px; border-radius: 16px; }
  .cat-tab { padding: 8px 17px; font-size: 13.5px; }
  /* 分类胶囊在手机上改成单行横向滑动，避免二十多行胶囊把首屏顶下去 */
  .cat-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { flex: 0 0 auto; white-space: nowrap; }
  .cat-title { font-size: 15.5px; }
  .stats-bar { gap: 9px; }
  .stat-item { min-width: calc(50% - 5px); padding: 13px 14px; }
  .stat-item .n { font-size: 20px; }
  .buy-price-line .now { font-size: 26px; }
  table.tb th, table.tb td { padding: 10px 11px; font-size: 12.5px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .nav-menu a { padding: 6px 11px; font-size: 12.5px; }
}
