:root {
  --green: #08be72;
  --board: #075a43;
  --sprout: #c8ff2b;
  --orange: #ffa51f;
  --sun: #ffd75a;
  --cream: #fff9ea;
  --ink: #14282b;
  --muted: #61726d;
  --danger: #dc3030;
  --danger-soft: #fff0ed;
  --line: rgba(20, 40, 43, .14);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--cream); }
body { min-width: 320px; margin: 0; overflow-x: hidden; background: radial-gradient(circle at 90% 0, rgba(200,255,43,.25), transparent 28rem), var(--cream); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 520px); background: var(--board); }
.login-art { position: relative; display: grid; align-content: center; justify-items: center; min-height: 340px; padding: 50px; color: #fff; overflow: hidden; }
.login-art::before, .login-art::after { content: ""; position: absolute; border-radius: 50%; background: var(--sprout); opacity: .18; }
.login-art::before { width: 360px; height: 360px; left: -120px; bottom: -180px; }
.login-art::after { width: 260px; height: 260px; right: -100px; top: -100px; }
.login-art p { max-width: 480px; margin: 28px 0 0; text-align: center; font-size: clamp(20px, 3vw, 34px); font-weight: 900; line-height: 1.45; }
.sprout-logo { display: grid; width: 118px; height: 105px; place-items: center; border: 9px solid var(--sprout); border-radius: 34px 34px 38px 38px; color: var(--board); background: var(--green); box-shadow: 0 13px 0 #043c2d; transform: rotate(-2deg); }
.sprout-logo::before, .sprout-logo::after { content: ""; position: absolute; width: 38px; height: 24px; margin-top: -126px; border-radius: 100% 0 100% 0; background: var(--sprout); }
.sprout-logo::before { margin-left: -34px; transform: rotate(20deg); }
.sprout-logo::after { margin-left: 34px; transform: scaleX(-1) rotate(20deg); }
.sprout-logo span { font-size: 50px; font-weight: 1000; }
.chalk-line { width: min(360px, 80%); margin-top: 28px; border-top: 3px dashed rgba(255,255,255,.45); }
.paper-panel { border: 1px solid rgba(7,90,67,.16); border-radius: 18px; background: #fffdf5; box-shadow: 0 9px 0 rgba(7,90,67,.18), 0 26px 60px rgba(7,54,42,.12); }
.login-card { position: relative; align-self: center; width: min(420px, calc(100% - 36px)); margin: 24px auto; padding: 38px; }
.login-card h1 { margin: 18px 0 8px; font-size: 32px; }
.login-card label, .form-field { display: grid; gap: 7px; margin-top: 18px; color: #294d42; font-size: 14px; font-weight: 900; }
.tape-label { position: absolute; top: -15px; left: 28px; padding: 7px 18px; color: #553b00; background: var(--sun); box-shadow: 0 4px 0 rgba(166,111,0,.18); font-weight: 900; transform: rotate(-1deg); }
.muted { color: var(--muted); line-height: 1.65; }
input, select, textarea { width: 100%; border: 2px solid rgba(7,90,67,.18); border-radius: 10px; outline: 0; color: var(--ink); background: #fff; }
input, select { min-height: 45px; padding: 0 12px; }
textarea { min-height: 96px; padding: 11px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(8,190,114,.12); }
.primary-button, .secondary-button, .danger-button { min-height: 44px; padding: 0 17px; border-radius: 11px; font-weight: 1000; }
.primary-button { border: 2px solid var(--board); color: #fff; background: var(--green); box-shadow: 0 4px 0 var(--board); }
.primary-button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--board); }
.secondary-button { border: 2px solid rgba(7,90,67,.18); color: var(--board); background: #fff; }
.danger-button { border: 2px solid #961a1a; color: #fff; background: var(--danger); }
.login-card .primary-button { width: 100%; margin-top: 24px; }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 13px; }

.app-shell { min-height: 100vh; padding: 0 24px 60px; }
.topbar, .main-nav, main, .alert-strip { width: min(1240px, 100%); margin-inline: auto; }
.topbar { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { display: grid; width: 44px; height: 44px; place-items: center; border: 4px solid var(--sprout); border-radius: 14px; color: #fff; background: var(--board); box-shadow: 0 4px 0 var(--green); font-size: 21px; font-weight: 1000; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { margin-top: 2px; color: #688078; font-size: 10px; letter-spacing: .08em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.icon-button, .text-button { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--board); background: rgba(255,255,255,.78); }
.icon-button { position: relative; min-width: 42px; font-size: 18px; }
.text-button { padding: 0 12px; font-weight: 900; }
.user-chip { padding: 8px 12px; border-radius: 999px; color: var(--board); background: rgba(200,255,43,.55); font-size: 13px; font-weight: 1000; }
.badge { position: absolute; top: -7px; right: -6px; min-width: 19px; padding: 2px 5px; border: 2px solid var(--cream); border-radius: 999px; color: #fff; background: var(--danger); font-size: 10px; font-weight: 1000; }
.alert-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding: 12px 16px; border: 2px solid #a91d1d; border-radius: 13px; color: #7b1414; background: var(--danger-soft); box-shadow: 0 4px 0 rgba(169,29,29,.18); font-weight: 900; }
.alert-strip button { border: 0; color: inherit; background: transparent; font-weight: 1000; }
.main-nav { display: flex; gap: 5px; padding: 8px; border: 2px solid var(--board); border-radius: 16px; background: var(--board); box-shadow: 0 6px 0 rgba(7,90,67,.2); }
.main-nav a { min-height: 42px; display: grid; place-items: center; padding: 0 20px; border-radius: 10px; color: rgba(255,255,255,.8); font-weight: 900; }
.main-nav a.active { color: var(--board); background: var(--sprout); box-shadow: inset 0 -3px 0 rgba(7,90,67,.18); }
main { min-width: 0; padding-top: 28px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading h1 { margin: 4px 0 0; color: var(--board); font-size: clamp(28px, 4vw, 44px); line-height: 1.1; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 1000; letter-spacing: .14em; }

.dashboard-hero { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; min-height: 180px; margin-bottom: 20px; padding: 28px 32px; overflow: hidden; border: 8px solid var(--sprout); border-radius: 24px; color: #fff; background: var(--board); box-shadow: 0 8px 0 #053c2e; }
.dashboard-hero::after { content: "✓"; display: grid; width: 118px; height: 118px; place-items: center; border-radius: 36px; color: var(--board); background: var(--sun); box-shadow: 0 8px 0 var(--orange); font-size: 70px; font-weight: 1000; transform: rotate(5deg); }
.dashboard-hero h1 { margin: 6px 0 10px; font-size: clamp(30px, 5vw, 52px); }
.dashboard-hero p { max-width: 700px; margin: 0; color: rgba(255,255,255,.8); line-height: 1.65; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card { min-width: 0; padding: 19px; border: 2px solid rgba(7,90,67,.16); border-radius: 16px; background: #fffdf5; box-shadow: 0 5px 0 rgba(7,90,67,.14); }
.kpi-card.danger { border-color: rgba(220,48,48,.5); background: #fff5ef; box-shadow: 0 5px 0 rgba(220,48,48,.16); }
.kpi-card.money { background: #fff4d0; }
.kpi-card span, .kpi-card strong { display: block; }
.kpi-card span { color: var(--muted); font-size: 13px; font-weight: 800; }
.kpi-card strong { margin-top: 9px; color: var(--board); font-size: 29px; line-height: 1; }
.section-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; margin-top: 20px; }
.board-panel { min-width: 0; padding: 22px; border: 6px solid var(--sprout); border-radius: 20px; color: #fff; background: var(--board); box-shadow: 0 7px 0 #053c2e; }
.board-panel h2 { margin: 0 0 15px; }
.paper-card { min-width: 0; padding: 20px; border: 1px solid rgba(7,90,67,.16); border-radius: 16px; background: #fffdf5; box-shadow: 0 5px 0 rgba(7,90,67,.14); }
.paper-card h2, .paper-card h3 { margin: 0 0 14px; color: var(--board); }

.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.filters .form-field { margin: 0; }
.filter-actions { display: flex; align-items: end; gap: 8px; }
.filter-actions button { flex: 1; }
.table-wrap { overflow-x: auto; border: 2px solid rgba(7,90,67,.15); border-radius: 15px; background: #fffdf5; }
table { width: 100%; min-width: 1020px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--board); background: #e8f7e8; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.table-link { color: #067b4a; font-weight: 1000; }
.mobile-order-list { display: none; gap: 12px; }
.order-card { padding: 17px; border: 2px solid rgba(7,90,67,.16); border-radius: 15px; background: #fffdf5; box-shadow: 0 4px 0 rgba(7,90,67,.14); }
.order-card__top { display: flex; justify-content: space-between; gap: 10px; }
.order-card h3 { margin: 0; }
.order-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; color: var(--board); background: #dff6e7; font-size: 12px; font-weight: 1000; white-space: nowrap; }
.status-pill.danger { color: #8c1818; background: #ffe0da; }

.form-panel { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-grid .form-field { margin: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field.span-2 { grid-column: span 2; }
.check-field { display: flex; align-items: center; gap: 8px; margin-top: 26px; font-weight: 900; }
.check-field input { width: 18px; min-height: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.help { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.money-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 15px 0; }
.money-chip { padding: 13px; border-radius: 11px; background: #fff3c2; }
.money-chip span, .money-chip strong { display: block; }
.money-chip span { color: #7b6633; font-size: 11px; }
.money-chip strong { margin-top: 5px; color: var(--board); }
.detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.timeline { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 13px 14px 13px 18px; border-left: 4px solid var(--green); border-radius: 0 11px 11px 0; background: #eff7ee; }
.timeline strong, .timeline small { display: block; }
.timeline small { margin-top: 4px; color: var(--muted); }
.timeline p { margin: 7px 0 0; color: #445c54; line-height: 1.55; }
.record-list { display: grid; gap: 8px; }
.record-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 11px 12px; border-radius: 10px; background: #f2f7ef; }
.record-row small { display: block; margin-top: 3px; color: var(--muted); }
.finance-forms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mini-form { padding: 15px; border: 2px dashed rgba(7,90,67,.24); border-radius: 13px; }
.mini-form h3 { margin: 0 0 10px; font-size: 16px; }
.mini-form .form-field { margin-top: 10px; }
.mini-form button { width: 100%; margin-top: 12px; }
.form-field small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.referrer-report { margin-top: 20px; }
.report-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 10px; margin: 14px 0 16px; }
.report-filters .form-field { margin: 0; }
.referrer-report-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.referrer-stat { padding: 14px; border: 2px solid rgba(7,90,67,.14); border-radius: 12px; background: #eff7ee; }
.referrer-stat strong, .referrer-stat span { display: block; }
.referrer-stat strong { margin-bottom: 7px; color: var(--board); font-size: 17px; }
.referrer-stat span { margin-top: 4px; color: #445c54; font-size: 12px; line-height: 1.45; }

.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.setting-list { display: grid; gap: 8px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; border-radius: 10px; background: #eff7ee; }
.setting-row.inactive { opacity: .55; }
.setting-row button { min-height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; }
.notification-panel { position: fixed; top: 0; right: 0; z-index: 50; width: min(420px, 100%); height: 100vh; padding: 22px; overflow-y: auto; border-left: 6px solid var(--sprout); color: #fff; background: var(--board); box-shadow: -20px 0 60px rgba(4,45,34,.35); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 18px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 28px; }
.panel-heading .icon-button { color: #fff; background: rgba(255,255,255,.1); }
.notice-item { display: block; margin-bottom: 10px; padding: 14px; border-left: 5px solid var(--sun); border-radius: 0 11px 11px 0; color: var(--ink); background: #fffdf5; }
.notice-item.danger { border-color: var(--danger); background: #fff0ed; }
.notice-item strong, .notice-item span { display: block; }
.notice-item span { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.notification-tip { color: rgba(255,255,255,.65); font-size: 12px; line-height: 1.6; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; max-width: min(420px, calc(100% - 32px)); padding: 13px 18px; border: 3px solid var(--sprout); border-radius: 12px; color: #fff; background: var(--board); box-shadow: 0 8px 0 rgba(7,90,67,.24); font-weight: 900; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-grid, .detail-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .referrer-report-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .login-shell { display: block; padding: 28px 0; }
  .login-art { min-height: 220px; padding: 28px 20px; }
  .login-art p { font-size: 20px; }
  .sprout-logo { width: 84px; height: 76px; border-width: 7px; }
  .sprout-logo span { font-size: 36px; }
  .login-card { margin-top: 18px; padding: 28px 20px; }
  .app-shell { padding: 0 14px 36px; }
  .topbar { min-height: 68px; }
  .brand small, .user-chip { display: none; }
  .brand strong { font-size: 14px; }
  .brand-mark { width: 38px; height: 38px; }
  .main-nav { position: sticky; top: 0; z-index: 20; overflow-x: auto; justify-content: flex-start; border-radius: 13px; }
  .main-nav a { flex: 0 0 auto; min-height: 38px; padding: 0 15px; font-size: 13px; }
  main { padding-top: 20px; }
  .page-heading { align-items: start; }
  .page-heading .primary-button { min-width: 100px; }
  .dashboard-hero { display: block; min-height: auto; padding: 24px 20px; border-width: 6px; }
  .dashboard-hero::after { display: none; }
  .kpi-grid { gap: 10px; }
  .kpi-card { padding: 15px; }
  .kpi-card strong { font-size: 24px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 16px; }
  .filters .wide-mobile { grid-column: 1 / -1; }
  .table-wrap { display: none; }
  .mobile-order-list { display: grid; }
  .form-panel { padding: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full, .form-field.span-2 { grid-column: auto; }
  .check-field { margin-top: 4px; }
  .money-summary { grid-template-columns: 1fr 1fr; }
  .finance-forms, .settings-grid { grid-template-columns: 1fr; }
  .report-filters, .referrer-report-cards { grid-template-columns: 1fr; }
  .form-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--cream) 30%); }
  .form-actions button { flex: 1; }
  .toast { right: 16px; bottom: 16px; }
}
@media (max-width: 420px) {
  .kpi-grid, .filters, .money-summary { grid-template-columns: 1fr; }
  .filters .wide-mobile { grid-column: auto; }
}
