/* 买东西审批局 · 联网版样式（小红书风格 / 内联 SVG 图标） */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --red: #ff2442;
  --red-light: #fff0f2;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #222226;
  --sub: #8a8f99;
  --line: #efeff1;
  --green: #16a34a;
  --green-bg: #e9f7ee;
  --orange: #f59e0b;
  --orange-bg: #fff6e5;
  --blue: #3b82f6;
  --blue-bg: #eaf3ff;
}
html {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  min-height: 100%;
}
input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}
#app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100%;
}

/* ---------- Material Symbols 图标（Google Material Design，自托管字体） ---------- */
@font-face {
  font-family: "Material Symbols Outlined";
  src: url("/static/fonts/material-symbols-outlined.woff2?v=400") format("woff2");
  font-display: block;
  font-weight: normal;
  font-style: normal;
}
.ms {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
  user-select: none;
  flex-shrink: 0;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
}
.logo .ms {
  color: var(--red);
  font-size: 20px;
  margin-right: 6px;
}

/* ---------- 视图区 ---------- */
.view {
  padding: 12px 16px calc(92px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}
.tab-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 7px 0 9px;
  font-size: 11px;
  color: var(--sub);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tab-ico {
  font-size: 22px;
  margin-bottom: 1px;
}
.tab-btn.is-active {
  color: var(--red);
  font-weight: 600;
}
/* 发起按钮：嵌入底栏内的圆角方框，与 tab 同排 */
.tab-new {
  flex: 1;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tab-new-plus {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 26px;
  text-align: center;
  line-height: 40px;
  box-shadow: 0 2px 8px rgba(255, 36, 66, 0.3);
}
.tab-new:active .tab-new-plus {
  opacity: 0.8;
}

/* ---------- 统计卡（截图样式：4 数字 + 已节省金额） ---------- */
.stat-hero {
  background: var(--card);
  border-radius: 16px;
  padding: 18px 16px 16px;
  margin-top: 12px;
}
.stat-hero-grid {
  display: flex;
}
.stat-hero-grid .hi {
  flex: 1;
  text-align: center;
}
.stat-hero-grid .num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.stat-hero-grid .lb,
.save-line .lb {
  font-size: 12px;
  color: var(--sub);
  margin-top: 2px;
}
.save-line {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.save-line .money {
  font-size: 26px;
  font-weight: 700;
  color: #16a34a;
}

/* ---------- 统计（横向触摸滑动滑条） ---------- */
.stat-scroll {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-top: 12px;
}
.stat-scroll::-webkit-scrollbar {
  display: none;
}
.stat-scroll .stat-card {
  flex: 0 0 104px;
  background: var(--card);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}
.stat-scroll .stat-card + .stat-card {
  margin-left: 10px;
}
.stat-num {
  font-size: 22px;
  font-weight: 700;
}
.stat-num.is-red {
  color: var(--red);
}
.stat-num.is-green {
  color: #15803d;
}
.stat-label {
  font-size: 12px;
  color: var(--sub);
  margin-top: 2px;
}

/* ---------- chips ---------- */
.chips {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 12px -16px 0;
  padding: 0 16px 4px;
}
.chips::-webkit-scrollbar {
  display: none;
}
/* 换行版 chips：完整展示不截断（分类等较多选项） */
.chips.wrap {
  flex-wrap: wrap;
  overflow: visible;
  -webkit-overflow-scrolling: auto;
  scrollbar-width: auto;
  margin-top: 12px;
  padding-bottom: 0;
}
.chips.wrap .chip {
  margin-bottom: 8px;
}
.chip {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--sub);
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.chip + .chip {
  margin-left: 8px;
}
.chip.is-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
}

/* ---------- 申请卡片 ---------- */
.app-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  margin-top: 12px;
  display: flex;
  cursor: pointer;
}
.app-card:active {
  opacity: 0.85;
}
.app-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: #f0f1f3;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-thumb .ms {
  color: #b6bac3;
}
.app-body {
  flex: 1;
  min-width: 0;
  margin-left: 12px;
}
.app-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-sub {
  font-size: 12px;
  color: var(--sub);
  margin-top: 2px;
  display: flex;
  align-items: center;
}
.app-sub .price {
  color: #c81e3c;
  font-weight: 600;
  margin-right: 6px;
}
.app-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
}
.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #f0f1f3;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--red);
}
.progress-text {
  font-size: 11px;
  color: var(--sub);
  margin-left: 8px;
  flex-shrink: 0;
}

/* ---------- 徽章（文字+图标+色块 三重编码，色觉友好） ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  margin-left: 6px;
  vertical-align: 1px;
}
.badge .ms {
  margin-right: 3px;
}
.badge-pending {
  color: #b45309;
  background: var(--orange-bg);
}
.badge-approved {
  color: #15803d;
  background: var(--green-bg);
}
.badge-rejected {
  color: #c81e3c;
  background: var(--red-light);
}
.badge-purchased {
  color: #2563eb;
  background: var(--blue-bg);
}
.badge-lg {
  font-size: 12px;
  padding: 3px 12px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn .ms {
  margin-right: 5px;
}
.btn:active {
  opacity: 0.8;
}
.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-ghost {
  background: var(--card);
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-soft {
  background: #f0f1f3;
  color: var(--text);
}
.btn-green {
  background: #15803d;
  color: #fff;
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn-row {
  display: flex;
  margin-top: 14px;
}
.btn-row .btn {
  flex: 1;
}
.btn-row .btn + .btn {
  margin-left: 10px;
}

/* ---------- 表单 ---------- */
.form-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  display: block;
  margin-bottom: 8px;
}
.field + .field {
  margin-top: 16px;
}
.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  font-size: 15px;
  padding: 11px 14px;
  color: var(--text);
  outline: none;
}
.textarea {
  min-height: 84px;
  resize: none;
}
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 10px;
  background: #fafafa;
}
.stepper-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 18px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
}
.stepper-hint {
  font-size: 11px;
  color: var(--sub);
  margin-top: 8px;
}
.stepper-val {
  font-size: 17px;
  font-weight: 700;
}
.img-grid {
  display: flex;
  flex-wrap: wrap;
}
.img-item {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 10px;
  overflow: hidden;
  margin-right: 10px;
  margin-bottom: 10px;
  background: #f0f1f3;
}
.img-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}
.img-add {
  width: 78px;
  height: 78px;
  border-radius: 10px;
  border: 1px dashed #d5d7db;
  background: #fafafa;
  color: var(--sub);
  font-size: 26px;
  line-height: 76px;
  text-align: center;
  cursor: pointer;
}
.img-tip {
  font-size: 11px;
  color: var(--sub);
  margin-top: 4px;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.switch {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: #d5d7db;
  cursor: pointer;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.switch.is-on {
  background: var(--red);
}
.switch.is-on::after {
  left: 21px;
}

/* ---------- 详情 ---------- */
.detail-hero {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
  display: flex;
}
.detail-body {
  flex: 1;
  min-width: 0;
  margin-left: 14px;
}
.detail-title {
  font-size: 18px;
  font-weight: 700;
}
.detail-price {
  color: var(--red);
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}
.detail-meta {
  font-size: 12px;
  color: var(--sub);
  margin-top: 6px;
}
.detail-imgs {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
}
.detail-imgs .img-item {
  width: 96px;
  height: 96px;
}
.section {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title .ms {
  margin-right: 6px;
  color: var(--red);
}
.section-text {
  font-size: 14px;
  color: #4a4a52;
  white-space: pre-wrap;
  word-break: break-all;
}
.link-text {
  color: var(--blue);
  word-break: break-all;
  font-size: 13px;
}
.result-banner {
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
  text-align: center;
}
.result-ok {
  background: var(--green-bg);
  color: #15803d;
}
.result-no {
  background: var(--red-light);
  color: #c81e3c;
}
.result-run {
  background: var(--orange-bg);
  color: #b45309;
}
.result-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-title .ms {
  margin-right: 6px;
}
.result-sub {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.85;
}
.vote-big {
  display: flex;
  align-items: center;
  margin-top: 14px;
}
.vote-num {
  font-size: 13px;
  color: var(--sub);
  flex-shrink: 0;
}
.vote-num.is-agree {
  color: #15803d;
  margin-right: 12px;
}
.vote-num.is-reject {
  color: #c81e3c;
  margin-left: 12px;
}
.vote-list {
  margin-top: 12px;
}
.vote-row {
  display: flex;
  align-items: center;
  font-size: 13px;
  padding: 6px 0;
}
.vote-row + .vote-row {
  border-top: 1px solid var(--line);
}
.vote-nick {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vote-decision {
  font-weight: 600;
  flex-shrink: 0;
}
.vote-ok {
  color: #15803d;
}
.vote-no {
  color: #c81e3c;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  line-height: 26px;
  text-align: center;
  margin-right: 8px;
  flex-shrink: 0;
}
.comment-row {
  display: flex;
  padding: 8px 0;
}
.comment-row + .comment-row {
  border-top: 1px solid var(--line);
}
.comment-body {
  flex: 1;
  min-width: 0;
  margin-left: 10px;
}
.comment-nick {
  font-size: 12px;
  color: var(--sub);
}
.comment-text {
  font-size: 14px;
  margin-top: 2px;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(20px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  max-height: 80%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-title .ms {
  margin-right: 6px;
  color: var(--red);
}
.modal-note {
  font-size: 12px;
  color: var(--sub);
  margin-top: 8px;
  line-height: 1.6;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  font-size: 18px;
  color: var(--sub);
  cursor: pointer;
  padding: 4px;
}
.copy-box {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
  min-height: 60px;
  color: var(--text);
  word-break: break-all;
}

/* ---------- 空状态 / 提示 ---------- */
.empty {
  text-align: center;
  color: var(--sub);
  font-size: 13px;
  padding: 40px 0 20px;
}
.empty .ms {
  color: #b6bac3;
  display: block;
  margin: 0 auto 8px;
  font-size: 40px;
}
.tip-banner {
  background: var(--red-light);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  color: #b3122e;
  margin-top: 12px;
  line-height: 1.6;
}
.tip-banner .ms {
  margin-right: 4px;
  vertical-align: -2px;
}
.rule-block {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
}
.rule-item {
  display: flex;
  font-size: 13px;
  color: #4a4a52;
  padding: 6px 0;
  line-height: 1.6;
}
.rule-ico {
  flex-shrink: 0;
  margin-right: 8px;
  color: var(--red);
}

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  z-index: 99;
  display: none;
  max-width: 80%;
  text-align: center;
}
#toast.is-show {
  display: block;
}