/* 本草植物饮商城 · H5 用户端样式（移动优先，9:16 竖屏适配） */
:root {
  --brand: #0f6b45;
  --brand-2: #17865a;
  --brand-soft: #e8f5ee;
  --accent: #d8a029;
  --danger: #d9483b;
  --warn: #e08a1e;
  --text: #17231d;
  --muted: #6b7d73;
  --line: #e3eae5;
  --bg: #f4f7f5;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(15, 107, 69, .06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
a { color: var(--brand); text-decoration: none; }
button { font: inherit; cursor: pointer; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, #0f6b45, #17865a 60%, #1f9c69);
  color: #fff; padding: 14px 16px 16px;
}
.top-title { font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.top-sub { font-size: 12px; opacity: .85; margin-top: 2px; }

/* 内容区 */
.view { flex: 1; padding: 12px 12px 84px; }

/* 底部导航 */
.tabbar { display: none; }
.tabbar.show {
  display: grid; grid-template-columns: repeat(5, 1fr);
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 30;
}
.tab { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 11px; padding: 4px 0; }
.tab-icon { font-size: 18px; line-height: 1; filter: grayscale(1) opacity(.6); }
.tab.active { color: var(--brand); font-weight: 600; }
.tab.active .tab-icon { filter: none; }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.card-title::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--brand); }
.card-title.warn::before { background: var(--warn); }

/* 头图 */
.hero {
  background: linear-gradient(135deg, #0f6b45, #17865a 55%, #26a06d);
  color: #fff; border-radius: var(--radius); padding: 18px 16px; margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(15, 107, 69, .18);
}
.hero-title { font-size: 21px; font-weight: 800; letter-spacing: .5px; }
.hero-sub { font-size: 12.5px; opacity: .9; margin-top: 6px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); border-radius: 20px; padding: 3px 10px; font-size: 11.5px; }

/* 模式行 */
.mode-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.mode-row:last-child { border-bottom: 0; }
.mode-icon { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; font-size: 19px; }
.mode-main { flex: 1; min-width: 0; }
.mode-title { font-weight: 600; font-size: 14.5px; }
.mode-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* 键值表 */
.kv { display: flex; flex-direction: column; gap: 7px; }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; }
.kv-k { color: var(--muted); flex: none; }
.kv-v { text-align: right; word-break: break-word; }
.kv-v.strong { font-weight: 700; font-size: 15px; color: var(--brand); }
.kv-v.ok { color: var(--brand-2); }
.kv-v.warn { color: var(--warn); }
.sub-inline { font-size: 12px; }

/* 进度条 */
.progress { height: 9px; border-radius: 6px; background: var(--brand-soft); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #17865a, #d8a029); transition: width .5s ease; }
.progress-label { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 按钮 */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 10px; padding: 9px 14px; font-size: 13.5px; font-weight: 600;
}
.btn.small { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }
.btn.danger { background: #fff; border-color: #f3c4bf; color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn-row .btn { flex: 1; min-width: 110px; }

/* 表单 */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; background: #fbfdfc; color: var(--text);
}
.field em.muted { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; font-style: normal; }
.field input:focus, .field select:focus { outline: 2px solid rgba(23, 134, 90, .25); border-color: var(--brand-2); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px 4px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.table.small { font-size: 12.5px; }
.sub { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.muted { font-size: 12.5px; color: var(--muted); }

/* 记录块 */
.rec { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rec:last-child { border-bottom: 0; }
.rec-head { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.rec-body { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.rec-body .ok { color: var(--brand-2); font-weight: 600; }

.tag { font-size: 11px; border-radius: 6px; padding: 1px 7px; background: var(--brand-soft); color: var(--brand); border: 1px solid #cfe8db; }
.tag.ok { background: var(--brand-soft); color: var(--brand); }
.tag.warn { background: #fdf3e2; color: var(--warn); border-color: #f4dfba; }
.tag.danger { background: #fdecea; color: var(--danger); border-color: #f6cdc7; }

.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.notice-list li:last-child { border-bottom: 0; }
.notice-list li span { font-size: 12px; color: var(--muted); }

.rules { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.rules li { margin-bottom: 5px; }

/* 用户头部 */
.user-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 46px; height: 46px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-size: 19px; font-weight: 700; }
.user-name { font-size: 16px; font-weight: 700; }
.code { color: var(--brand); letter-spacing: 1px; }
.auth-switch { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 12px; }

.empty, .loading, .error { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 10px; }
.error { color: var(--danger); }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  background: rgba(23, 35, 29, .92); color: #fff; font-size: 13px; padding: 9px 16px;
  border-radius: 20px; max-width: 82%; z-index: 60; opacity: 0; pointer-events: none; transition: all .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: rgba(15, 107, 69, .95); }
.toast.error { background: rgba(217, 72, 59, .95); }

/* 弹窗 */
.modal-root { position: fixed; inset: 0; z-index: 50; display: none; }
.modal-root.open { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(12, 24, 18, .45); }
.modal-card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 420px); max-height: 84vh; overflow: auto;
  background: #fff; border-radius: 16px; padding: 16px;
}
.modal-head { font-weight: 700; font-size: 15.5px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-x { border: 0; background: none; font-size: 20px; color: var(--muted); line-height: 1; }
.modal-text { font-size: 13.5px; color: var(--text); line-height: 1.7; }
.modal-foot { display: flex; gap: 8px; margin-top: 14px; }
.modal-foot .btn { flex: 1; }
.modal-body .kv { margin-bottom: 10px; }

@media (min-width: 481px) {
  .app { box-shadow: 0 0 30px rgba(0, 0, 0, .08); }
}