:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #f8fbf9;
  --ink: #16211d;
  --muted: #60726b;
  --line: #dce6e1;
  --green: #13795b;
  --teal: #0f8b8d;
  --red: #c2413b;
  --amber: #b7791f;
  --blue: #2f5f98;
  --nav: #17231f;
  --shadow: 0 18px 45px rgba(20, 40, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
}

.hidden {
  display: none !important;
}

.marketing-site {
  min-height: 100vh;
  background: #f4f6f5;
}

.marketing-nav {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.public-brand {
  color: var(--ink);
}

.marketing-nav nav,
.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.marketing-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: 56px 32px 32px;
  max-width: 1180px;
  margin: 0 auto;
}

.hero-section h1 {
  max-width: 760px;
  font-size: 46px;
  line-height: 1.08;
  margin-bottom: 16px;
}

.hero-section p {
  max-width: 680px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.hero-dashboard,
.price-card,
.feature-grid article,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hero-dashboard {
  padding: 22px;
}

.hero-dashboard span,
.price-card span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.hero-dashboard strong {
  display: block;
  margin: 12px 0;
  font-size: 28px;
}

.hero-dashboard ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.trust-row span,
.security-list span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.hero-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.hero-kpi-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.hero-kpi-grid b,
.hero-kpi-grid small {
  display: block;
}

.hero-kpi-grid b {
  font-size: 22px;
  color: var(--green);
}

.hero-kpi-grid small {
  margin-top: 4px;
  color: var(--muted);
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.proof-strip article,
.pain-grid article,
.service-grid article,
.scenario-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.proof-strip strong,
.proof-strip span {
  display: block;
}

.proof-strip strong {
  font-size: 20px;
  color: var(--green);
  margin-bottom: 8px;
}

.proof-strip span,
.pain-grid p,
.service-grid p,
.scenario-grid p,
.security-section p {
  color: var(--muted);
  line-height: 1.7;
}

.pain-grid,
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.service-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.scenario-grid article {
  position: relative;
  overflow: hidden;
}

.scenario-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green);
}

.scenario-grid span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.scenario-grid strong {
  display: block;
  margin: 8px 0;
  font-size: 18px;
}

.billing-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-options b {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--blue);
  padding: 6px 8px;
  font-size: 13px;
}

.pain-grid article span {
  color: var(--amber);
  font-weight: 900;
}

.security-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: center;
}

.security-list {
  display: grid;
  gap: 10px;
}

.public-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px;
}

.section-headline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.section-headline p {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.7;
}

.feature-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-grid article,
.price-card {
  padding: 20px;
}

.feature-grid p,
.price-card p {
  color: var(--muted);
  line-height: 1.7;
}

.price-card {
  display: grid;
  gap: 12px;
}

.price-card strong {
  font-size: 32px;
}

.price-card.highlighted {
  border-color: rgba(19, 121, 91, 0.34);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 27, 23, 0.42);
}

.auth-modal.show {
  display: grid;
}

.auth-card {
  width: min(440px, 100%);
  position: relative;
  padding: 24px;
}

.auth-card .icon-btn {
  position: absolute;
  right: 16px;
  top: 16px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

button,
input,
select {
  font: inherit;
}

button {
  transition: 0.16s ease;
}

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--nav);
  color: #f4fbf8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e2b84a;
  color: #16211d;
  font-size: 12px;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 4px;
  color: #a9bbb4;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c8d8d2;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: #263b35;
  color: #ffffff;
}

.tenant-card {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.tenant-card span,
.tenant-card small,
.tenant-card strong {
  display: block;
}

.tenant-card span,
.tenant-card small {
  color: #a9bbb4;
  font-size: 12px;
}

.tenant-card strong {
  margin: 7px 0;
  font-size: 15px;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 16px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

select,
input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
}

.primary-btn,
.secondary-btn {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}

.primary-btn {
  border: 0;
  background: var(--green);
  color: #ffffff;
}

.primary-btn:hover {
  background: #0f644b;
}

.secondary-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.secondary-btn:hover {
  border-color: rgba(19, 121, 91, 0.35);
  color: var(--green);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.status-strip div {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.dot.ok { background: var(--green); }
.dot.warn { background: var(--amber); }
.dot.danger { background: var(--red); }

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ai-live-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.25fr);
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(19, 121, 91, 0.28);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.ai-live-panel h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.ai-live-panel p {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0;
}

.live-alert-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.live-alert {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.live-alert strong,
.live-alert span {
  display: block;
}

.live-alert strong {
  margin-bottom: 5px;
}

.live-alert span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.live-alert.danger { border-color: rgba(194, 65, 59, 0.35); }
.live-alert.warn { border-color: rgba(183, 121, 31, 0.35); }
.live-alert.ok { border-color: rgba(19, 121, 91, 0.28); }

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 30px;
  line-height: 1.1;
}

.hero-metric {
  border-color: rgba(19, 121, 91, 0.25);
}

.good { color: var(--green) !important; }
.bad { color: var(--red) !important; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.wide {
  min-width: 0;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.table-input {
  width: 96px;
  min-height: 34px;
  padding: 0 8px;
}

.legend {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.legend.sales { background: var(--teal); }
.legend.spend { background: var(--amber); }
.legend.profit { background: var(--green); }
.legend.roi { background: var(--blue); }

.chart {
  min-height: 386px;
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 249, 246, 0.92)),
    radial-gradient(circle at 20% 12%, rgba(47, 95, 152, 0.12), transparent 32%),
    linear-gradient(135deg, #eef7f2 0%, #f7faf9 100%);
  border: 1px solid rgba(19, 121, 91, 0.12);
  overflow: hidden;
}

.trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trend-summary article {
  padding: 12px;
  border: 1px solid rgba(19, 121, 91, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 26px rgba(20, 40, 34, 0.05);
}

.trend-summary span,
.trend-summary strong,
.trend-summary small {
  display: block;
}

.trend-summary span,
.trend-summary small {
  color: var(--muted);
  font-size: 12px;
}

.trend-summary strong {
  margin: 5px 0;
  font-size: 24px;
}

.chart-stage {
  display: grid;
  grid-template-columns: 48px minmax(560px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chart-axis {
  height: 300px;
  display: grid;
  align-content: space-between;
  padding: 2px 0 31px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.chart-plot {
  min-width: 560px;
  min-height: 300px;
  display: grid;
  grid-template-columns: repeat(7, minmax(62px, 1fr));
  gap: 13px;
  align-items: end;
  position: relative;
  padding: 34px 8px 30px;
}

.grid-lines {
  position: absolute;
  inset: 34px 8px 30px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  pointer-events: none;
}

.grid-lines span {
  border-top: 1px dashed rgba(96, 114, 107, 0.22);
}

.roi-layer {
  position: absolute;
  inset: 34px 8px 58px;
  color: var(--blue);
  filter: drop-shadow(0 4px 10px rgba(47, 95, 152, 0.2));
  pointer-events: none;
}

.bar-group {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 236px;
  position: relative;
  padding-bottom: 24px;
  z-index: 2;
}

.bar-stack {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  align-items: end;
}

.bar-col {
  display: grid;
  gap: 5px;
  align-items: end;
  justify-items: center;
}

.bar {
  border-radius: 5px 5px 0 0;
  min-height: 8px;
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.bar.sales { background: var(--teal); }
.bar.spend { background: var(--amber); }
.bar.profit { background: var(--green); }

.bar-value {
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: 0.82;
}

.bar-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.roi-point {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(47, 95, 152, 0.26);
  z-index: 4;
}

.roi-point b {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  min-width: 38px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue);
  border: 1px solid rgba(47, 95, 152, 0.2);
  font-size: 10px;
  line-height: 1;
  text-align: center;
  box-shadow: 0 8px 20px rgba(20, 40, 34, 0.08);
}

.profit-lift {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.profit-lift.up { color: var(--green); }
.profit-lift.down { color: var(--red); }

.insight-list,
.notice-feed,
.connect-list,
.alert-rules,
.toggles,
.action-grid,
.report-list,
.optimization-grid,
.api-platform-grid,
.api-bind-form {
  display: grid;
  gap: 10px;
}

.insight,
.notice-feed div,
.alert-rules label,
.toggles label,
.automation-state,
.connect,
.module-grid span,
.action-card,
.optimizer-card,
.report-item,
.optimization-card,
.role-card,
.api-platform-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.insight strong,
.action-card strong {
  display: block;
  margin-bottom: 5px;
}

.insight p,
.action-card p,
.optimizer-card p,
.optimization-card p,
.role-card p,
.api-platform-card p,
.automation-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.api-platform-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.api-platform-card {
  display: grid;
  gap: 10px;
}

.api-platform-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.api-platform-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.api-platform-card dl div {
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.api-platform-card dt {
  color: var(--muted);
  font-size: 12px;
}

.api-platform-card dd {
  margin: 4px 0 0;
  font-weight: 700;
  line-height: 1.45;
}

.api-bind-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.report-query-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.report-query-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.report-summary-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.report-summary-grid span,
.report-summary-grid strong {
  display: block;
}

.report-summary-grid span {
  color: var(--muted);
  font-size: 13px;
}

.report-summary-grid strong {
  margin-top: 7px;
  font-size: 22px;
}

.role-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.7fr);
  gap: 18px;
  margin-bottom: 18px;
}

.role-card {
  background: #ffffff;
  box-shadow: var(--shadow);
}

.role-card span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.role-card strong {
  display: block;
  margin: 8px 0;
  font-size: 22px;
}

.role-card.compact strong {
  font-size: 17px;
}

.report-item {
  color: var(--muted);
  line-height: 1.6;
}

.optimization-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.optimization-card {
  display: grid;
  gap: 9px;
}

.optimization-card strong {
  display: block;
}

.optimizer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.optimizer-card {
  display: grid;
  gap: 12px;
}

.optimizer-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.optimizer-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.optimizer-card dl div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
}

.optimizer-card dt {
  color: var(--muted);
  font-size: 12px;
}

.optimizer-card dd {
  margin: 5px 0 0;
  font-weight: 800;
}

.action-board {
  margin-bottom: 18px;
}

.ai-assistant-panel {
  margin-bottom: 18px;
}

.ai-assistant-panel .panel-head > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.assistant-model-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid rgba(19, 121, 91, 0.28);
  border-radius: 6px;
  background: #eaf7f1;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
}

.assistant-feed {
  min-height: 260px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.assistant-message {
  max-width: 82%;
  overflow-wrap: anywhere;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.6;
  font-size: 14px;
}

.assistant-message.ai {
  background: #ffffff;
  border: 1px solid var(--line);
}

.assistant-message.user {
  justify-self: end;
  background: #eaf7f1;
  color: var(--green);
  border: 1px solid rgba(19, 121, 91, 0.2);
}

.assistant-side {
  display: grid;
  gap: 10px;
  align-content: start;
}

.assistant-side label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.assistant-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.wecom-admin-panel {
  margin-bottom: 18px;
}

.wecom-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 16px;
}

.wecom-status-bar > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.wecom-status-bar span {
  color: var(--muted);
  font-size: 13px;
}

.wecom-status-bar code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.table-select {
  width: min(260px, 100%);
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 5px 8px;
  color: var(--ink);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.empty-table-state {
  display: block;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-card {
  display: grid;
  gap: 10px;
}

.action-card footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.alert-history-panel {
  margin-bottom: 18px;
}

.alert-history-feed {
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 70px 46px 88px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbf9);
}

.history-time {
  font-weight: 900;
  color: var(--ink);
}

.history-item strong,
.history-item p {
  display: block;
}

.history-item strong {
  font-size: 14px;
}

.history-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.history-type,
.history-level,
.history-status {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.history-type {
  background: #eef5f1;
  color: var(--green);
}

.history-level.danger {
  background: #fae8e6;
  color: var(--red);
}

.history-level.warn {
  background: #fbf0df;
  color: var(--amber);
}

.history-level.ok {
  background: #eaf7f1;
  color: var(--green);
}

.history-status {
  background: #f1f5f4;
  color: var(--muted);
}

.tiny-btn {
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 0 10px;
  cursor: pointer;
  color: var(--ink);
}

.tiny-btn.primary {
  border-color: rgba(19, 121, 91, 0.2);
  background: #eaf7f1;
  color: var(--green);
  font-weight: 700;
}

.tiny-btn:disabled {
  cursor: default;
  opacity: 0.72;
}

.product-cell {
  display: grid;
  grid-template-columns: 54px minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
}

.product-cell img {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  object-fit: cover;
}

.product-cell strong,
.product-cell small,
.ai-suggestion small {
  display: block;
}

.product-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ai-suggestion {
  display: grid;
  gap: 5px;
  min-width: 340px;
}

.ai-suggestion p {
  margin: 0 0 3px;
  line-height: 1.5;
}

.ai-suggestion small {
  color: var(--muted);
  line-height: 1.45;
}

.cost-form,
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
}

.cost-form-detailed {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.cost-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.cost-form label,
.strategy-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.breakdown {
  display: grid;
  gap: 10px;
  margin: 0;
}

.breakdown div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.breakdown dt {
  color: var(--muted);
}

.breakdown dd {
  margin: 0;
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.tag.green { background: #e3f4ec; color: var(--green); }
.tag.red { background: #f8e6e4; color: var(--red); }
.tag.amber { background: #fbefd7; color: var(--amber); }
.tag.blue { background: #e5eef8; color: var(--blue); }

.connect {
  text-align: left;
  border: 1px solid var(--line);
  cursor: pointer;
}

.connect.connected {
  border-color: rgba(19, 121, 91, 0.25);
  background: #eaf7f1;
  color: var(--green);
  font-weight: 700;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.module-grid span {
  text-align: center;
  color: var(--blue);
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  border-radius: 8px;
  background: #17231f;
  color: #ffffff;
  padding: 13px 16px;
  box-shadow: var(--shadow);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 27, 23, 0.42);
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(10, 24, 19, 0.24);
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.modal-product {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.modal-product img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal-product p,
.modal-warning {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.change-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.change-preview-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.change-preview-grid span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.change-preview-grid strong {
  display: block;
  margin-top: 8px;
  line-height: 1.55;
}

.payment-modal,
.contact-modal {
  width: min(820px, 100%);
}

.payment-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.payment-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.payment-summary span,
.payment-summary strong {
  display: block;
}

.payment-summary span {
  color: var(--muted);
  font-size: 12px;
}

.payment-summary strong {
  margin-top: 6px;
  font-size: 18px;
}

.pay-box,
.contact-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.fake-pay-qr,
.wecom-qr-img,
.pay-qr-img {
  width: 168px;
  height: 168px;
  border: 8px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(20, 40, 34, 0.12);
}

.fake-pay-qr {
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, #17231f 12px, transparent 12px) 0 0 / 24px 24px,
    linear-gradient(#17231f 12px, transparent 12px) 0 0 / 24px 24px,
    #ecf6f1;
  position: relative;
  overflow: hidden;
}

.fake-pay-qr span {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--green);
  font-weight: 900;
  text-align: center;
}

.wecom-qr-img,
.pay-qr-img {
  object-fit: cover;
  background: #ffffff;
}

.contact-body h3,
.pay-box h3 {
  margin: 0 0 8px;
}

.contact-body p,
.pay-box p {
  color: var(--muted);
  line-height: 1.7;
}

.tenant-url {
  display: inline-block;
  max-width: 260px;
  color: var(--green);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.admin-page {
  min-height: 100vh;
  background: var(--bg);
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login .auth-card {
  box-shadow: var(--shadow);
}

.admin-login h1 {
  margin: 0 0 8px;
}

.admin-login p {
  color: var(--muted);
  line-height: 1.7;
}

.admin-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.admin-topbar {
  margin-bottom: 18px;
}

.link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-filter {
  margin-bottom: 14px;
}

.admin-filter input {
  width: min(420px, 100%);
}

@media (max-width: 1120px) {
  .hero-section,
  .feature-grid,
  .pricing-grid,
  .proof-strip,
  .pain-grid,
  .service-grid,
  .scenario-grid,
  .security-section {
    grid-template-columns: 1fr;
  }

  .hero-section h1 {
    font-size: 36px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tenant-card {
    margin-top: 0;
  }

  .metric-grid,
  .status-strip,
  .dashboard-grid,
  .ai-live-panel,
  .action-grid,
  .optimizer-grid,
  .role-hero,
  .optimization-grid,
  .report-query-bar,
  .report-summary-grid,
  .api-platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cost-form,
  .strategy-grid,
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .marketing-nav,
  .section-headline {
    display: grid;
  }

  .marketing-nav nav,
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .hero-section,
  .public-section {
    padding: 24px 16px;
  }

  .hero-section h1 {
    font-size: 30px;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .panel-head {
    display: grid;
  }

  .top-actions,
  .nav {
    grid-template-columns: 1fr;
    display: grid;
  }

  .metric-grid,
  .status-strip,
  .dashboard-grid,
  .ai-live-panel,
  .live-alert-list,
  .assistant-layout,
  .assistant-input,
  .action-grid,
  .optimizer-grid,
  .role-hero,
  .optimization-grid,
  .report-query-bar,
  .report-summary-grid,
  .api-platform-grid,
  .cost-form,
  .strategy-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .metric strong {
    font-size: 26px;
  }

  .chart {
    padding: 12px;
  }

  .trend-summary,
  .history-item {
    grid-template-columns: 1fr;
  }

  .chart-stage {
    grid-template-columns: 42px minmax(520px, 1fr);
  }

  .change-preview-grid,
  .modal-product,
  .payment-summary,
  .pay-box,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}
