:root {
  --bg: #ede8dc;
  --paper: #fffdf8;
  --paper-2: #f8f2e8;
  --ink: #172521;
  --text: #262721;
  --muted: #777064;
  --line: #dfd3bf;
  --pine: #2f6255;
  --pine-2: #e5eee9;
  --copper: #a36d45;
  --copper-2: #f3e2ce;
  --warning: #8a5e35;
  --mini-bg: #f5f5f1;
  --mini-paper: #fffefb;
  --mini-paper-2: #f9f9f5;
  --mini-ink: #151815;
  --mini-muted: #737870;
  --mini-line: #ddddd5;
  --mini-jade: #2d6359;
  --mini-jade-2: #e9f1ed;
  --mini-cinnabar: #8f332f;
  --mini-cinnabar-2: #f1e8e5;
  --mini-lacquer: #1e1d1b;
  --mini-gold: #b08a4a;
  --shadow: 0 24px 70px rgba(31, 35, 29, 0.14);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(47, 98, 85, 0.12), transparent 28%),
    linear-gradient(180deg, #faf6ed 0, var(--bg) 280px);
  word-break: keep-all;
}
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }

.workspace { width: min(1320px, calc(100vw - 36px)); margin: 0 auto; padding: 18px 0 42px; }
.product-shell {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  margin-bottom: 18px;
  color: #f8efe1;
  background: linear-gradient(135deg, #15231f, #20342f 65%, #6f5239);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(23, 37, 33, 0.2);
}
.brand-lockup, .admin-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  color: var(--ink);
  background: #ead8bd;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  font-weight: 760;
}
.brand-mark.small { width: 30px; height: 30px; color: #f7e7c8; background: var(--ink); font-size: 13px; }
.brand-lockup strong, .admin-brand strong { display: block; margin-bottom: 1px; font-weight: 720; }
.brand-lockup small { display: block; color: rgba(248, 239, 225, 0.68); font-size: 12px; }
.top-nav { display: flex; gap: 4px; padding: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 8px; }
.top-nav span { padding: 7px 11px; color: rgba(248, 239, 225, 0.68); border-radius: 6px; font-size: 13px; }
.top-nav span:first-child { color: #fff7e9; background: rgba(255, 255, 255, 0.12); }
.top-action { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 13px; color: #f8efe1; background: rgba(234, 216, 189, 0.13); border: 1px solid rgba(234, 216, 189, 0.22); border-radius: 8px; white-space: nowrap; }
body.front-only .desktop-panel { display: none; }
body.front-only .prototype-grid { display: block; }
body.front-only .phone-frame { width: 410px; max-width: min(410px, 100%); margin: 0 auto; }
body.admin-only .phone-frame { display: none; }
body.admin-only .prototype-grid { display: block; }
body.admin-only .desktop-panel { width: 100%; }
body.admin-only .top-nav span:first-child { color: rgba(248, 239, 225, 0.68); background: transparent; }
body.admin-only .top-nav span:nth-child(2) { color: #fff7e9; background: rgba(255, 255, 255, 0.12); }

.prototype-grid { display: grid; grid-template-columns: 410px minmax(0, 1fr); gap: 24px; align-items: start; }
.phone-frame, .desktop-panel { min-width: 0; max-width: 100%; border: 1px solid #d8cbb7; border-radius: 8px; box-shadow: var(--shadow); }
.phone-frame { position: sticky; top: 18px; overflow: hidden; min-height: 790px; padding: 10px; background: #151a17; }
.phone-status { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; color: var(--mini-muted); background: var(--mini-paper); border-bottom: 1px solid var(--mini-line); border-radius: 8px 8px 0 0; font-size: 12px; }
.phone-title { color: var(--mini-ink); font-weight: 700; }
.miniapp-page { min-height: 656px; padding: 18px 16px 86px; background: var(--mini-bg); border-right: 1px solid var(--mini-line); border-left: 1px solid var(--mini-line); }

.mini-header, .sub-header, .section-title, .dashboard-head, .sheet-head, .conversion-strip { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.mini-header { align-items: flex-start; margin-bottom: 12px; }
.muted { margin: 0; color: var(--muted); font-size: 13px; }
.miniapp-page .muted { color: var(--mini-muted); }
.mini-header h2, .sub-header h2 { margin-bottom: 0; color: var(--ink); font-size: 20px; line-height: 1.3; letter-spacing: 0; font-weight: 600; }
.miniapp-page .mini-header h2, .miniapp-page .sub-header h2 { color: var(--mini-ink); }
.icon-button { width: 34px; height: 34px; flex: 0 0 auto; color: var(--mini-jade); background: #f0f2ee; border: 1px solid var(--mini-line); border-radius: 50%; }
.search-pill { width: 100%; height: 42px; margin-bottom: 12px; padding: 0 14px; text-align: left; color: var(--mini-muted); background: var(--mini-paper); border: 1px solid var(--mini-line); border-radius: 8px; font-weight: 420; }

.ui-icon, .metric-icon, .lead-icon, .title-icon, .mini-icon, .step-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  color: var(--mini-jade);
  background: linear-gradient(135deg, #f8f9f5, #fffefa);
  border: 1px solid #d9dbd4;
  border-radius: 8px;
}
.ui-icon::before, .ui-icon::after, .metric-icon::before, .metric-icon::after, .lead-icon::before, .lead-icon::after, .title-icon::before, .title-icon::after, .mini-icon::before, .mini-icon::after, .step-icon::before, .step-icon::after, .product-thumb::before, .product-thumb::after, .catalog-image::before, .catalog-image::after { content: ""; position: absolute; box-sizing: border-box; }
.ui-icon { width: 34px; height: 34px; }
.metric-icon { width: 34px; height: 34px; margin-bottom: 12px; }
.lead-icon { grid-row: 1 / span 3; width: 36px; height: 36px; }
.title-icon { width: 24px; height: 24px; margin-right: 8px; vertical-align: -6px; }
.mini-icon { width: 16px; height: 16px; margin-right: 5px; border-radius: 5px; background: rgba(255, 254, 250, 0.7); }
.section-title h3, .rule-panel h3, .note-panel h3, .detail-main h3 { display: flex; align-items: center; min-width: 0; }

.icon-shroud::before, .icon-shroud-large::before { width: 15px; height: 19px; border: 2px solid currentColor; border-top: 0; border-radius: 4px 4px 6px 6px; }
.icon-shroud::after, .icon-shroud-large::after { top: 9px; width: 10px; height: 8px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(45deg); }
.icon-urn { color: #f5eee1; background: linear-gradient(135deg, var(--mini-lacquer), #4e403c); border-color: rgba(255, 255, 255, 0.16); }
.icon-urn::before, .icon-urn-large::before { width: 18px; height: 16px; border: 2px solid currentColor; border-radius: 4px 4px 7px 7px; }
.icon-urn::after, .icon-urn-large::after { top: 9px; width: 22px; height: 4px; background: currentColor; border-radius: 999px; }
.icon-store::before { top: 8px; width: 20px; height: 9px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(45deg); }
.icon-store::after { bottom: 8px; width: 19px; height: 12px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 4px 4px; }
.icon-guide::before { width: 5px; height: 5px; background: currentColor; border-radius: 50%; box-shadow: -8px 8px 0 currentColor, 8px 8px 0 currentColor; }
.icon-guide::after { width: 19px; height: 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; border-radius: 0 0 8px 8px; }
.icon-ritual::before { width: 18px; height: 18px; border: 2px solid currentColor; border-radius: 50%; }
.icon-ritual::after { width: 2px; height: 18px; background: currentColor; box-shadow: 0 0 0 2px rgba(255, 254, 250, 0.88); transform: rotate(45deg); border-radius: 999px; }
.icon-ai::before { width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 50% 50% 45% 45%; }
.icon-ai::after { width: 4px; height: 4px; background: currentColor; border-radius: 50%; box-shadow: -5px 0 0 currentColor, 5px 0 0 currentColor, 0 7px 0 currentColor; transform: translateY(-1px); }
.icon-service::before { width: 16px; height: 20px; border: 2px solid currentColor; border-radius: 6px; transform: rotate(-12deg); }
.icon-service::after { bottom: 9px; width: 5px; height: 2px; background: currentColor; border-radius: 999px; }
.icon-price::before { content: "¥"; position: static; font-size: 11px; font-weight: 750; }
.icon-stock::before { width: 11px; height: 10px; border: 2px solid currentColor; border-radius: 2px; }
.icon-stock::after { top: 3px; width: 8px; height: 5px; border-top: 2px solid currentColor; }
.icon-clock::before { width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 50%; }
.icon-clock::after { width: 5px; height: 6px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; transform: translate(2px, -1px); }
.icon-product::before { width: 14px; height: 12px; border: 2px solid currentColor; border-radius: 3px; }
.icon-product::after { width: 14px; height: 2px; background: currentColor; transform: translateY(-4px); }
.icon-flow::before { width: 5px; height: 5px; background: currentColor; border-radius: 50%; box-shadow: 0 -8px 0 currentColor, 8px 8px 0 currentColor; }
.icon-flow::after { width: 15px; height: 16px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: translate(1px, 2px) rotate(12deg); }
.icon-rank::before { bottom: 6px; left: 6px; width: 3px; height: 8px; background: currentColor; box-shadow: 6px -4px 0 currentColor, 12px -8px 0 currentColor; border-radius: 999px; }
.icon-rank::after { bottom: 5px; left: 5px; width: 17px; height: 2px; background: currentColor; border-radius: 999px; }
.icon-response::before { width: 16px; height: 16px; border: 2px solid currentColor; border-bottom-color: transparent; border-radius: 50%; }
.icon-response::after { width: 9px; height: 2px; background: currentColor; transform: translate(3px, 2px) rotate(-35deg); transform-origin: left center; border-radius: 999px; }
.icon-lead::before { width: 13px; height: 16px; border: 2px solid currentColor; border-radius: 3px; }
.icon-lead::after { width: 8px; height: 2px; background: currentColor; box-shadow: 0 5px 0 currentColor; transform: translateY(-2px); }
.icon-check::before { width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 50%; }
.icon-check::after { width: 9px; height: 5px; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(-45deg) translate(1px, -1px); }
.icon-deal::before { width: 16px; height: 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; border-radius: 3px; }
.icon-deal::after { width: 18px; height: 6px; border: 2px solid currentColor; border-radius: 999px; transform: translateY(-5px); }
.icon-detail::before { width: 14px; height: 17px; border: 2px solid currentColor; border-radius: 3px; }
.icon-detail::after { width: 8px; height: 2px; background: currentColor; box-shadow: 0 5px 0 currentColor; transform: translateY(-2px); }
.icon-alert::before { width: 17px; height: 17px; border: 2px solid currentColor; border-radius: 50%; }
.icon-alert::after { width: 2px; height: 9px; background: currentColor; box-shadow: 0 11px 0 currentColor; border-radius: 999px; transform: translateY(-3px); }
.icon-customer::before { top: 8px; width: 9px; height: 9px; border: 2px solid currentColor; border-radius: 50%; }
.icon-customer::after { bottom: 7px; width: 18px; height: 10px; border: 2px solid currentColor; border-radius: 10px 10px 4px 4px; }
.icon-note::before { width: 14px; height: 17px; border: 2px solid currentColor; border-radius: 3px; }
.icon-note::after { width: 8px; height: 2px; background: currentColor; box-shadow: 0 5px 0 currentColor; transform: translateY(-2px); }
.icon-match::before { width: 7px; height: 7px; background: currentColor; border-radius: 50%; box-shadow: -8px 8px 0 currentColor, 8px 8px 0 currentColor; }
.icon-match::after { width: 20px; height: 14px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; border-radius: 0 0 10px 10px; }

.primary-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 14px; color: var(--mini-ink); background: var(--mini-paper); border: 1px solid var(--mini-line); border-left: 3px solid var(--mini-jade); border-radius: 8px; box-shadow: 0 8px 20px rgba(21, 24, 21, 0.045); }
.primary-card::after { display: none; }
.primary-card p { margin-bottom: 5px; color: var(--mini-cinnabar); font-size: 12px; font-weight: 580; }
.primary-card h3 { max-width: 220px; margin-bottom: 0; color: var(--mini-ink); font-size: 15px; line-height: 1.42; font-weight: 600; }
.primary-action { min-height: 42px; padding: 0 18px; color: #fff; background: var(--mini-jade); border-radius: 8px; font-weight: 580; }
.primary-card .primary-action { width: auto; min-width: 88px; color: #fff; background: var(--mini-jade); }
.full { width: 100%; }
.miniapp-page > .primary-action.full { min-height: 40px; font-size: 14px; }
.miniapp-page[data-screen="ritual-result"] > .primary-action.full { display: block; width: auto; min-width: 136px; min-height: 36px; margin: 2px 0 0 auto; padding: 0 16px; background: #285d54; border-radius: 999px; font-size: 13px; font-weight: 560; }

.ritual-card { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 14px; margin-bottom: 12px; color: var(--mini-ink); background: linear-gradient(135deg, #fffefb, #f5f7f3); border: 1px solid var(--mini-line); border-left: 3px solid var(--mini-cinnabar); border-radius: 8px; box-shadow: 0 10px 22px rgba(21, 24, 21, 0.05); }
.ritual-card .ui-icon { width: 36px; height: 36px; color: var(--mini-cinnabar); }
.ritual-card p, .recommend-card p, .ritual-summary p { margin-bottom: 3px; color: var(--mini-cinnabar); font-size: 12px; font-weight: 560; }
.ritual-card h3, .ritual-summary h3, .recommend-card h3 { margin-bottom: 0; color: var(--mini-ink); font-size: 15px; line-height: 1.38; font-weight: 600; }
.ritual-intro { display: grid; gap: 8px; }
.ritual-form { display: grid; gap: 10px; }
.ritual-form label { display: grid; gap: 7px; color: var(--mini-muted); font-size: 13px; }
.ritual-form input, .ritual-form select { width: 100%; height: 42px; padding: 0 12px; color: var(--mini-ink); background: var(--mini-paper); border: 1px solid var(--mini-line); border-radius: 8px; }
.ritual-note { margin: 12px 0 0; color: var(--mini-muted); font-size: 12px; line-height: 1.65; }
.ritual-summary { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 11px 12px; margin-bottom: 9px; background: var(--mini-paper); border: 1px solid var(--mini-line); border-left: 3px solid var(--mini-cinnabar); border-radius: 8px; }
.ritual-summary .ui-icon { width: 34px; height: 34px; color: var(--mini-cinnabar); }
.bazi-panel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px; margin-bottom: 9px; background: #f8f8f4; border: 1px solid var(--mini-line); border-radius: 8px; }
.bazi-panel div { display: grid; gap: 3px; min-width: 0; text-align: center; }
.bazi-panel span { color: var(--mini-muted); font-size: 11px; }
.bazi-panel strong { color: var(--mini-ink); font-size: 15px; font-weight: 620; }
.bazi-panel p { grid-column: 1 / -1; margin: 5px 0 0; color: var(--mini-muted); font-size: 12px; line-height: 1.5; }
.ai-advice-card { padding: 11px 12px; margin-bottom: 9px; background: #fbfbf7; border: 1px solid var(--mini-line); border-radius: 8px; }
.ai-advice-head { display: grid; grid-template-columns: 32px 1fr auto; gap: 9px; align-items: center; margin-bottom: 7px; }
.ai-advice-head .ui-icon { width: 32px; height: 32px; color: var(--mini-jade); }
.ai-advice-head p { margin-bottom: 2px; color: var(--mini-cinnabar); font-size: 12px; }
.ai-advice-head h3 { margin: 0; color: var(--mini-ink); font-size: 14px; line-height: 1.35; font-weight: 600; }
.confidence-tag { padding: 5px 7px; color: var(--mini-jade); background: var(--mini-jade-2); border-radius: 999px; font-size: 11px; white-space: nowrap; }
.ai-advice-card > p { margin: 0 0 8px; color: var(--mini-muted); font-size: 12px; line-height: 1.5; }
.source-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.source-chips span { padding: 5px 7px; color: var(--mini-muted); background: #f0f1ec; border-radius: 999px; font-size: 11px; }
.ai-advice-card button, .question-chips button { padding: 7px 10px; color: var(--mini-jade); background: var(--mini-jade-2); border-radius: 999px; font-size: 12px; }
.chat-panel { display: grid; gap: 10px; margin-bottom: 12px; }
.chat-bubble { max-width: 92%; padding: 11px 12px; border-radius: 8px; }
.chat-bubble strong { display: block; margin-bottom: 5px; color: var(--mini-ink); font-size: 13px; }
.chat-bubble p { margin: 0; color: var(--mini-muted); font-size: 13px; line-height: 1.6; }
.chat-bubble.ai { background: var(--mini-paper); border: 1px solid var(--mini-line); }
.chat-bubble.user { justify-self: end; color: #fff; background: var(--mini-jade); }
.chat-bubble.user p { color: #fff; }
.question-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.recommend-stack { display: grid; gap: 7px; margin-bottom: 10px; }
.recommend-card { display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: start; padding: 10px 11px; background: var(--mini-paper); border: 1px solid var(--mini-line); border-radius: 8px; }
.recommend-card.main { background: #fbfbf7; border-color: #d8d8cf; }
.recommend-card .ui-icon { width: 30px; height: 30px; }
.recommend-card small { display: block; margin-top: 3px; color: var(--mini-muted); font-size: 12px; line-height: 1.42; }
.recommend-card .icon-shroud { color: var(--mini-cinnabar); }
.recommend-card .icon-urn { color: #f5eee1; }
.color-advice { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: var(--mini-ink); font-size: 12px; }
.color-advice i { width: 32px; height: 12px; flex: 0 0 auto; background: linear-gradient(90deg, #f5f4ec, #2f635a 48%, #4d514f); border: 1px solid var(--mini-line); border-radius: 999px; }

.ritual-loading { position: absolute; inset: 10px; z-index: 8; display: grid; place-items: center; align-content: center; gap: 10px; padding: 24px; text-align: center; color: var(--mini-ink); background: rgba(255, 254, 250, 0.92); backdrop-filter: blur(12px); }
.ritual-loading strong { font-size: 16px; font-weight: 620; }
.ritual-loading p { max-width: 240px; margin: 0; color: var(--mini-muted); font-size: 12px; line-height: 1.6; }
.bagua-mark { position: relative; width: 86px; height: 86px; color: var(--mini-lacquer); border: 2px solid currentColor; border-radius: 50%; animation: bagua-spin 1.15s linear infinite; }
.bagua-mark::before, .bagua-mark::after { content: ""; position: absolute; inset: 8px; border: 1px solid currentColor; border-radius: 50%; }
.bagua-mark::after { inset: 21px; background: linear-gradient(90deg, currentColor 50%, #fffefa 50%); border-width: 0; }
.bagua-mark span, .bagua-mark i, .bagua-mark b { position: absolute; left: 50%; width: 28px; height: 3px; background: currentColor; border-radius: 999px; transform: translateX(-50%); }
.bagua-mark span { top: -12px; box-shadow: 0 106px 0 currentColor; }
.bagua-mark i { top: 50%; left: -12px; transform: rotate(90deg); transform-origin: 57px 1px; box-shadow: 0 106px 0 currentColor; }
.bagua-mark b { top: 50%; transform: translateX(-50%) rotate(45deg); box-shadow: 0 106px 0 currentColor; }
@keyframes bagua-spin { to { transform: rotate(360deg); } }

.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.trust-row span { display: flex; justify-content: center; align-items: center; padding: 9px 6px; color: var(--mini-jade); text-align: center; background: #f1f5f2; border: 1px solid #d9e2dd; border-radius: 8px; font-size: 12px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.quick-actions button { display: grid; grid-template-columns: 30px 1fr; gap: 3px 10px; align-items: center; min-height: 78px; padding: 13px; text-align: left; background: var(--mini-paper); border: 1px solid var(--mini-line); border-radius: 8px; box-shadow: 0 6px 16px rgba(21, 24, 21, 0.025); }
.quick-actions .ui-icon { grid-row: span 2; width: 30px; height: 30px; border-radius: 8px; }
.miniapp-page .ui-icon, .miniapp-page .title-icon, .miniapp-page .mini-icon, .miniapp-page .step-icon { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.quick-actions .icon-shroud { color: var(--mini-cinnabar); }
.quick-actions .icon-ritual { color: var(--mini-cinnabar); }
.quick-actions .icon-urn { color: #f5eee1; }
.quick-actions .icon-store { color: var(--mini-jade); }
.quick-actions .icon-guide { color: var(--mini-gold); }
.lead-icon.icon-urn { color: #f5e3c4; }
.quick-actions span, .product-row strong, .catalog-card h3, .store-card h3, .customer-card h3 { font-weight: 580; }
.quick-actions small, .product-row small, .catalog-card p, .store-card p, .customer-card p, .note-panel p, .detail-main p, .timeline p, .store-admin-card p, .lead-card span, .lead-card em { color: var(--muted); line-height: 1.55; }
.miniapp-page .quick-actions small, .miniapp-page .product-row small, .miniapp-page .catalog-card p, .miniapp-page .store-card p, .miniapp-page .detail-main p, .miniapp-page .timeline p { color: var(--mini-muted); }

.section-block, .catalog-card, .store-card, .board-card, .table-card, .customer-card, .note-panel, .detail-main, .progress-card, .store-admin-card, .rule-panel { background: var(--paper); border: 1px solid #e6d9c6; border-radius: 8px; }
.miniapp-page .section-block, .miniapp-page .catalog-card, .miniapp-page .store-card, .miniapp-page .detail-main, .miniapp-page .progress-card { background: var(--mini-paper); border-color: var(--mini-line); }
.section-block, .board-card, .table-card, .note-panel { padding: 16px; }
.section-title h3, .dashboard-head h2, .sheet-head h3 { margin-bottom: 0; }
.section-title button, .sub-header button, .dashboard-head button, .store-actions button, .customer-actions button, .sheet-head button, .ghost-action, .assign-box button { padding: 8px 12px; color: #6f6658; background: #f2eadf; border-radius: 8px; white-space: nowrap; }
.miniapp-page .section-title button, .miniapp-page .sub-header button, .miniapp-page .store-actions button, .miniapp-page .ghost-action { color: var(--mini-jade); background: var(--mini-jade-2); }
.product-list { display: grid; gap: 8px; margin-top: 14px; }
.product-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 8px; text-align: left; background: var(--mini-paper-2); border: 1px solid var(--mini-line); border-radius: 8px; }
.product-thumb, .catalog-image { position: relative; display: block; overflow: hidden; border: 1px solid #e6d9c6; border-radius: 8px; }
.product-thumb { width: 52px; height: 52px; color: var(--mini-cinnabar); background: linear-gradient(135deg, #e7e7df, #fffefa); }
.product-thumb::before { top: 15px; left: 17px; width: 18px; height: 22px; border: 2px solid currentColor; border-top: 0; border-radius: 4px 4px 7px 7px; }
.product-thumb::after { top: 17px; left: 21px; width: 10px; height: 8px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(45deg); }
.product-thumb.dark { color: #f5eee1; background: linear-gradient(135deg, var(--mini-lacquer), #4e403c); }
.product-thumb.dark::before { top: 18px; left: 16px; width: 20px; height: 16px; border: 2px solid currentColor; border-radius: 4px 4px 8px 8px; }
.product-thumb.dark::after { top: 15px; left: 14px; width: 24px; height: 4px; background: currentColor; border: 0; border-radius: 999px; transform: none; }
.product-row span:nth-child(2) { display: grid; gap: 3px; }
.product-row em { color: var(--mini-cinnabar); font-size: 12px; font-style: normal; font-weight: 700; }
.insight-preview { margin-top: 12px; }
.insight-row { display: grid; gap: 4px; width: 100%; margin-top: 12px; padding: 12px; text-align: left; color: var(--mini-ink); background: #fbfbf7; border: 1px solid var(--mini-line); border-radius: 8px; }
.insight-row small { color: var(--mini-muted); line-height: 1.5; }
.insight-search { margin-bottom: 12px; }
.insight-tags { margin-bottom: 12px; }
.featured-insight { padding: 15px; margin-bottom: 12px; color: var(--mini-ink); background: linear-gradient(135deg, #fffefb, #f5f7f3); border: 1px solid var(--mini-line); border-left: 3px solid var(--mini-cinnabar); border-radius: 8px; }
.featured-insight h3 { margin: 9px 0 7px; font-size: 17px; line-height: 1.38; }
.featured-insight p { margin-bottom: 12px; color: var(--mini-muted); font-size: 13px; line-height: 1.65; }
.insight-actions { display: flex; gap: 8px; }
.insight-actions button { flex: 1; min-height: 38px; color: var(--mini-jade); background: var(--mini-jade-2); border-radius: 8px; font-weight: 560; }
.insight-actions button:first-child { color: #fff; background: var(--mini-jade); }
.article-list { display: grid; gap: 9px; margin-bottom: 12px; }
.article-card { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px; background: var(--mini-paper); border: 1px solid var(--mini-line); border-radius: 8px; }
.article-card .ui-icon { width: 34px; height: 34px; }
.article-card p { margin-bottom: 3px; color: var(--mini-cinnabar); font-size: 12px; font-weight: 560; }
.article-card h3 { margin-bottom: 4px; color: var(--mini-ink); font-size: 14px; line-height: 1.45; }
.article-card small { color: var(--mini-muted); line-height: 1.5; }
.info-conversion { padding: 14px; background: var(--mini-cinnabar-2); border: 1px solid #e5cbc7; border-radius: 8px; }
.info-conversion strong { color: var(--mini-ink); }
.info-conversion p { margin: 5px 0 12px; color: var(--mini-muted); font-size: 13px; line-height: 1.6; }
.conversion-strip { margin-top: 14px; padding: 12px 14px; color: var(--mini-cinnabar); background: var(--mini-cinnabar-2); border: 1px solid #e5cbc7; border-radius: 8px; font-size: 13px; }
.conversion-strip span { display: flex; align-items: center; min-width: 0; }
.conversion-strip button { flex: 0 0 auto; padding: 8px 12px; color: #fff; background: var(--mini-jade); border-radius: 8px; }

.sub-header { margin-bottom: 18px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; }
.filter-row button { flex: 0 0 auto; padding: 9px 14px; color: var(--mini-muted); background: #ecece6; border-radius: 999px; }
.filter-row .active, .tabbar .active { color: #fff; background: var(--mini-jade); }
.catalog-card, .store-card { display: grid; gap: 14px; padding: 14px; margin-bottom: 12px; }
.catalog-image { height: 132px; color: var(--mini-cinnabar); background: linear-gradient(135deg, #dfdfd6, #fffefa); }
.catalog-image.light { background: linear-gradient(135deg, #ebebe4, #fffefa); }
.catalog-image.wood { color: #f5eee1; background: linear-gradient(135deg, var(--mini-lacquer), #50423e); }
.catalog-image.stone { color: var(--mini-jade); background: linear-gradient(135deg, #d7e0dc, #fbfdfb); }
.catalog-image.icon-shroud-large::before { top: 38px; left: 50%; width: 44px; height: 58px; border-width: 3px; border-radius: 8px 8px 14px 14px; transform: translateX(-50%); }
.catalog-image.icon-shroud-large::after { top: 43px; left: 50%; width: 24px; height: 18px; border-width: 3px; transform: translateX(-50%) rotate(45deg); }
.catalog-image.icon-urn-large::before { top: 55px; left: 50%; width: 54px; height: 42px; border-width: 3px; border-radius: 8px 8px 16px 16px; transform: translateX(-50%); }
.catalog-image.icon-urn-large::after { top: 45px; left: 50%; width: 66px; height: 9px; border: 0; background: currentColor; border-radius: 999px; transform: translateX(-50%); }
.catalog-card button { height: 40px; color: var(--mini-cinnabar); background: var(--mini-cinnabar-2); border-radius: 8px; font-weight: 620; }
.detail-hero { height: 190px; margin-bottom: 14px; background: linear-gradient(135deg, #d7d0c2, #f8f5ed 55%, #ffffff); border: 1px solid var(--line); border-radius: 8px; }
.detail-main, .progress-card { padding: 16px; margin-bottom: 12px; }
.progress-card { display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; align-items: start; }
.progress-card .ui-icon { grid-row: 1 / span 3; }
.detail-main.compact { background: var(--mini-paper-2); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-tags span { padding: 7px 10px; color: var(--mini-jade); background: var(--mini-jade-2); border-radius: 999px; font-size: 12px; }
.plain-list { display: grid; gap: 8px; padding-left: 18px; margin: 0; color: var(--muted); line-height: 1.6; }
.location-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; margin-bottom: 14px; background: #ecece6; border-radius: 8px; }
.location-bar button { color: var(--mini-cinnabar); background: transparent; }
.store-card { grid-template-columns: 34px 1fr; align-items: start; }
.store-card .store-actions { grid-column: 2; }
.store-actions, .customer-actions { display: flex; gap: 8px; }
.store-actions button:first-child, .customer-actions button:first-child { color: #fff; background: var(--mini-jade); }
.steps, .timeline { display: grid; gap: 12px; padding: 0; margin: 0 0 18px; list-style: none; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px; border: 1px solid #e6d9c6; border-radius: 8px; }
.steps span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--mini-jade); background: var(--mini-jade-2); border-radius: 50%; }
.steps .step-icon { position: relative; overflow: hidden; border: 1px solid #cfe1d8; }
.timeline li { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; top: 22px; bottom: 0; left: 9px; width: 1px; background: var(--mini-line); }
.timeline li:last-child::before { display: none; }
.timeline span { width: 20px; height: 20px; background: var(--mini-paper); border: 2px solid var(--mini-line); border-radius: 50%; }
.timeline .done span { background: var(--mini-jade); border-color: var(--mini-jade); }

.tabbar { position: absolute; right: 10px; bottom: 10px; left: 10px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px 10px 10px; background: rgba(255, 254, 250, 0.96); border-top: 1px solid var(--mini-line); border-radius: 0 0 8px 8px; backdrop-filter: blur(14px); }
.tabbar button { position: relative; min-width: 0; height: 34px; color: var(--mini-muted); background: transparent; border-radius: 8px; font-size: 13px; }
.tabbar .active { color: var(--mini-jade); background: transparent; font-weight: 600; }
.tabbar .active::before { content: ""; position: absolute; top: 2px; left: 50%; width: 18px; height: 2px; background: var(--mini-jade); border-radius: 999px; transform: translateX(-50%); }
.lead-sheet { position: absolute; inset: 10px; display: grid; align-items: end; background: rgba(23, 37, 33, 0.24); }
.sheet-panel { padding: 18px; background: var(--mini-paper); border-radius: 8px 8px 0 0; }
.sheet-panel label { display: grid; gap: 7px; margin: 12px 0; color: var(--muted); font-size: 13px; }
.sheet-panel input, .sheet-panel select { width: 100%; height: 44px; padding: 0 12px; color: var(--mini-ink); background: var(--mini-paper-2); border: 1px solid transparent; border-radius: 8px; }
.success-text { margin: 12px 0 0; padding: 12px; color: var(--mini-jade); background: var(--mini-jade-2); border-radius: 8px; line-height: 1.6; }
.ghost-action { width: 100%; margin-top: 10px; color: var(--mini-jade); background: var(--mini-jade-2); }

.desktop-panel { overflow: hidden; padding: 18px 20px 20px; background: var(--paper); }
.admin-chrome { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding-bottom: 16px; margin-bottom: 14px; border-bottom: 1px solid #e6d9c6; }
.admin-tools { display: flex; gap: 8px; }
.admin-tools button { height: 34px; padding: 0 12px; color: var(--muted); background: #f2eadf; border-radius: 8px; }
.panel-switch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 5px; margin-bottom: 18px; background: #f3eadc; border-radius: 8px; }
.panel-switch button { min-width: 0; padding: 9px 12px; color: #776d60; background: transparent; border-radius: 8px; }
.panel-switch .active { color: #f9f5ec; background: var(--ink); }
.dashboard-head { margin-bottom: 16px; }
.dashboard-head h2 { font-size: 28px; line-height: 1.15; letter-spacing: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-grid div { padding: 16px; background: #fbf7ef; border: 1px solid #e6d9c6; border-radius: 8px; }
.stat-grid div:first-child { background: #f2f8f4; border-color: #d6e5dd; }
.stat-grid div:nth-child(4) { background: #fff4e8; border-color: #ead5bd; }
.stat-grid span, .stat-grid small { display: block; color: var(--muted); }
.stat-grid strong { display: block; margin: 8px 0 5px; color: var(--ink); font-size: 27px; }
.board-grid, .lead-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.lead-layout { grid-template-columns: minmax(260px, 0.9fr) 1.2fr; }
.lead-row, .rank-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid #e6d9c6; }
.lead-row:last-child, .rank-row:last-child { border-bottom: 0; }
.lead-row em, .rank-row em { color: var(--muted); font-size: 13px; font-style: normal; }
.lead-row.hot span { color: var(--warning); }
.rank-row { grid-template-columns: 50px 1fr 32px; }
.rank-row div { height: 8px; overflow: hidden; background: #f2eadf; border-radius: 999px; }
.rank-row i { display: block; height: 100%; background: linear-gradient(90deg, var(--pine), var(--copper)); border-radius: inherit; }
table { width: 100%; margin-top: 12px; border-collapse: collapse; }
th, td { padding: 14px 8px; text-align: left; border-bottom: 1px solid #e6d9c6; }
th { color: var(--muted); font-size: 13px; font-weight: 500; }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; color: var(--muted); background: #f2eadf; border-radius: 999px; font-size: 12px; }
.tag.good { color: var(--pine); background: var(--pine-2); }
.tag.warn { color: var(--warning); background: var(--copper-2); }
.lead-card { display: grid; grid-template-columns: 36px 1fr; gap: 4px 10px; align-items: center; padding: 14px; margin-top: 10px; border: 1px solid #e6d9c6; border-radius: 8px; }
.lead-card strong, .lead-card span, .lead-card em { grid-column: 2; }
.lead-card.selected { background: #f0f6f3; border-color: #cfe1d8; }
.lead-card em { font-style: normal; font-size: 12px; }
.lead-detail dl { display: grid; gap: 12px; margin: 18px 0; }
.lead-detail dl div { display: grid; grid-template-columns: 82px 1fr; gap: 12px; }
.lead-detail dt { color: var(--muted); }
.lead-detail dd { margin: 0; }
.assign-box { display: flex; gap: 10px; }
.assign-box .primary-action { color: #fff; background: var(--pine); }
.ritual-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.knowledge-row { display: grid; grid-template-columns: 82px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #e6d9c6; }
.knowledge-row:last-child { border-bottom: 0; }
.knowledge-row strong, .review-row strong { color: var(--ink); font-weight: 650; }
.knowledge-row span, .review-row p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.knowledge-row em { color: var(--pine); font-size: 12px; font-style: normal; }
.knowledge-row.warning em { color: var(--warning); }
.review-row { display: grid; gap: 6px; padding: 11px 0; border-bottom: 1px solid #e6d9c6; }
.review-row:last-child { border-bottom: 0; }
.review-row p { margin: 0; }
.strategy-flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.strategy-flow span { padding: 8px 10px; color: var(--text); background: #fbf7ef; border: 1px solid #e6d9c6; border-radius: 8px; font-size: 13px; }
.strategy-flow i { width: 20px; height: 1px; background: #d7c7af; }
.store-admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.store-admin-card { padding: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.store-admin-card > div:not(.card-head) { display: grid; gap: 4px; margin-top: 18px; }
.store-admin-card strong { font-size: 26px; }
.store-admin-card small { color: var(--muted); }
.store-admin-card.warning { background: #fffaf2; border-color: #dfc79b; }
.rule-panel { padding: 16px; margin-top: 14px; }
.rule-flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rule-flow span { padding: 10px 12px; background: #f2eadf; border-radius: 8px; }
.rule-flow i { width: 24px; height: 1px; background: #e6d9c6; }
.store-leads { display: grid; gap: 12px; }
.customer-card { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; padding: 16px; }
.customer-card.urgent { background: #fffaf2; border-color: #dfc79b; }
.customer-card h3 { margin: 10px 0 5px; }
.note-panel { margin-top: 14px; }
.hidden { display: none !important; }

@media (max-width: 980px) {
  .workspace { width: min(100vw - 22px, 680px); padding-top: 14px; }
  .product-shell { grid-template-columns: 1fr auto; }
  .top-nav { display: none; }
  .prototype-grid, .board-grid, .stat-grid, .lead-layout, .store-admin-grid, .ritual-admin-grid { grid-template-columns: 1fr; }
  .phone-frame { position: relative; top: auto; width: min(100%, 420px); margin: 0 auto; }
}

@media (max-width: 520px) {
  .workspace { width: 100%; padding: 0; }
  .product-shell { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-lockup { gap: 8px; }
  .brand-lockup strong { margin-bottom: 0; font-size: 15px; }
  .brand-lockup small { font-size: 11px; }
  .top-action { height: 30px; padding: 0 9px; font-size: 11px; }
  .prototype-grid { gap: 14px; width: 100%; }
  .phone-frame { width: 100%; padding: 0; border-right: 0; border-left: 0; border-radius: 0; }
  .phone-status, .tabbar { right: 0; left: 0; border-radius: 0; }
  .miniapp-page { padding: 14px 16px 86px; border-right: 0; border-left: 0; }
  .mini-header { margin-bottom: 10px; }
  .mini-header h2 { max-width: 300px; font-size: 16px; line-height: 1.38; font-weight: 620; }
  .icon-button { width: 32px; height: 32px; }
  .search-pill { height: 38px; margin-bottom: 10px; font-size: 14px; }
  .primary-card { grid-template-columns: 32px 1fr auto; gap: 10px; padding: 12px; background: var(--mini-paper); box-shadow: 0 8px 18px rgba(31, 35, 29, 0.06); }
  .primary-card .ui-icon { width: 32px; height: 32px; }
  .primary-card::after { display: none; }
  .primary-card p { margin-bottom: 4px; font-size: 11px; }
  .primary-card h3 { max-width: 210px; font-size: 14px; line-height: 1.42; }
  .primary-card .primary-action { width: auto; min-width: 82px; min-height: 34px; padding: 0 11px; font-size: 12px; }
  .miniapp-page > .primary-action.full { min-height: 38px; font-size: 13px; }
  .miniapp-page[data-screen="ritual-result"] > .primary-action.full { width: auto; min-height: 34px; padding: 0 14px; }
  .ritual-card { grid-template-columns: 32px 1fr auto; gap: 10px; padding: 12px; margin-bottom: 10px; box-shadow: 0 8px 18px rgba(31, 35, 29, 0.045); }
  .ritual-card .ui-icon { width: 32px; height: 32px; }
  .ritual-card h3 { font-size: 14px; line-height: 1.42; }
  .ritual-card .primary-action { min-width: 58px; min-height: 34px; padding: 0 12px; font-size: 12px; }
  .ritual-form { gap: 9px; }
  .ritual-form input, .ritual-form select { height: 40px; }
  .ritual-summary, .recommend-card { padding: 12px; }
  .trust-row { margin: 8px 0 12px; }
  .trust-row span { padding: 7px 4px; font-size: 11px; }
  .quick-actions { gap: 8px; margin-bottom: 14px; }
  .quick-actions button { min-height: 66px; padding: 10px; }
  .quick-actions i { width: 28px; height: 28px; }
  .quick-actions span { font-size: 14px; }
  .quick-actions small { font-size: 12px; }
  .desktop-panel { margin: 0 10px 10px; padding: 14px; }
  .admin-chrome { display: grid; gap: 12px; }
  .admin-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-tools button { padding: 0 6px; font-size: 12px; }
  .panel-switch button { padding: 9px 6px; font-size: 13px; }
  .ai-advice-head { grid-template-columns: 32px 1fr; }
  .confidence-tag { grid-column: 2; justify-self: start; }
  .dashboard-head { align-items: flex-start; }
  .dashboard-head h2 { font-size: 26px; }
  .stat-grid div, .board-card, .table-card, .note-panel, .store-admin-card, .rule-panel { padding: 13px; }
  .stat-grid strong, .store-admin-card strong { font-size: 23px; }
  th, td { padding: 11px 6px; font-size: 13px; }
  .customer-card { grid-template-columns: 34px 1fr; }
  .customer-card .customer-actions { grid-column: 2; }
}
