:root {
  --ink: #14251f;
  --muted: #71817b;
  --line: #dfe8e4;
  --paper: #ffffff;
  --canvas: #f2f6f4;
  --green: #075846;
  --green-dark: #063e33;
  --green-soft: #e7f2ee;
  --gold: #e6b85b;
  --red: #b44b4b;
  --shadow: 0 20px 55px rgba(29, 66, 54, .12);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: #27816b; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.brand-mark { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #08735b, #064438); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); font-family: "STKaiti", "KaiTi", serif; font-size: 23px; font-weight: 800; }
.brand-mark--large { width: 64px; height: 64px; border-radius: 18px; font-size: 34px; background: linear-gradient(145deg, #f2c66b, #bd8030); color: #19332b; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(420px, .9fr); background: #fff; }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(50px, 8vw, 130px); color: #fff; background: radial-gradient(circle at 20% 20%, rgba(53,151,124,.35), transparent 35%), radial-gradient(circle at 90% 80%, rgba(230,184,91,.16), transparent 32%), linear-gradient(145deg, #052f29, #075846); }
.login-art::before, .login-art::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.login-art::before { width: 480px; height: 480px; right: -190px; top: -150px; }
.login-art::after { width: 340px; height: 340px; right: 30px; top: -80px; }
.login-art .eyebrow { margin-top: 28px; color: #d8ad5a; }
.login-art h1 { margin: 0; max-width: 610px; font-family: "STKaiti", "KaiTi", serif; font-size: clamp(52px, 6vw, 92px); line-height: 1.05; letter-spacing: -.04em; }
.login-art > p:not(.eyebrow) { max-width: 540px; margin: 28px 0; color: rgba(255,255,255,.72); font-size: 18px; line-height: 1.8; }
.login-points { display: flex; gap: 12px; flex-wrap: wrap; }
.login-points span { padding: 9px 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 99px; font-size: 13px; }
.login-card { width: min(440px, calc(100% - 48px)); align-self: center; justify-self: center; padding: 46px; border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-size: 34px; }
.login-card > .muted { margin-bottom: 30px; line-height: 1.7; }
.login-card > label { display: grid; gap: 8px; margin-top: 18px; color: #40524b; font-size: 14px; font-weight: 650; }
.login-card input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: #fbfdfc; transition: .2s; }
.login-card input:focus { border-color: #2b9479; box-shadow: 0 0 0 4px rgba(43,148,121,.12); }
.login-card .button { margin-top: 26px; }
.mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 35px; }
.form-error { min-height: 20px; color: var(--red); font-size: 13px; }
.login-tip { margin: 22px 0 0; color: #93a09b; font-size: 12px; line-height: 1.6; text-align: center; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 750; transition: transform .18s, box-shadow .18s, background .18s; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: #fff; background: var(--green); box-shadow: 0 8px 18px rgba(7,88,70,.18); }
.button--primary:hover { background: var(--green-dark); }
.button--gold { color: #15382f; background: linear-gradient(135deg, #f2d184, #dca84e); box-shadow: 0 8px 24px rgba(181,123,34,.22); }
.button--soft { border-color: #cfe1da; color: var(--green); background: #fff; }
.button--danger { border-color: #efcaca; color: var(--red); background: #fff5f5; }
.button--wide { width: 100%; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #5d6c67; font-size: 22px; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-weight: 750; }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 10; display: flex; height: 100vh; flex-direction: column; padding: 24px 18px; color: #e4f0ec; background: linear-gradient(180deg, #063f34, #052f29); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand strong { display: block; color: #fff; font-size: 17px; }
.brand small { display: block; margin-top: 3px; color: rgba(255,255,255,.5); font-size: 11px; }
.side-nav { display: grid; gap: 5px; margin-top: 26px; }
.side-nav button { display: flex; height: 46px; align-items: center; gap: 11px; padding: 0 13px; border: 0; border-radius: 11px; color: rgba(255,255,255,.68); background: transparent; text-align: left; transition: .2s; }
.side-nav button span { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; font-size: 12px; }
.side-nav button:hover, .side-nav button.active { color: #fff; background: rgba(255,255,255,.11); }
.side-nav button.active span { color: #1d4a3d; background: var(--gold); border-color: var(--gold); }
.sidebar-help { margin-top: auto; padding: 15px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.05); }
.sidebar-help strong { color: #fff; font-size: 13px; }
.sidebar-help p { margin: 7px 0 0; color: rgba(255,255,255,.55); font-size: 11px; line-height: 1.6; }
.logout-button { margin-top: 12px; padding: 10px; border: 0; color: rgba(255,255,255,.55); background: transparent; font-size: 13px; }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 8; display: flex; min-height: 86px; align-items: center; justify-content: space-between; padding: 16px clamp(22px, 4vw, 54px); border-bottom: 1px solid rgba(216,229,224,.9); background: rgba(247,250,248,.9); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 23px; }
.topbar .eyebrow { margin: 0 0 3px; font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.admin-avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: #fff; background: #163e34; font-size: 13px; }
.menu-button { display: none; }
.content { max-width: 1560px; margin: 0 auto; padding: 34px clamp(22px, 4vw, 54px) 70px; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.page-intro { display: flex; min-height: 84px; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-intro h2 { margin: 0; font-size: 30px; }
.page-intro p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-panel { position: relative; overflow: hidden; display: flex; min-height: 210px; align-items: center; justify-content: space-between; gap: 25px; padding: clamp(28px, 5vw, 58px); border-radius: 24px; color: #fff; background: radial-gradient(circle at 90% 20%, rgba(230,184,91,.22), transparent 25%), linear-gradient(135deg, #075846, #063c32); box-shadow: var(--shadow); }
.hero-panel::after { content: "千"; position: absolute; right: 8%; color: rgba(255,255,255,.035); font-family: "KaiTi", serif; font-size: 210px; font-weight: 800; transform: rotate(-8deg); }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel .eyebrow { color: #eac777; }
.hero-panel h2 { margin: 0; font-size: clamp(27px, 3vw, 44px); }
.hero-panel p:not(.eyebrow) { margin: 12px 0 0; color: rgba(255,255,255,.68); }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 14px; margin: 20px 0; }
.stat-card { padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 8px 28px rgba(35,75,61,.05); }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin-top: 12px; font-size: 30px; letter-spacing: -.03em; }
.stat-card small { color: #90a09a; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 12px 35px rgba(35,75,61,.055); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 23px 25px; border-bottom: 1px solid #edf2ef; }
.panel-head h3 { margin: 0; font-size: 19px; }
.split-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 20px; }
.empty-state { display: grid; min-height: 170px; place-items: center; padding: 25px; color: var(--muted); text-align: center; }
.activity-list { padding: 8px 24px 18px; }
.activity-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 13px; align-items: center; padding: 14px 0; border-bottom: 1px solid #eef3f0; }
.activity-item:last-child { border: 0; }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; background: #42a789; box-shadow: 0 0 0 5px #e8f4f0; }
.activity-dot.risk { background: #c36d54; box-shadow: 0 0 0 5px #f8ece8; }
.activity-item strong { display: block; font-size: 14px; }
.activity-item small { display: block; margin-top: 3px; color: var(--muted); }
.activity-item time { color: #95a19d; font-size: 12px; }
.step-list { list-style: none; margin: 0; padding: 14px 25px 22px; }
.step-list li { display: flex; gap: 13px; padding: 14px 0; }
.step-list b { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); }
.step-list strong, .step-list small { display: block; }
.step-list small { margin-top: 4px; color: var(--muted); line-height: 1.5; }

.form-panel { padding: 30px; }
.form-panel--narrow { max-width: 900px; }
.settings-title { margin: 32px 0 18px; padding-top: 27px; border-top: 1px solid #e8efec; font-size: 16px; }
.settings-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: grid; align-content: start; gap: 8px; color: #4d5e58; font-size: 14px; }
.field--wide { grid-column: 1 / -1; }
.field > span:first-child { font-weight: 700; }
.field input, .field select, .field textarea, .table-tools select, .search-input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid #d7e2de; border-radius: 9px; outline: none; color: var(--ink); background: #fbfdfc; transition: .2s; }
.field textarea { height: auto; min-height: 90px; padding: 11px 13px; resize: vertical; font: inherit; line-height: 1.65; }
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus { border-color: #33947c; box-shadow: 0 0 0 3px rgba(51,148,124,.11); }
.field small { color: #92a09b; line-height: 1.5; }
.check-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.check-grid label { display: flex; min-height: 42px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #d7e2de; border-radius: 9px; background: #fbfdfc; }
.check-grid input { width: 16px; height: 16px; accent-color: var(--green); }
.color-grid input[type="color"] { padding: 4px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 26px; padding-top: 22px; border-top: 1px solid #eaf0ed; }
.logo-upload { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; padding-bottom: 26px; border-bottom: 1px solid #eaf0ed; }
.logo-upload small { color: var(--muted); }
.logo-upload__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-upload__actions small { width: 100%; }
.upload-status { width: 100%; color: #547069; font-size: 13px; font-weight: 750; }
.upload-status.success { color: #16805f; }
.upload-status.error { color: #b94f4a; }
.image-preview { position: relative; overflow: hidden; display: grid; width: 170px; height: 130px; flex: 0 0 auto; place-items: center; border: 1px dashed #cbdad4; border-radius: 12px; color: #9aa7a2; background: #f8fbf9; }
.image-preview--logo { width: 82px; height: 82px; }
.image-preview--logo img { padding: 7px; object-fit: contain; background: #fff; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.site-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.site-image-slot { display: grid; grid-template-columns: 210px 1fr; grid-template-rows: auto auto; align-items: center; gap: 8px 16px; padding: 16px; border: 1px solid #e1eae6; border-radius: 13px; background: #fbfdfc; }
.site-image-slot .image-preview { grid-row: 1 / 3; width: 210px; height: 125px; }
.site-image-slot .button { justify-self: start; }
.site-image-slot small { align-self: start; color: var(--muted); line-height: 1.5; }
.site-product-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.site-product-editor article { display: grid; grid-template-columns: 140px 1fr; gap: 12px 16px; padding: 16px; border: 1px solid #e1eae6; border-radius: 13px; background: #fbfdfc; }
.site-product-editor .image-preview { grid-row: 1 / 4; width: 140px; height: 140px; }
.site-product-editor .text-button { justify-self: start; cursor: pointer; }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 18px; }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(35,75,61,.05); }
.product-cover { position: relative; display: grid; height: 180px; place-items: center; color: #70817b; background: linear-gradient(145deg, #eaf3ef, #f9fbfa); }
.product-cover::after { content: "千足标准"; color: rgba(7,88,70,.09); font-family: "KaiTi", serif; font-size: 36px; font-weight: 800; }
.product-cover img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 21px; }
.product-meta { display: flex; justify-content: space-between; gap: 12px; }
.product-body h3 { margin: 0; font-size: 19px; }
.product-body p { min-height: 22px; margin: 7px 0 16px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 99px; color: #397561; background: #eaf5f1; font-size: 11px; font-weight: 800; white-space: nowrap; }
.product-info { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 14px 0; border-block: 1px solid #edf2f0; color: #6c7c76; font-size: 12px; }
.product-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; }

.table-panel { overflow: hidden; }
.table-tools { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.table-tools .search-input { max-width: 280px; }
.table-tools select { width: auto; min-width: 170px; }
.table-tools .muted { margin-left: auto; font-size: 13px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid #edf2f0; text-align: left; white-space: nowrap; }
th { color: #71817b; background: #f8fbf9; font-size: 12px; font-weight: 800; }
td { font-size: 13px; }
tbody tr:hover { background: #fbfdfc; }
.code-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 800; letter-spacing: .08em; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 99px; color: #397561; background: #e8f4f0; font-size: 11px; font-weight: 800; }
.status.disabled, .status.risk { color: #9a4d45; background: #f8e9e7; }
.status.repeat { color: #88651e; background: #fbf1d7; }
.table-actions { display: flex; gap: 9px; }
.table-actions button { padding: 0; border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 750; }
.table-actions button.danger { color: var(--red); }

.modal-backdrop { position: fixed; inset: 0; z-index: 49; background: rgba(9,25,20,.58); backdrop-filter: blur(4px); }
.modal { z-index: 50; width: min(610px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.modal::backdrop { background: transparent; }
.modal--large { width: min(1040px, calc(100vw - 28px)); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 21px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-head .eyebrow { font-size: 10px; }
.modal-body { padding: 25px; }
.modal-foot { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: #fff; }
.section-title { margin: 5px 0 18px; font-size: 15px; }
.section-title:not(:first-child) { margin-top: 31px; padding-top: 26px; border-top: 1px solid #e7eeeb; }
.product-image-row { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.product-image-row p { max-width: 300px; font-size: 12px; }
.segmented input { position: absolute; opacity: 0; }
.segmented label { display: grid; width: 210px; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf8; }
.segmented i, .segmented b { padding: 8px 6px; border-radius: 7px; font-style: normal; font-weight: 650; text-align: center; }
.segmented input:not(:checked) + label i, .segmented input:checked + label b { color: #fff; background: var(--green); }
.rich-box { overflow: hidden; border: 1px solid #d7e2de; border-radius: 11px; }
.rich-toolbar { display: flex; gap: 3px; padding: 8px; border-bottom: 1px solid #e3ebe8; background: #f8faf9; }
.rich-toolbar button { min-width: 34px; height: 31px; padding: 0 9px; border: 0; border-radius: 6px; color: #687872; background: transparent; font-size: 12px; }
.rich-toolbar button:hover { color: var(--green); background: #e5f1ed; }
.rich-editor { min-height: 150px; padding: 17px; outline: none; line-height: 1.7; }
.rich-editor:empty::before { content: attr(data-placeholder); color: #a5b0ac; }
.rich-editor img, .rich-editor video { display: block; max-width: 100%; max-height: 380px; margin: 12px auto; border-radius: 9px; }
.form-stack { display: grid; gap: 19px; }
.notice { padding: 15px; border: 1px solid #d6e8e1; border-radius: 11px; background: #edf6f3; }
.notice b { color: var(--green); }
.notice p { margin: 5px 0 0; color: #6c7d77; font-size: 12px; line-height: 1.6; }
.qr-preview { display: grid; place-items: center; text-align: center; }
.qr-preview > img { width: min(310px, 75vw); border: 1px solid var(--line); border-radius: 14px; }
.qr-preview > strong { margin-top: 14px; font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: .12em; }
.url-box { display: flex; width: 100%; align-items: center; gap: 10px; margin-top: 17px; padding: 11px 13px; border-radius: 9px; background: #f2f6f4; }
.url-box span { overflow: hidden; flex: 1; color: #70817b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.qr-modal .modal-foot .button--danger { margin-right: auto; }
.toast { position: fixed; z-index: 100; right: 25px; bottom: 25px; max-width: 360px; padding: 13px 17px; border-radius: 10px; color: #fff; background: #173e34; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #9e4242; }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .site-image-grid, .site-product-editor { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .mobile-brand { display: flex; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; z-index: 30; width: 244px; transform: translateX(-100%); transition: .25s; }
  .sidebar.open { transform: translateX(0); box-shadow: 18px 0 50px rgba(0,0,0,.2); }
  .menu-button { display: grid; }
  .topbar { justify-content: flex-start; gap: 14px; }
  .topbar-actions { margin-left: auto; }
  .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .login-card { padding: 30px 24px; border: 0; box-shadow: none; }
  .topbar { min-height: 72px; padding: 12px 15px; }
  .topbar .eyebrow, .topbar-actions .button { display: none; }
  .topbar h1 { font-size: 19px; }
  .content { padding: 22px 14px 60px; }
  .hero-panel { display: grid; padding: 28px 23px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card:last-child { grid-column: 1 / -1; }
  .page-intro { display: grid; }
  .action-row { width: 100%; }
  .action-row .button { flex: 1; }
  .product-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: repeat(2, 1fr); }
  .field--wide { grid-column: auto; }
  .logo-upload, .product-image-row { align-items: flex-start; flex-direction: column; }
  .site-image-slot, .site-product-editor article { grid-template-columns: 1fr; }
  .site-image-slot .image-preview, .site-product-editor .image-preview { grid-row: auto; width: 100%; height: 180px; }
  .table-tools { align-items: stretch; flex-direction: column; }
  .table-tools .search-input, .table-tools select { width: 100%; max-width: none; }
  .table-tools .muted { margin-left: 0; }
  .modal-body { padding: 20px 17px; }
  .modal-head { padding: 17px; }
  .modal-foot { padding: 13px 17px; flex-wrap: wrap; }
  .qr-modal .modal-foot .button--danger { width: 100%; margin-right: 0; }
}
