/* =====================================================================
   潮品商城 · 移动端高级样式
   设计语言：玻璃拟态 + 渐变品牌色 + 流畅微交互
   ===================================================================== */

/* ---------- 设计变量（浅色） ---------- */
:root {
  --bg: #f3f4f9;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --text: #15151f;
  --text-2: #6c6c7c;
  --border: rgba(20, 20, 45, 0.08);
  --brand: #6d5efc;
  --brand-2: #b14bff;
  --brand-3: #ff5fa2;
  --ok: #1bbf83;
  --warn: #ff9f43;
  --danger: #ff5470;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --shadow: 0 12px 34px rgba(20, 20, 50, 0.10);
  --shadow-sm: 0 6px 18px rgba(20, 20, 50, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --grad: linear-gradient(135deg, var(--brand), var(--brand-2) 55%, var(--brand-3));
  --grad-soft: linear-gradient(135deg, rgba(109,94,252,.14), rgba(255,95,162,.14));
}

/* ---------- 深色 ---------- */
html[data-theme="dark"] {
  --bg: #0b0b12;
  --surface: #15151f;
  --surface-2: #1c1c29;
  --text: #f3f3f8;
  --text-2: #9a9aae;
  --border: rgba(255, 255, 255, 0.09);
  --glass: rgba(26, 26, 40, 0.6);
  --glass-strong: rgba(26, 26, 40, 0.85);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.4);
  --grad-soft: linear-gradient(135deg, rgba(109,94,252,.22), rgba(255,95,162,.2));
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #0b0b12;
    --surface: #15151f;
    --surface-2: #1c1c29;
    --text: #f3f3f8;
    --text-2: #9a9aae;
    --border: rgba(255, 255, 255, 0.09);
    --glass: rgba(26, 26, 40, 0.6);
    --glass-strong: rgba(26, 26, 40, 0.85);
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.4);
    --grad-soft: linear-gradient(135deg, rgba(109,94,252,.22), rgba(255,95,162,.2));
  }
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(177,75,255,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(109,94,252,.16), transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .4s ease;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 手机外壳（桌面端居中模拟） ---------- */
.app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
@media (min-width: 520px) {
  body { padding: 0; }
  .app {
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow: hidden;
  }
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.topbar-brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .5px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar-title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  opacity: .9;
}
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform .2s ease, background .2s ease;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(.92); }
.theme-toggle { margin-left: auto; }

/* ---------- 内容区 ---------- */
.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 16px;
}
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 4px 12px;
}
.section-title h2 { font-size: 17px; margin: 0; font-weight: 800; }
.section-title .more { font-size: 13px; color: var(--text-2); }

/* ---------- 底部导航 ---------- */
.tabbar {
  flex: 0 0 auto;
  display: flex;
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 520px) {
  .tabbar {
    border-radius: 0 0 30px 30px;
  }
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 8px;
  font-size: 11px;
  color: var(--text-2);
  position: relative;
  transition: color .2s ease;
}
.tab-ico { width: 24px; height: 24px; display: grid; place-items: center; }
.tab-ico svg { width: 22px; height: 22px; }
.tab.active { color: var(--brand); font-weight: 700; }
.tab.active .tab-ico::after {
  content: ""; position: absolute; top: 4px;
  width: 34px; height: 34px; border-radius: 12px;
  background: var(--grad-soft); z-index: -1;
}

/* ---------- Hero（首页横幅） ---------- */
.hero {
  position: relative;
  border-radius: var(--radius);
  padding: 22px 20px;
  color: #fff;
  background: var(--grad);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::before {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.22); filter: blur(4px);
}
.hero::after {
  content: ""; position: absolute; left: -30px; bottom: -50px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(0,0,0,.12);
}
.hero h1 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.hero p { margin: 0; opacity: .92; font-size: 13px; }
.hero .search {
  margin-top: 16px; display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.92); color: #333;
  border-radius: 14px; padding: 11px 14px; font-size: 14px;
}
.hero .search svg { width: 18px; height: 18px; color: #888; }
/* 商城地区选择（折叠为下拉，点开选择） */
.mall-city {
  margin-top: 12px; background: #fff; color: var(--text);
  border: none; box-shadow: 0 6px 18px rgba(0,0,0,.12); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c6c7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}

/* ---------- 分类胶囊 ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; margin: 12px -2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-2); white-space: nowrap;
  transition: all .2s ease;
}
.chip.active { color: #fff; background: var(--grad); border-color: transparent; font-weight: 700; box-shadow: var(--shadow-sm); }

/* ---------- 首页商品（纵向网格，跟随页面上下滚动） ---------- */
.home-scroll {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---------- 商品网格（2 列大图） ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .28s cubic-bezier(.16,1,.3,1), box-shadow .28s ease;
  display: flex; flex-direction: column;
}
.card:active { transform: scale(.985); }
@media (hover: hover) {
  .card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
}
.card .thumb { aspect-ratio: 1/1; width: 100%; object-fit: cover; }
.card .body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name {
  font-size: 13.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.price { color: var(--brand); font-weight: 800; font-size: 16px; }
.price small { font-size: 11px; font-weight: 700; }
.price-old { color: var(--text-2); text-decoration: line-through; font-size: 11px; }
.sales { margin-left: auto; font-size: 11px; color: var(--text-2); }
.merchant {
  margin-left: auto; font-size: 11px; color: var(--text-2);
  max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: right;
}
.tag-rec {
  position: absolute; margin: 8px; padding: 3px 8px; border-radius: 8px;
  background: rgba(0,0,0,.45); color: #fff; font-size: 10px; backdrop-filter: blur(4px);
}
.thumb-wrap { position: relative; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 14px; padding: 13px 18px;
  font-size: 15px; font-weight: 700; color: #fff; background: var(--grad);
  box-shadow: var(--shadow-sm); transition: transform .15s ease, filter .2s ease;
}
.btn:active { transform: scale(.97); filter: brightness(1.05); }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface-2); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 12px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.input {
  width: 100%; padding: 13px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 15px; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--grad-soft); }

/* ---------- 列表 / 面板 ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm);
}
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); transition: background .2s ease;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--surface-2); }
.list-item .li-ico {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--grad-soft); color: var(--brand); flex: 0 0 auto;
}
.list-item .li-ico svg { width: 19px; height: 19px; }
.list-item .li-main { flex: 1; }
.list-item .li-main b { font-size: 15px; font-weight: 600; }
.list-item .li-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.list-item .li-arrow { color: var(--text-2); }

/* ---------- 我的（个人中心） ---------- */
.profile {
  position: relative; border-radius: var(--radius); padding: 22px 18px;
  color: #fff; background: var(--grad); overflow: hidden; box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.profile::before { content:""; position:absolute; right:-30px; top:-30px; width:160px; height:160px; border-radius:50%; background:rgba(255,255,255,.18); }
.profile .row { display: flex; align-items: center; gap: 14px; position: relative; }
.avatar {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  font-size: 24px; font-weight: 800; color: #fff;
  background: rgba(255,255,255,.25); border: 2px solid rgba(255,255,255,.5);
}
.profile .pname { font-size: 19px; font-weight: 800; }
.profile .pphone { font-size: 13px; opacity: .9; margin-top: 2px; }
.profile .gear { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.profile .gear svg { width: 18px; height: 18px; }
.profile .stats { display: flex; gap: 22px; margin-top: 18px; position: relative; }
.profile .stats div b { font-size: 18px; font-weight: 800; display: block; }
.profile .stats div span { font-size: 12px; opacity: .9; }

.order-bar { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 6px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.order-bar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.order-bar a b { font-size: 15px; color: var(--text); font-weight: 700; }
.order-bar .ob-ico { width: 26px; height: 26px; color: var(--brand); }
.order-bar .ob-ico svg { width: 24px; height: 24px; }

.block-title { font-size: 13px; color: var(--text-2); margin: 4px 6px 8px; font-weight: 600; }

/* ---------- 商品详情 ---------- */
.detail-hero { margin: -16px -14px 0; }
.detail-hero img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.detail-info { padding: 16px 2px 0; }
.detail-price { display: flex; align-items: baseline; gap: 10px; }
.detail-price .price { font-size: 26px; }
.detail-name { font-size: 19px; font-weight: 800; margin: 10px 0 4px; line-height: 1.3; }
.detail-sub { color: var(--text-2); font-size: 13px; }
.meta-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 16px 0; }
.meta-grid .m { background: var(--surface-2); border-radius: 12px; padding: 12px; text-align: center; }
.meta-grid .m b { display: block; font-size: 16px; font-weight: 800; }
.meta-grid .m span { font-size: 11px; color: var(--text-2); }
.detail-block { margin: 18px 0; }
.detail-block h3 { font-size: 15px; margin: 0 0 10px; }
.detail-block .desc { color: var(--text-2); font-size: 14px; line-height: 1.7; }
.rec-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.rec-scroll::-webkit-scrollbar { display: none; }
.rec-scroll .card { flex: 0 0 150px; }

/* 底部购买条 */
.buybar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px calc(env(safe-area-inset-bottom) + 12px);
  background: var(--glass-strong); backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
}
@media (min-width: 520px) {
  .buybar { border-radius: 0 0 30px 30px; }
}
.buybar .bb-price { display: flex; flex-direction: column; }
.buybar .bb-price b { font-size: 20px; color: var(--brand); }
.buybar .bb-price span { font-size: 11px; color: var(--text-2); }

/* ---------- 订单确认 / 支付 ---------- */
.summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.summary .line { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.summary .line:last-child { border-bottom: none; }
.summary .line.total b { font-size: 20px; color: var(--brand); }
.amount-big { text-align: center; padding: 18px 0; }
.amount-big b { font-size: 38px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.amount-big span { display: block; font-size: 12px; color: var(--text-2); margin-top: 4px; }
.qr-box { display: grid; place-items: center; padding: 14px; }
.qr-box img { width: 200px; height: 200px; border-radius: 16px; background: #fff; padding: 10px; box-shadow: var(--shadow-sm); }
.notice {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: var(--grad-soft); color: var(--text); font-size: 13px; line-height: 1.6;
  border: 1px solid var(--border);
}
.notice svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--brand); margin-top: 2px; }
.upload-box {
  border: 1.5px dashed var(--brand); border-radius: 14px; padding: 18px; text-align: center;
  color: var(--text-2); font-size: 13px; cursor: pointer; transition: background .2s ease;
}
.upload-box:active { background: var(--surface-2); }
.upload-box img { max-height: 160px; margin: 8px auto 0; border-radius: 10px; }
.empty { text-align: center; color: var(--text-2); padding: 50px 20px; font-size: 14px; }
.empty svg { width: 46px; height: 46px; opacity: .4; margin-bottom: 10px; }

/* 状态徽标 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-wait { background: rgba(255,159,67,.16); color: var(--warn); }
.badge-confirm { background: rgba(109,94,252,.16); color: var(--brand); }
.badge-done { background: rgba(27,191,131,.16); color: var(--ok); }

/* 订单卡片 */
.order-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.order-card .oc-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.order-card .oc-prod { display: flex; gap: 12px; align-items: center; }
.order-card .oc-prod img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.order-card .oc-prod .oc-name { font-weight: 600; font-size: 14px; }
.order-card .oc-prod .oc-price { color: var(--brand); font-weight: 700; margin-top: 4px; }
.order-card .oc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

/* 动画 */
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card, .panel, .order-card, .profile { animation: pop .4s ease both; }
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(20px);
  background: rgba(20,20,30,.92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================================================================
   后台管理样式
   =================================================================== */
.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100dvh; }
.admin-side {
  width: 220px; flex: 0 0 220px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.admin-side .a-brand { font-weight: 800; font-size: 17px; padding: 6px 10px 18px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; color: var(--text-2); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.admin-nav a.active, .admin-nav a:hover { background: var(--grad-soft); color: var(--brand); }
.admin-main { flex: 1; padding: 22px; max-width: 100%; overflow-x: auto; }
.admin-main h1 { font-size: 22px; margin: 0 0 4px; }
.admin-main .sub { color: var(--text-2); font-size: 13px; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.stat b { font-size: 28px; font-weight: 800; display: block; }
.stat span { color: var(--text-2); font-size: 13px; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 12px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.table th { background: var(--surface-2); font-weight: 700; color: var(--text-2); }
.table tr:last-child td { border-bottom: none; }
.table img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; place-items: center; z-index: 50; padding: 16px; }
.modal-mask.show { display: grid; }
.modal { background: var(--surface); width: 100%; max-width: 460px; border-radius: var(--radius); padding: 22px; max-height: 90dvh; overflow-y: auto; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 16px; }
@media (max-width: 720px) {
  .admin-side { display: none; }
}

/* ---------- 转售角标 ---------- */
.tag-resale {
  position: absolute; margin: 8px; padding: 3px 8px; border-radius: 8px;
  background: linear-gradient(135deg, #ff9f43, #ff5470); color: #fff;
  font-size: 10px; font-weight: 700; backdrop-filter: blur(4px); box-shadow: var(--shadow-sm);
}

/* ---------- 首页公告滚动 ---------- */
.marquee {
  overflow: hidden; white-space: nowrap; background: var(--grad-soft);
  border-bottom: 1px solid var(--border); padding: 8px 0; margin: -14px -16px 14px;
}
.marquee-track { display: inline-flex; gap: 60px; animation: marquee 18s linear infinite; padding-left: 100%; }
.marquee-track span { font-size: 12px; color: var(--brand); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ---------- 分段切换 ---------- */
.seg { background: var(--surface-2); border-radius: 12px; padding: 4px; }
.seg-item { flex: 1; text-align: center; padding: 8px; border-radius: 9px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.seg-item.active { background: var(--surface); color: var(--brand); font-weight: 700; box-shadow: var(--shadow-sm); }

/* ---------- 富文本编辑器 ---------- */
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  align-items: center;
}
.rte-toolbar button {
  height: 28px; min-width: 28px; padding: 0 5px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.rte-toolbar button:hover { background: var(--brand-soft, rgba(99,102,241,.1)); border-color: var(--brand); }
.rte-toolbar button:active { transform: scale(0.92); }
.rte-tb-select {
  height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 12px; cursor: pointer;
  padding: 0 5px; outline: none;
}
.rte-color-picker {
  width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); cursor: pointer; padding: 2px;
}
.rte-divider {
  width: 1px; height: 18px; background: var(--border);
  margin: 0 2px;
}
.rte {
  min-height: 140px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  background: var(--surface); color: var(--text); font-size: 14px; outline: none;
  overflow-y: auto; line-height: 1.6;
}
.rte:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--grad-soft); }
.rte h1 { font-size: 1.6em; font-weight: 700; margin: .4em 0; }
.rte h2 { font-size: 1.35em; font-weight: 700; margin: .4em 0; }
.rte h3 { font-size: 1.15em; font-weight: 600; margin: .3em 0; }
.rte p { margin: .3em 0; }
.rte img { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.rte ul, .rte ol { padding-left: 20px; margin: .3em 0; }
.rte a { color: var(--brand); }

/* ---------- 辅助文字 ---------- */
.text-success { color: var(--ok); }
.text-danger { color: var(--danger); }
