:root {
  color-scheme: light;
  --ink: #202822;
  --muted: #68706a;
  --forest: #193f36;
  --forest-deep: #12332b;
  --orange: #e6652c;
  --orange-deep: #c94e1d;
  --cream: #f7f3eb;
  --paper: #fffdfa;
  --line: #e4ddcf;
  --soft-green: #eaf2eb;
  --soft-orange: #fce5d7;
  --danger: #b44534;
  --shadow: 0 18px 42px rgba(35, 39, 30, .09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--cream); }
body { margin: 0; color: var(--ink); background: linear-gradient(180deg, #f2f3ef 0, var(--cream) 17rem); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.app-shell { min-height: 100vh; padding-bottom: 2rem; }
.topbar { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; font-size: 18px; }
.brand-mark { display: grid; place-items: center; height: 30px; width: 30px; color: white; background: var(--forest); border-radius: 10px; font-size: 15px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.data-pill { color: var(--forest); border: 1px solid #cedbd1; background: rgba(234,242,235,.75); padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.icon-button { min-width: 36px; min-height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 20px; line-height: 1; }
.icon-button:hover { border-color: #b6c5b9; background: #fff; }
main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.hero { position: relative; overflow: hidden; background: var(--forest); color: white; border-radius: 28px; padding: clamp(30px, 6vw, 66px); box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; height: 330px; width: 330px; border: 58px solid rgba(255,255,255,.06); border-radius: 50%; right: -120px; top: -140px; }
.hero::after { content: ""; position: absolute; width: 145px; height: 145px; background: var(--orange); border-radius: 35px; transform: rotate(26deg); right: 12%; bottom: -86px; opacity: .95; }
.hero > * { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 8px; color: var(--orange); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.hero .eyebrow { color: #ffad82; }
.hero h1 { max-width: 670px; margin: 0; font-size: clamp(38px, 6vw, 64px); line-height: 1.08; letter-spacing: -.075em; }
.hero-copy { max-width: 560px; margin: 20px 0 27px; color: #d9e6dc; font-size: 17px; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { border: 0; border-radius: 12px; min-height: 46px; padding: 0 17px; font-weight: 800; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--orange); box-shadow: 0 7px 14px rgba(121,48,21,.18); }
.button.primary:hover { background: var(--orange-deep); }
.button.subtle { color: var(--forest); background: #fff; border: 1px solid #e9e1d6; }
.button.subtle:hover { background: #fffbf6; }
.button.compact { min-height: 40px; padding: 0 13px; font-size: 14px; }
.button.danger { color: var(--danger); background: #fff2ef; border: 1px solid #f4cac1; }
.button.text-only { background: transparent; border: 0; padding: 0 6px; }
.full-button { width: 100%; margin-top: 10px; }
.metric-row { margin-top: 42px; display: grid; grid-template-columns: repeat(3, minmax(0, 150px)); border: 1px solid rgba(255,255,255,.15); border-radius: 16px; overflow: hidden; width: min(100%, 450px); background: rgba(7, 30, 22, .16); }
.metric-row div { padding: 14px 17px; border-right: 1px solid rgba(255,255,255,.15); }
.metric-row div:last-child { border-right: 0; }
.metric-row strong { display: block; font-size: 25px; letter-spacing: -.05em; }
.metric-row span { display: block; color: #c8d7cd; margin-top: 2px; font-size: 12px; }

.section { margin-top: 44px; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section h2 { font-size: clamp(25px, 4vw, 34px); letter-spacing: -.055em; margin: 0; }
.section-copy { color: var(--muted); line-height: 1.65; margin: -5px 0 18px; }
.text-button { color: var(--orange-deep); padding: 5px 0; background: transparent; border: 0; font-size: 14px; font-weight: 800; }
.filter-panel { padding: 15px; border: 1px solid var(--line); background: rgba(255,253,250,.75); border-radius: 17px; }
.search-field { height: 48px; display: flex; align-items: center; gap: 9px; border: 1px solid #d9d1c5; background: #fff; padding: 0 14px; border-radius: 11px; color: var(--muted); }
.search-field span { font-size: 23px; transform: rotate(-18deg); }
.search-field input { border: 0; outline: 0; color: var(--ink); min-width: 0; width: 100%; background: transparent; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.filter-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
select, input, textarea { color: var(--ink); }
.filter-grid select, .candidate-filters select { background: white; border: 1px solid #ded6c9; min-height: 39px; border-radius: 9px; padding: 0 9px; outline: none; }
.result-summary { color: var(--muted); font-size: 14px; margin: 18px 0 12px; }
.store-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.store-card { position: relative; min-height: 232px; border: 1px solid var(--line); background: var(--paper); border-radius: 17px; padding: 20px; box-shadow: 0 5px 12px rgba(43,43,32,.025); display: flex; flex-direction: column; }
.store-card:hover { border-color: #bccdc0; box-shadow: 0 13px 28px rgba(44,48,37,.08); }
.store-card-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.store-card h3 { margin: 0; letter-spacing: -.04em; font-size: 20px; line-height: 1.25; }
.store-location { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.status-tag { flex: none; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 800; }
.status-tag.推荐 { color: #245842; background: #e5f2e8; }
.status-tag.备选 { color: #966022; background: #fff1da; }
.status-tag.不推荐 { color: #91403a; background: #f9e6e3; }
.store-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0 12px; }
.store-meta span, .scene-tag { border-radius: 7px; background: #f3eee6; padding: 5px 7px; color: #575d56; font-size: 12px; }
.scene-list { display: flex; flex-wrap: wrap; gap: 5px; }
.scene-tag { background: var(--soft-green); color: #39604e; }
.store-note { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid #eee7dc; color: #4b504a; line-height: 1.55; font-size: 13px; }
.store-card-footer { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.card-link { color: var(--orange-deep); text-decoration: none; font-size: 12px; font-weight: 800; }
.edit-card-button { color: var(--forest); border: 0; background: transparent; font-weight: 800; font-size: 12px; padding: 4px; }
.empty-state { border: 1px dashed #d5cbbd; border-radius: 18px; padding: 46px 24px; text-align: center; background: rgba(255,253,250,.52); }
.empty-state.small { padding: 34px 20px; }
.empty-state h3 { margin: 12px 0 7px; font-size: 21px; letter-spacing: -.04em; }
.empty-state p { margin: 0 auto 20px; max-width: 420px; color: var(--muted); line-height: 1.6; }
.empty-icon { display: inline-grid; place-items: center; width: 47px; height: 47px; background: var(--soft-orange); border-radius: 15px; color: var(--orange-deep); font-size: 22px; font-weight: 900; }

.collection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.collection-card { border: 1px solid #cbd8ce; background: linear-gradient(135deg, #f4faf3, #fffdf9 63%); border-radius: 17px; padding: 22px; }
.collection-card h3 { margin: 0; font-size: 22px; letter-spacing: -.045em; }
.collection-card p { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 9px 0 15px; min-height: 39px; }
.collection-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #dce6dd; padding-top: 14px; }
.collection-card-count { color: var(--forest); font-size: 13px; font-weight: 800; }
.collection-card-actions { display: flex; gap: 8px; }
.small-action { border: 0; border-radius: 8px; padding: 7px 9px; color: var(--forest); background: white; font-size: 12px; font-weight: 800; }

.modal { width: min(720px, calc(100% - 24px)); max-height: min(90vh, 900px); padding: 0; border: 0; border-radius: 22px; background: transparent; box-shadow: 0 24px 80px rgba(27,30,24,.27); }
.modal::backdrop { background: rgba(29,37,30,.48); backdrop-filter: blur(2px); }
.modal-card { overflow: auto; max-height: min(90vh, 900px); padding: 26px; background: var(--paper); border-radius: 22px; }
.modal-card.wide { width: min(100%, 1000px); }
.modal-card.small-card { width: min(100%, 480px); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.modal-heading h2 { margin: 0; font-size: 29px; letter-spacing: -.055em; }
.close-button { flex: none; font-size: 28px; font-weight: 300; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { position: relative; display: grid; gap: 7px; color: #484f48; font-size: 13px; font-weight: 800; }
.field.required::after { content: "*"; position: absolute; color: var(--orange); left: 30px; top: 0; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #dcd3c7; border-radius: 10px; outline: 0; background: white; padding: 11px 12px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #739685; box-shadow: 0 0 0 3px rgba(100,139,117,.15); }
.field textarea { resize: vertical; line-height: 1.55; }
.field .suffix { position: absolute; right: 12px; bottom: 11px; color: var(--muted); font-weight: 500; }
.full-width { grid-column: 1 / -1; margin-top: 14px; }
.tag-fieldset { border: 0; padding: 0; margin: 20px 0 0; }
.tag-fieldset legend { padding: 0; color: #484f48; font-size: 13px; font-weight: 800; }
.tag-fieldset legend span { color: var(--muted); font-weight: 500; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.choice-chips label { border: 1px solid #ddd5c9; border-radius: 999px; padding: 8px 11px; background: white; color: #525952; font-size: 13px; cursor: pointer; }
.choice-chips input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chips label:has(input:checked) { background: var(--soft-green); border-color: #82a48f; color: var(--forest); font-weight: 800; }
.optional-details { margin-top: 16px; color: var(--muted); font-size: 13px; }
.optional-details summary { cursor: pointer; font-weight: 700; }
.detail-grid { padding-top: 13px; }
.form-hint { color: var(--muted); font-size: 12px; margin: 17px 0 0; }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.modal-spacer { flex: 1; }

.collection-builder { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.candidate-panel, .selected-panel { min-height: 275px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fffefa; }
.selected-panel { background: #f7fbf7; border-color: #d5e4d7; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.panel-heading h3 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.panel-heading span { color: var(--muted); font-size: 11px; }
.candidate-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.candidate-filters select { font-size: 12px; min-width: 0; }
.candidate-list, .selected-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; padding-right: 2px; }
.candidate-item, .selected-item { display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 10px; background: #f9f7f2; font-size: 13px; }
.candidate-item { cursor: pointer; }
.candidate-item:has(input:checked) { background: #e8f2ea; }
.candidate-item input { width: 16px; height: 16px; accent-color: var(--forest); }
.candidate-item strong, .selected-item strong { display: block; font-size: 13px; }
.candidate-item small, .selected-item small { display: block; margin-top: 2px; color: var(--muted); }
.selected-item { background: white; border: 1px solid #dce8de; }
.selected-order { color: var(--forest); font-size: 12px; font-weight: 900; width: 18px; text-align: center; }
.move-buttons { margin-left: auto; display: flex; gap: 4px; }
.move-buttons button { height: 26px; width: 26px; border: 1px solid #d5ddd6; background: #fff; border-radius: 6px; color: var(--forest); }
.empty-list { padding: 18px 9px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }

.collection-detail-card { max-width: 680px; }
.detail-brief { margin: -8px 0 18px; color: var(--muted); line-height: 1.55; }
.detail-store-list { display: grid; gap: 10px; }
.detail-store { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fffefa; }
.detail-store-header { display: flex; align-items: baseline; gap: 10px; }
.detail-store-number { color: var(--orange-deep); font-size: 12px; font-weight: 900; }
.detail-store h3 { margin: 0; font-size: 17px; letter-spacing: -.035em; }
.detail-store p { margin: 9px 0 0; color: #555c55; font-size: 13px; line-height: 1.55; white-space: pre-line; }
.detail-note { margin: 15px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.settings-copy { color: var(--muted); line-height: 1.65; margin: -4px 0 14px; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 10; transform: translate(-50%, 22px); opacity: 0; pointer-events: none; border-radius: 999px; padding: 11px 16px; background: #1d3028; color: white; font-size: 13px; font-weight: 700; box-shadow: 0 10px 30px rgba(23,30,24,.25); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }
.auth-modal::backdrop { background: var(--cream); backdrop-filter: none; }
.auth-modal[open] { box-shadow: 0 20px 70px rgba(27,30,24,.18); }
.auth-error { min-height: 20px; color: var(--danger); font-size: 13px; }

@media (max-width: 760px) {
  body { background: linear-gradient(180deg, #f2f3ef 0, var(--cream) 12rem); }
  .app-shell { padding-bottom: 83px; }
  .topbar, main { width: min(100% - 24px, 640px); }
  .topbar { padding: 15px 0; }
  .data-pill { display: none; }
  .hero { margin-top: 5px; padding: 31px 24px; border-radius: 22px; }
  .hero::after { right: -46px; bottom: -88px; }
  .hero h1 { font-size: 39px; }
  .hero-copy { font-size: 15px; margin: 15px 0 22px; }
  .metric-row { margin-top: 29px; }
  .metric-row div { padding: 12px 10px; }
  .metric-row strong { font-size: 22px; }
  .metric-row span { font-size: 11px; }
  .section { margin-top: 32px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-grid, .collection-grid { grid-template-columns: 1fr; }
  .store-card { min-height: 0; }
  .collection-builder { grid-template-columns: 1fr; }
  .candidate-panel, .selected-panel { min-height: 205px; }
  .modal { width: 100%; max-height: 100dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .modal-card { max-height: calc(100dvh - 20px); padding: 21px 17px 24px; border-radius: 20px 20px 0 0; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .full-width { margin-top: 0; }
  .field.required::after { left: 30px; }
  .detail-grid { padding-top: 13px; }
  .modal-actions { position: sticky; bottom: -24px; margin: 22px -17px -24px; padding: 13px 17px; background: rgba(255,253,250,.96); border-top: 1px solid var(--line); }
  .mobile-nav { display: grid; position: fixed; bottom: 0; left: 0; right: 0; z-index: 4; height: 69px; grid-template-columns: 1fr 82px 1fr; align-items: center; border-top: 1px solid var(--line); background: rgba(255,253,250,.97); backdrop-filter: blur(12px); }
  .nav-item { display: grid; justify-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; }
  .nav-item span { color: var(--orange-deep); font-size: 19px; line-height: 1; }
  .nav-add { place-self: center; display: grid; place-items: center; height: 47px; width: 47px; border: 0; background: var(--forest); color: white; border-radius: 50%; font-size: 31px; line-height: 1; box-shadow: 0 8px 15px rgba(21,57,47,.22); }
}

@media (max-width: 390px) {
  .topbar { width: min(100% - 20px, 640px); }
  main { width: min(100% - 20px, 640px); }
  .brand { font-size: 16px; }
  .hero h1 { font-size: 35px; }
  .hero-actions .button { width: 100%; }
  .section-title-row { align-items: center; }
}
