:root {
  --bg: #f3f5fb;
  --panel: #ffffff;
  --panel-soft: #f6f8ff;
  --line: #e3e8f4;
  --text: #162033;
  --muted: #6d7890;
  --brand: #2a8cff;
  --brand-soft: rgba(42, 140, 255, 0.12);
  --success: #13b26b;
  --warning: #ff9f1c;
  --danger: #f05454;
  --shadow: 0 20px 60px rgba(23, 35, 79, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(42, 140, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #edf2ff 0%, #f8f9fd 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 340px 1fr;
}

.workspace-panel {
  padding: 32px 24px;
  border-right: 1px solid rgba(227, 232, 244, 0.9);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px);
}

.brand-card,
.panel-section {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(227, 232, 244, 0.9);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(23, 35, 79, 0.06);
}

.panel-section {
  margin-top: 16px;
}

.eyebrow,
.header-label,
.section-title,
.meta-label,
.card-label {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 12px;
  text-transform: uppercase;
}

.brand-card h1 {
  margin: 8px 0 6px;
  font-size: 32px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.role-switch,
.route-list,
.bottom-nav,
.action-row,
.filter-row,
.stats-row,
.tag-row,
.quick-grid,
.quote-actions,
.timeline,
.detail-grid,
.order-actions,
.review-grid,
.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-button,
.route-button,
.nav-item,
.quick-card,
.status-pill,
.outline-button,
.primary-button,
.ghost-button,
.icon-button,
.mini-chip {
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.chip-button,
.route-button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.chip-button.active,
.route-button.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(42, 140, 255, 0.25);
}

.feature-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.preview-panel {
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-frame {
  width: min(430px, 100%);
  background: #101322;
  border-radius: 42px;
  padding: 14px;
  box-shadow: 0 30px 80px rgba(10, 20, 50, 0.25);
}

.phone-notch {
  width: 140px;
  height: 26px;
  background: #060911;
  border-radius: 0 0 18px 18px;
  margin: 0 auto 10px;
}

.miniapp {
  background: var(--bg);
  border-radius: 30px;
  min-height: 820px;
  max-height: 820px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.miniapp-header {
  padding: 18px 18px 16px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(227, 232, 244, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.miniapp-header h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.ghost-button,
.outline-button,
.primary-button,
.icon-button {
  padding: 10px 14px;
}

.ghost-button,
.outline-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}

.primary-button {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 20px rgba(42, 140, 255, 0.2);
}

.icon-button {
  background: var(--panel-soft);
  color: var(--brand);
}

.miniapp-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 24px;
}

.page-stack {
  display: grid;
  gap: 14px;
}

.hero-card,
.module-card,
.merchant-card,
.order-card,
.quote-card,
.chat-card,
.review-card,
.notice-card,
.empty-card,
.admin-card,
.timeline-card {
  background: var(--panel);
  border: 1px solid rgba(227, 232, 244, 0.95);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.hero-card {
  background: linear-gradient(135deg, #2a8cff 0%, #5fb4ff 100%);
  color: #fff;
}

.hero-card p,
.hero-card .meta {
  color: rgba(255, 255, 255, 0.88);
}

.hero-card h3,
.module-card h3,
.merchant-card h3,
.order-card h3,
.quote-card h3,
.chat-card h3,
.admin-card h3,
.timeline-card h3 {
  margin: 0 0 10px;
}

.search-box,
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
}

.search-box {
  margin-top: 14px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.quick-card {
  background: var(--panel);
  padding: 16px;
  border-radius: 20px;
  text-align: left;
  color: var(--text);
  min-height: 92px;
}

.quick-card strong,
.metric-value,
.merchant-score,
.order-title,
.quote-price,
.list-number {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.quick-card span,
.meta,
.desc,
.card-subtitle,
.info-list,
.merchant-meta,
.order-meta,
.quote-meta,
.review-meta,
.chat-meta,
.disclaimer {
  color: var(--muted);
  line-height: 1.6;
}

.filter-row {
  overflow-x: auto;
  padding-bottom: 2px;
  flex-wrap: nowrap;
}

.mini-chip,
.status-pill {
  padding: 8px 12px;
  background: var(--panel-soft);
  color: var(--muted);
  white-space: nowrap;
}

.mini-chip.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.status-pill.brand {
  background: rgba(42, 140, 255, 0.12);
  color: var(--brand);
}

.status-pill.success {
  background: rgba(19, 178, 107, 0.12);
  color: var(--success);
}

.status-pill.warning {
  background: rgba(255, 159, 28, 0.14);
  color: #c87a00;
}

.status-pill.danger {
  background: rgba(240, 84, 84, 0.12);
  color: var(--danger);
}

.card-top,
.merchant-top,
.order-top,
.quote-top,
.review-top,
.admin-top,
.chat-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.tag-row {
  margin-top: 10px;
}

.metric-grid,
.form-grid,
.detail-grid,
.review-grid {
  display: grid;
  gap: 12px;
}

.metric-grid {
  grid-template-columns: repeat(3, 1fr);
}

.metric-box,
.detail-item {
  background: var(--panel-soft);
  border-radius: 16px;
  padding: 14px;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
}

.form-grid {
  grid-template-columns: repeat(2, 1fr);
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  color: var(--muted);
  font-size: 14px;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

.info-list {
  margin: 0;
  padding-left: 18px;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #2a8cff, #7a5cff);
}

.merchant-score {
  color: var(--brand);
}

.chat-status-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chat-stream {
  display: grid;
  gap: 10px;
}

.message {
  max-width: 82%;
  border-radius: 18px;
  padding: 12px 14px;
  line-height: 1.6;
}

.message.other {
  background: #fff;
  border: 1px solid var(--line);
}

.message.self {
  background: rgba(42, 140, 255, 0.14);
  margin-left: auto;
}

.message.system-card {
  max-width: 100%;
  background: linear-gradient(135deg, rgba(42, 140, 255, 0.12), rgba(122, 92, 255, 0.08));
  border: 1px solid rgba(42, 140, 255, 0.18);
  display: grid;
  gap: 6px;
}

.message.system-card strong {
  color: var(--brand);
}

.detail-item strong,
.metric-box strong {
  line-height: 1.5;
}

.timeline {
  gap: 12px;
  display: grid;
}

.timeline-step {
  position: relative;
  padding-left: 18px;
}

.timeline-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.bottom-nav {
  padding: 10px 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(227, 232, 244, 0.95);
  justify-content: space-between;
}

.nav-item {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  color: var(--muted);
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-item span {
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.notice-card {
  background: linear-gradient(135deg, rgba(42, 140, 255, 0.12), rgba(95, 180, 255, 0.08));
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  background: rgba(16, 19, 34, 0.92);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .workspace-panel {
    border-right: none;
    border-bottom: 1px solid rgba(227, 232, 244, 0.9);
  }
}

@media (max-width: 640px) {
  .workspace-panel {
    padding: 20px 16px;
  }

  .preview-panel {
    padding: 16px;
  }

  .phone-frame {
    width: 100%;
    padding: 10px;
  }

  .miniapp {
    min-height: 760px;
    max-height: none;
  }

  .form-grid,
  .metric-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }
}
