:root {
  --bg: #f5f1e8;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffdfa;
  --line: rgba(115, 94, 60, 0.14);
  --line-strong: rgba(115, 94, 60, 0.22);
  --text: #1f1a14;
  --muted: #73685a;
  --muted-soft: #9a8d7d;
  --accent: #0f766e;
  --accent-deep: #115e59;
  --danger: #9f3c2b;
  --shadow: 0 22px 60px rgba(46, 36, 25, 0.08);
  --radius-xl: 28px;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 26%),
    radial-gradient(circle at top right, rgba(194, 177, 148, 0.18), transparent 32%),
    linear-gradient(180deg, #faf7f0 0%, var(--bg) 100%);
  color: var(--text);
  font: 14px/1.6 "Segoe UI", "Microsoft YaHei UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 26px 18px;
  background: linear-gradient(180deg, rgba(28, 24, 19, 0.97), rgba(36, 30, 24, 0.96));
  color: #f5eee1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  z-index: 20;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand strong, .brand small { display: block; }
.brand small { color: rgba(245, 238, 225, 0.66); line-height: 1.45; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #15b7a1, #0f766e);
  font-weight: 800;
  color: #fff;
  box-shadow: 0 16px 30px rgba(15, 118, 110, 0.28);
}

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

.sidebar-nav a {
  padding: 11px 14px;
  border-radius: 12px;
  color: rgba(245, 238, 225, 0.82);
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a[aria-current="page"] {
  background: rgba(21, 183, 161, 0.12);
  color: #fff;
  transform: translateX(2px);
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-foot span,
.sidebar-foot strong { display: block; }
.sidebar-foot span { margin-bottom: 4px; color: rgba(245, 238, 225, 0.62); }

.main-shell {
  margin-left: 250px;
  min-height: 100vh;
  padding: 28px 30px 36px;
}

.topbar { margin-bottom: 22px; }

.topbar h1,
.page-head h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.topbar p,
.page-head p {
  margin: 7px 0 0;
  color: var(--muted);
  max-width: 780px;
}

.topbar-user { display: flex; align-items: center; gap: 12px; }
.main-content { display: grid; gap: 20px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.page-actions { display: flex; gap: 10px; }

.overview-hero,
.workspace-panel,
.panel-card,
.stat-block,
.hero-note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.overview-hero {
  padding: 26px 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.overview-copy h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
}

.overview-copy p {
  margin: 14px 0 0;
  max-width: 760px;
  color: var(--muted);
}

.overview-meta {
  min-width: 210px;
  padding: 16px 18px;
  align-self: flex-start;
}

.overview-meta span,
.overview-meta strong { display: block; }
.overview-meta span { color: var(--muted); margin-bottom: 4px; }

.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-block { padding: 20px 22px; }
.stat-block span { display: block; margin-bottom: 10px; color: var(--muted); }
.stat-block strong { display: block; font-size: 32px; line-height: 1; }

.stat-block.emphasis {
  background: linear-gradient(135deg, #125f59, #0e766c);
  color: #f6fffc;
}

.stat-block.emphasis span { color: rgba(246, 255, 252, 0.72); }

.overview-grid,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
  gap: 20px;
}

.workspace-panel,
.panel-card { padding: 22px; }

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

.panel-head h2,
.panel-head h3 { margin: 0; font-size: 20px; }
.panel-head p { margin: 6px 0 0; }
.subtle { color: var(--muted); }
.table-wrap { overflow: auto; }

.admin-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.admin-table.compact { min-width: 0; }

.admin-table th,
.admin-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(115, 94, 60, 0.12);
  text-align: left;
  vertical-align: top;
}

.admin-table thead th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
  font-weight: 700;
}

.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.5); }
.admin-table tr:last-child td { border-bottom: 0; }

.mono {
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.11);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.status-chip.muted {
  background: rgba(192, 145, 49, 0.12);
  color: #8a6123;
}

.chart-shell {
  overflow: auto;
  padding: 10px 0 6px;
}

.line-chart {
  width: 100%;
  min-width: 700px;
  height: auto;
}

.chart-axis,
.chart-grid {
  stroke: rgba(115, 94, 60, 0.16);
  stroke-width: 1;
}

.chart-grid { stroke-dasharray: 4 8; }

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--panel-strong);
  stroke: var(--accent);
  stroke-width: 3;
}

.chart-label {
  fill: var(--muted-soft);
  font-size: 11px;
}

.detail-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(115, 94, 60, 0.12);
}

.detail-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }

.channel-stack,
.mini-list,
.software-edit-list {
  display: grid;
  gap: 12px;
}

.channel-row,
.mini-list-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(15, 118, 110, 0.05);
  border-radius: 16px;
}

.channel-row span,
.mini-list-row span {
  display: block;
  color: var(--muted);
}

.spaced-top { margin-top: 22px; }

.price-stack {
  display: grid;
  gap: 8px;
}

.price-stack div {
  display: grid;
  gap: 2px;
}

.price-stack span { color: var(--muted); }

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

.primary-button,
.danger-button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-button,
.button-link {
  color: #fff;
  background: linear-gradient(135deg, #1f7a67, #155248);
  box-shadow: 0 14px 30px rgba(21, 82, 72, 0.2);
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, #b84c36, #973726);
}

.ghost-link,
.primary-link,
.table-link {
  color: var(--accent-deep);
  font-weight: 700;
}

.danger-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.inline-form { display: inline; }
.payment-form-card { max-width: 1180px; }
.config-form { display: grid; gap: 22px; }

.channel-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.56);
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.form-grid input[readonly] { background: #f4efe7; }

.form-grid textarea {
  resize: vertical;
  min-height: 110px;
}

.software-edit-card {
  border: 1px solid rgba(115, 94, 60, 0.12);
  border-radius: 20px;
  padding: 18px;
  background: rgba(15, 118, 110, 0.04);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.full-span { grid-column: 1 / -1; }

.field-error,
.form-error {
  color: #a03f30;
  font-size: 13px;
}

.notice-card {
  padding: 14px 18px;
  color: var(--accent-deep);
  font-weight: 700;
}

.login-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(160, 219, 207, 0.45), transparent 32%),
    radial-gradient(circle at bottom right, rgba(190, 230, 217, 0.35), transparent 28%),
    #f4f6f1;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(100%, 440px);
  padding: 24px;
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 36, 35, 0.08);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(18, 32, 28, 0.12);
  padding: 28px;
}

.login-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.login-head h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.login-head p {
  margin: 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

@media (max-width: 1280px) {
  .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .sidebar {
    position: static;
    width: auto;
    overflow: visible;
  }

  .main-shell {
    margin-left: 0;
    padding: 20px;
  }

  .overview-hero,
  .page-head,
  .channel-row,
  .mini-list-row,
  .table-actions,
  .form-actions {
    flex-direction: column;
  }

  .overview-grid,
  .content-grid,
  .overview-stats,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
