:root {
  --green: #123f30;
  --green-2: #1c6248;
  --green-3: #dcece3;
  --cream: #f6f1e4;
  --gold: #d69a2e;
  --plum: #74445f;
  --blue: #3c6d88;
  --ink: #18251f;
  --muted: #647168;
  --line: #dde5df;
  --paper: #ffffff;
  --surface: #f4f7f4;
  --danger: #a83e32;
  --shadow: 0 18px 50px rgba(18, 63, 48, .12);
  color: var(--ink);
  background: #e8eee9;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 50% -10%, #d3e5d8, #eef2ee 42%, #e8ece8); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 540px); min-height: 100vh; margin: 0 auto; background: var(--surface); padding: env(safe-area-inset-top) 18px calc(96px + env(safe-area-inset-bottom)); box-shadow: 0 0 55px rgba(18, 63, 48, .12); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; border: 0; padding: 0; background: transparent; text-align: left; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; background: var(--green); color: #fff; border-radius: 14px; font-size: 1.2rem; font-weight: 900; }
.brand b, .brand small { display: block; }
.brand b { font-size: 1rem; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.status-chip { border: 0; display: flex; align-items: center; gap: 6px; background: var(--green-3); color: var(--green); border-radius: 999px; padding: 8px 11px; font-size: .78rem; font-weight: 800; }
.status-chip i { width: 7px; height: 7px; border-radius: 50%; background: #2d9b64; }
.view { display: none; animation: fade .22s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.license-banner { position: relative; overflow: hidden; padding: 26px; border-radius: 28px; color: #fff; background: linear-gradient(135deg, #0e3829, #1b6046); box-shadow: var(--shadow); }
.license-banner::after { content: ""; position: absolute; width: 210px; height: 210px; right: -90px; top: -80px; border-radius: 50%; border: 35px solid rgba(242,196,93,.12); }
.license-banner > * { position: relative; z-index: 1; }
.kicker { display: inline-block; color: #f3cf78; font-size: .75rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.kicker.dark { color: var(--green-2); }
.license-banner h1 { font-size: 2rem; line-height: 1.18; letter-spacing: -.03em; margin: 10px 0; }
.license-banner p { margin: 0 0 20px; color: #cbe0d3; font-size: .85rem; line-height: 1.55; }
.light-button { border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.12); color: #fff; padding: 11px 15px; border-radius: 13px; font-weight: 800; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 14px 0; }
.quick-grid article { min-width: 0; display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); padding: 12px 10px; border-radius: 18px; }
.quick-grid b, .quick-grid small { display: block; }
.quick-grid b { font-size: 1.15rem; }
.quick-grid small { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.quick-icon { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--plum); font-weight: 900; }
.quick-icon.green { background: var(--green-2); }
.quick-icon.amber { background: var(--gold); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 20px; margin: 14px 0; box-shadow: 0 8px 24px rgba(18,63,48,.05); }
.panel.compact { padding-bottom: 6px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { margin: 5px 0 0; font-size: 1.18rem; line-height: 1.3; }
.count-pill, .slot-pill, .free-tag { background: var(--green-3); color: var(--green); padding: 7px 10px; border-radius: 999px; font-size: .78rem; font-weight: 900; }
.task-list { margin-top: 12px; }
.task-list label { display: flex; align-items: center; gap: 12px; padding: 14px 2px; border-top: 1px solid var(--line); }
.task-list input { width: 20px; height: 20px; accent-color: var(--green-2); }
.task-list span { flex: 1; }
.task-list b, .task-list small { display: block; }
.task-list b { font-size: .93rem; }
.task-list small { color: var(--muted); margin-top: 4px; line-height: 1.45; font-size: .78rem; }
.action-list { margin-top: 10px; }
.action-list button { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-top: 1px solid var(--line); padding: 15px 0; background: transparent; text-align: left; color: var(--ink); }
.action-list button > span:nth-child(2) { flex: 1; }
.action-list b, .action-list small { display: block; }
.action-list small { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.action-list em { color: var(--green); font-size: .82rem; font-style: normal; font-weight: 900; }
.action-symbol { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; background: var(--plum); color: #fff; font-weight: 900; }
.action-symbol.blue { background: var(--blue); }
.action-symbol.gold { background: var(--gold); }
.page-title { padding: 22px 4px 10px; }
.page-title h1 { margin: 7px 0 8px; font-size: 1.65rem; line-height: 1.25; letter-spacing: -.025em; }
.page-title p { margin: 0; color: var(--muted); line-height: 1.65; font-size: .88rem; }
.inline-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; }
.filter-row button { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--muted); padding: 9px 13px; border-radius: 999px; font-size: .82rem; }
.filter-row button.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 800; }
.trend-card { background: #fff; border: 1px solid var(--line); border-radius: 23px; padding: 19px; margin: 12px 0; }
.trend-card[hidden] { display: none; }
.trend-top { display: flex; align-items: center; justify-content: space-between; color: var(--green-2); font-size: .76rem; font-weight: 800; }
.trend-top small { color: var(--muted); font-weight: 500; }
.trend-card h2 { font-size: 1.12rem; line-height: 1.5; margin: 12px 0 7px; }
.trend-card p { color: var(--muted); line-height: 1.65; font-size: .85rem; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 13px 0; }
.tag-row span { background: var(--cream); color: #7d652f; border-radius: 8px; padding: 6px 8px; font-size: .73rem; }
.primary-button, .secondary-button { border: 0; border-radius: 14px; padding: 13px 17px; font-weight: 900; }
.primary-button { background: var(--green); color: #fff; }
.secondary-button { background: var(--green-3); color: var(--green); }
.full { width: 100%; }
.text-button { border: 0; background: transparent; color: var(--green); font-weight: 900; }
.script-panel.hidden { display: none; }
textarea, input, select { width: 100%; border: 1px solid #ced9d1; border-radius: 13px; padding: 12px 13px; background: #fff; color: var(--ink); outline: none; }
textarea:focus, input:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(28,98,72,.10); }
textarea { resize: vertical; line-height: 1.65; }
label { display: block; font-size: .85rem; font-weight: 800; margin: 14px 0; }
label > input, label > select, label > textarea { margin-top: 7px; font-weight: 500; }
.notice { display: flex; gap: 8px; background: var(--green-3); color: var(--green); padding: 12px; border-radius: 13px; margin: 12px 0; font-size: .78rem; line-height: 1.5; }
.notice b { flex: 0 0 auto; }
.notice.warning { background: #fff2d7; color: #744c05; }
.quota-card { color: #fff; background: linear-gradient(135deg, var(--green), #215f49); padding: 19px; border-radius: 22px; box-shadow: var(--shadow); margin: 8px 0 20px; }
.quota-card > div:first-child { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.quota-card span { color: #c8dfd2; font-size: .82rem; }
.quota-card b { font-size: .9rem; }
.quota-card strong { font-size: 1.7rem; }
.quota-track { height: 9px; margin: 14px 0 9px; background: rgba(255,255,255,.16); border-radius: 99px; overflow: hidden; }
.quota-track i { display: block; height: 100%; width: 100%; background: #f2c45d; border-radius: inherit; transition: width .3s; }
.quota-card small { color: #c8dfd2; font-size: .75rem; }
.standalone { margin: 16px 2px 8px; }
.avatar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.avatar-card { min-width: 0; border: 1px solid var(--line); background: #fff; border-radius: 19px; padding: 9px 7px 12px; color: var(--ink); }
.avatar-card.selected { border: 2px solid var(--green-2); box-shadow: 0 7px 20px rgba(28,98,72,.13); }
.portrait { aspect-ratio: .92; display: grid; align-items: end; justify-items: center; overflow: hidden; border-radius: 14px; background: linear-gradient(155deg, #f6d3bb, #9e5844); }
.portrait i { width: 72%; aspect-ratio: .78; display: grid; place-items: center; background: rgba(255,255,255,.86); color: #5d3b32; border-radius: 50% 50% 12% 12%; font-size: 2rem; font-style: normal; font-weight: 900; box-shadow: 0 8px 20px rgba(0,0,0,.13); }
.portrait-two { background: linear-gradient(155deg, #d9e5e0, #366954); }
.portrait-two i { color: #254c3d; }
.portrait-three { background: linear-gradient(155deg, #dce6ed, #456d86); }
.portrait-three i { color: #34576c; }
.avatar-card b, .avatar-card small, .avatar-card em { display: block; }
.avatar-card b { margin-top: 8px; font-size: .88rem; }
.avatar-card small { color: var(--muted); font-size: .67rem; margin: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-card em { color: var(--green-2); font-size: .7rem; font-style: normal; font-weight: 900; }
.empty-state { display: flex; align-items: center; gap: 11px; border: 1px dashed #b9cbbf; background: #f8faf8; border-radius: 16px; padding: 13px; margin-top: 13px; }
.empty-state > span { width: 38px; height: 38px; display: grid; place-items: center; background: var(--green-3); color: var(--green); border-radius: 12px; font-size: 1.3rem; }
.empty-state div { flex: 1; }
.empty-state b, .empty-state small { display: block; }
.empty-state small { margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.empty-state button { border: 0; background: var(--green); color: #fff; border-radius: 10px; padding: 9px 11px; font-size: .78rem; font-weight: 900; }
.estimate-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .78rem; margin: 10px 0 15px; }
.helper { color: var(--muted); font-size: .74rem; line-height: 1.5; margin: 10px 2px 0; }
.job-card { display: flex; align-items: center; gap: 11px; background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 13px; margin: 10px 0; }
.job-card > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--green-3); color: var(--green); font-weight: 900; }
.job-card div { flex: 1; }
.job-card b, .job-card small { display: block; }
.job-card small { color: var(--muted); margin-top: 3px; font-size: .75rem; }
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; background: var(--cream); border-radius: 17px; margin: 10px 0 14px; }
.pipeline span { padding: 11px 4px; text-align: center; border-right: 1px solid #fff; color: var(--muted); font-size: .72rem; }
.pipeline b { display: block; margin-top: 3px; color: var(--ink); font-size: 1.1rem; }
.square-button { width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--green); color: #fff; font-size: 1.5rem; }
.lead-item { display: flex; align-items: center; gap: 11px; background: #fff; border: 1px solid var(--line); padding: 14px; border-radius: 18px; margin: 9px 0; }
.lead-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--green); color: #fff; font-weight: 900; }
.lead-item > div { flex: 1; min-width: 0; }
.lead-item b, .lead-item small { display: block; }
.lead-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-item small { color: var(--muted); margin-top: 4px; font-size: .76rem; }
.lead-stage { flex: 0 0 auto; width: 104px; max-width: 34%; border: 0; background: var(--green-3); color: var(--green); border-radius: 10px; padding: 8px; font-size: .73rem; font-weight: 800; }
.profile-form label { color: var(--muted); }
.feature-list { list-style: none; margin: 14px 0; padding: 0; }
.feature-list li { position: relative; padding: 9px 0 9px 25px; border-top: 1px solid var(--line); font-size: .86rem; }
.feature-list li::before { content: "✓"; position: absolute; left: 2px; color: var(--green-2); font-weight: 900; }
.data-actions { padding-top: 6px; padding-bottom: 6px; }
.data-actions button { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; padding: 14px 2px; }
.data-actions button > span { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; background: var(--green-3); color: var(--green); font-size: 1.2rem; font-weight: 900; }
.data-actions b, .data-actions small { display: block; }
.data-actions small { color: var(--muted); margin-top: 3px; font-size: .76rem; }
.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%,540px); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); border-top: 1px solid var(--line); padding: 8px 9px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(18,63,48,.08); }
.bottom-nav button { border: 0; background: transparent; color: #7c8a81; padding: 5px 2px; font-size: .7rem; }
.bottom-nav span, .bottom-nav b { display: block; }
.bottom-nav span { min-height: 22px; font-size: 1.12rem; }
.bottom-nav b { margin-top: 2px; font-weight: 700; }
.bottom-nav button.active { color: var(--green); }
.modal { display: none; position: fixed; z-index: 50; inset: 0; align-items: flex-end; justify-content: center; background: rgba(7,28,19,.62); }
.modal.open { display: flex; }
.modal-card { width: min(100%,540px); max-height: 90vh; overflow: auto; background: #fff; border-radius: 27px 27px 0 0; padding: 23px 20px calc(25px + env(safe-area-inset-bottom)); }
.modal-copy { color: var(--muted); line-height: 1.65; font-size: .86rem; }
.close-button { border: 0; background: transparent; color: var(--muted); font-size: 1.7rem; }
.modal details { background: var(--surface); padding: 11px 13px; border-radius: 12px; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.modal details p { line-height: 1.7; }
.check-line { display: flex; align-items: flex-start; gap: 9px; }
.check-line input { flex: 0 0 auto; width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--green); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 104px; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; max-width: min(88%,460px); background: #12241b; color: #fff; padding: 12px 16px; border-radius: 13px; text-align: center; font-size: .82rem; transition: .24s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (min-width: 541px) {
  .app-shell { margin: 24px auto; min-height: calc(100vh - 48px); border-radius: 30px; }
  .bottom-nav { bottom: 24px; border-radius: 0 0 30px 30px; }
}

@media (max-width: 375px) {
  .app-shell { padding-left: 13px; padding-right: 13px; }
  .brand small { display: none; }
  .license-banner { padding: 22px; }
  .license-banner h1 { font-size: 1.7rem; }
  .quick-grid article { display: block; text-align: center; }
  .quick-icon { margin: 0 auto 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
