:root {
  --ink: #243c39;
  --muted: #6c7b76;
  --paper: #f5f6f2;
  --line: #dfe5df;
  --green: #176653;
  --green-dark: #0c493d;
  --soft: #e8f1e9;
  --amber: #916315;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.6 "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: var(--green); text-decoration: none; }
button, input, select { font: inherit; }
button, .button { border: 1px solid #cad4cd; background: #fff; color: var(--ink); border-radius: 6px; padding: 9px 17px; cursor: pointer; white-space: nowrap; transition: background .15s; }
button:hover { background: #f0f5ef; }
button:disabled { opacity: .5; cursor: wait; }
button.primary { background: var(--green); color: white; border-color: var(--green); }
button.primary:hover { background: var(--green-dark); }
button.danger { border-color: #d8b8ad; color: #a14532; }
button.danger:hover { background: #fff2ee; }
button.text-button { border: none; background: transparent; color: var(--muted); }
input, select { width: 100%; border: 1px solid #ccd6ce; border-radius: 5px; background: #fff; color: var(--ink); padding: 10px 12px; min-height: 42px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid #70a18d; outline-offset: 2px; }
label { display: block; font-weight: 500; font-size: 13px; margin: 20px 0 7px; }
input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--green); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; letter-spacing: -.7px; line-height: 1.35; margin-bottom: 8px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
h3 { font-size: 16px; margin-bottom: 5px; }
.muted, .field-hint { color: var(--muted); }
.field-hint { font-size: 12px; margin: 7px 0 0; line-height: 1.8; }
.eyebrow { font-size: 11px; letter-spacing: 2px; color: var(--green); margin-bottom: 10px; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 214px; background: #eaf0e8; border-right: 1px solid #dce4db; padding: 32px 24px; display: flex; flex-direction: column; }
.brand { display: flex; gap: 11px; align-items: center; font-size: 16px; font-weight: 600; color: var(--green-dark); }
.brand small { display: block; font: 9px/1.5 Georgia, serif; letter-spacing: 2.4px; margin-top: 3px; }
.brand-mark { width: 36px; height: 39px; display: grid; place-items: center; border-radius: 9px 9px 2px 9px; color: #fff; background: var(--green); font: italic 32px/1 Georgia, serif; }
.nav-label { font-size: 10px; letter-spacing: 1.5px; color: #7b8b7d; margin: 54px 0 17px; }
.nav-group { font-size: 13px; margin: 0 12px 8px; font-weight: 600; }
nav { display: grid; gap: 4px; }
nav a { padding: 11px 16px; color: #526b60; border-radius: 6px; }
nav a[aria-current] { color: var(--green-dark); background: #d7e5d7; font-weight: 600; box-shadow: inset 3px 0 var(--green); }
.sidebar-foot { margin-top: auto; color: #78897a; font-size: 11px; }
.sidebar-foot small { display: block; margin: 7px 0 0 14px; font-size: 10px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #5c967a; margin-right: 6px; }
.workspace { margin-left: 214px; }
.topbar { height: 68px; padding: 0 36px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); font-size: 12px; background: #fbfcf9; color: #64766b; }
.divider { color: #acb7ae; padding: 0 14px; }
.workspace main { padding: 34px 36px 60px; max-width: 1720px; margin: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-heading p:last-child { margin-bottom: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 27px; }
.config-grid { display: grid; grid-template-columns: minmax(300px, 1.2fr) minmax(280px, 1fr); gap: 24px; align-items: start; max-width: 1200px; }
.section-heading { display: flex; gap: 13px; border-bottom: 1px solid #edf0eb; padding-bottom: 20px; margin-bottom: 7px; }
.section-heading p { font-size: 12px; margin-bottom: 0; }
.section-number { font: 22px/1.3 Georgia, serif; color: #8ca492; }
.required { color: #b46739; }
.form-separator { border-top: 1px dashed var(--line); margin: 25px 0 20px; }
.check-label { display: flex; align-items: center; gap: 10px; }
.subtle { font-size: 12px; color: var(--muted); }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 26px; }
.next-run { font-size: 12px; margin: 16px 0 0; color: var(--muted); }
.next-run strong { color: var(--ink); font-weight: 500; margin-left: 9px; }
.badge { font-size: 12px; border: 1px solid #ccddd0; border-radius: 20px; background: var(--soft); padding: 5px 14px; color: var(--green); white-space: nowrap; }
.connection-art { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 30px 0 25px; }
.connection-art span { display: grid; place-items: center; height: 50px; width: 50px; border: 1px solid #cad8ce; border-radius: 12px; font: 30px Georgia, serif; background: #f5f8f3; }
.connection-art span:last-child { font: 20px "PingFang SC", sans-serif; }
.connection-art i { letter-spacing: 2px; font-style: normal; color: #b6c9b8; }
.status-list { margin: 0 0 26px; }
.status-list div { display: flex; justify-content: space-between; border-bottom: 1px solid #edf0eb; padding: 12px 0; font-size: 13px; gap: 20px; }
dt { color: var(--muted); }
dd { margin: 0; }
.button-row { display: flex; align-items: center; gap: 10px; }
.run-message { background: #f4f7f1; padding: 13px 15px; font-size: 12px; margin: 20px 0 12px; border-left: 2px solid #a7c2a7; overflow-wrap: anywhere; }
.scope-warning { font-size: 12px; color: var(--amber); margin-top: 18px; }
.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)) 2fr; gap: 25px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; margin-bottom: 25px; }
.summary-strip div { display: grid; gap: 4px; font-size: 12px; }
.summary-strip strong { font-size: 13px; font-weight: 500; }
.summary-strip p { align-self: center; margin: 0; font-size: 12px; color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 16px; margin-bottom: 24px; padding: 20px 24px; }
.filters label { margin-top: 0; font-size: 12px; }
.filters input { padding: 8px 10px; font-size: 12px; }
.filter-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: end; flex-wrap: wrap; gap: 9px; }
.filter-actions button { padding: 8px 12px; font-size: 12px; }
.data-card { padding: 0; overflow: hidden; }
.table-title { padding: 19px 24px; display: flex; justify-content: space-between; gap: 15px; align-items: center; }
.table-title h2 { font-size: 15px; margin: 0; }
.count { padding: 2px 8px; border-radius: 4px; background: var(--soft); font-size: 11px; color: var(--green); margin-left: 7px; font-weight: 500; }
.table-scroll { overflow: auto; max-height: 65vh; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 12px; }
.sales-table { --batch-width: 190px; --order-width: 165px; --online-width: 165px; --shop-width: 140px; --status-width: 130px; --pay-width: 180px; width: max-content; min-width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.sales-table :is(th, td) { width: 155px; min-width: 155px; max-width: 155px; }
.sales-table :is(th, td):nth-child(1) { width: var(--batch-width); min-width: var(--batch-width); max-width: var(--batch-width); left: 0; }
.sales-table :is(th, td):nth-child(2) { width: var(--order-width); min-width: var(--order-width); max-width: var(--order-width); left: var(--batch-width); }
.sales-table :is(th, td):nth-child(3) { width: var(--online-width); min-width: var(--online-width); max-width: var(--online-width); left: calc(var(--batch-width) + var(--order-width)); }
.sales-table :is(th, td):nth-child(4) { width: var(--shop-width); min-width: var(--shop-width); max-width: var(--shop-width); left: calc(var(--batch-width) + var(--order-width) + var(--online-width)); }
.sales-table :is(th, td):nth-child(5) { width: var(--status-width); min-width: var(--status-width); max-width: var(--status-width); left: calc(var(--batch-width) + var(--order-width) + var(--online-width) + var(--shop-width)); }
.sales-table :is(th, td):nth-child(6) { width: var(--pay-width); min-width: var(--pay-width); max-width: var(--pay-width); left: calc(var(--batch-width) + var(--order-width) + var(--online-width) + var(--shop-width) + var(--status-width)); box-shadow: 2px 0 0 #d8e0d7; }
.sales-table :is(th, td):nth-child(16) { width: 250px; min-width: 250px; max-width: 250px; }
.sales-table :is(th, td):nth-child(19) { width: 260px; min-width: 260px; max-width: 260px; }
.sales-table :is(th, td):nth-child(20) { width: 220px; min-width: 220px; max-width: 220px; }
.sales-table :is(th, td):nth-child(-n+6) { position: sticky; z-index: 2; background: #fff; }
.sales-table thead th:nth-child(-n+6) { z-index: 4; background: #f1f5ef; }
th { background: #f1f5ef; color: #637568; padding: 12px 15px; white-space: nowrap; font-weight: 500; position: sticky; top: 0; z-index: 1; }
td { padding: 15px; border-bottom: 1px solid #edf0eb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.long-text { white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; }
tr:hover td { background: #fafcf8; }
.sales-table tr:hover td:nth-child(-n+6) { background: #fafcf8; }
.empty-state { text-align: center; padding: 55px 20px 65px; color: var(--muted); font-size: 12px; }
.empty-state h3 { color: var(--ink); }
.empty-symbol { display: inline-block; font: 42px Georgia, serif; margin-bottom: 10px; color: #9bb29d; }
.pagination { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: 15px 24px; font-size: 12px; }
.pagination label { margin: 0; white-space: nowrap; }
.pagination select { width: 65px; padding: 5px 8px; min-height: 34px; }
.pagination button { padding: 5px 10px; font-size: 12px; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 30px; max-width: calc(100vw - 32px); width: 440px; color: var(--ink); box-shadow: 0 25px 90px #102c3233; }
dialog::backdrop { background: #173b355e; backdrop-filter: blur(2px); }
.notice { position: fixed; z-index: 30; right: 28px; bottom: 28px; background: var(--green-dark); color: #fff; border-radius: 7px; padding: 13px 21px; max-width: min(480px, 90vw); font-size: 13px; box-shadow: 0 8px 24px #15352b26; }
.notice.error { background: #824733; }
[hidden] { display: none !important; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: 47% 53%; }
.login-intro { background: #1e4a3f; color: #f0f3e8; padding: 45px 55px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-intro::after { content: ""; width: 480px; height: 480px; border: 1px solid #ffffff12; border-radius: 50%; position: absolute; bottom: -190px; right: -100px; box-shadow: 0 0 0 70px #ffffff04, 0 0 0 140px #ffffff03; pointer-events: none; }
.light { color: #ecf0e5; }
.light .brand-mark { background: #7caa87; color: #163f32; }
.login-statement { margin: auto 0; padding: 65px 0; position: relative; z-index: 1; }
.login-statement h1 { font-family: "Songti SC", "STSong", serif; font-size: clamp(40px, 5vw, 69px); line-height: 1.5; letter-spacing: 3px; font-weight: 400; margin: 24px 0; }
.login-statement p { color: #b6cabe; line-height: 2; }
.login-statement .eyebrow { color: #a9c8a8; }
.intro-foot { font: 10px Georgia, serif; letter-spacing: 3px; color: #99b3a1; margin: 0; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-form { width: min(100%, 345px); }
.login-form h2 { font-size: 28px; margin: 0 0 10px; }
.login-form .muted { margin-bottom: 34px; }
.full { width: 100%; display: flex; justify-content: space-between; margin-top: 30px; }
@media (max-width: 1050px) {
  .sidebar { width: 180px; padding: 26px 16px; }
  .workspace { margin-left: 180px; }
  .workspace main { padding: 25px 22px; }
  .topbar { padding: 0 22px; }
  .config-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
  .summary-strip { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .summary-strip p { grid-column: 1 / -1; }
}
@media (max-width: 1200px) {
  .sales-table :is(th, td):nth-child(6) { box-shadow: none; }
  .sales-table :is(th, td):nth-child(1) { box-shadow: 2px 0 0 #d8e0d7; }
  .sales-table :is(th, td):nth-child(n+2):nth-child(-n+6) { left: auto; }
  .sales-table tbody td:nth-child(n+2):nth-child(-n+6) { position: static; }
  .sales-table thead th:nth-child(n+2):nth-child(-n+6) { z-index: 1; }
}
@media (max-width: 650px) {
  .sidebar { position: relative; width: 100%; padding: 15px 20px; border-bottom: 1px solid var(--line); }
  .sidebar .brand { font-size: 14px; }
  .nav-label, .nav-group, .sidebar-foot { display: none; }
  nav { display: flex; margin-top: 18px; }
  nav a { padding: 7px 13px; }
  .workspace { margin-left: 0; }
  .topbar { height: 49px; }
  .workspace main { padding: 23px 16px; }
  .page-heading { flex-wrap: wrap; }
  h1 { font-size: 26px; }
  .card { padding: 20px; }
  .data-card { padding: 0; }
  .filters { gap: 12px; }
  .summary-strip { gap: 12px; }
  .login-layout { display: block; }
  .login-intro { padding: 25px; min-height: 280px; }
  .login-statement { padding: 28px 0 0; }
  .login-statement h1 { font-size: 35px; line-height: 1.25; margin: 12px 0; }
  .login-statement h1 br { display: none; }
  .login-statement p:not(.eyebrow), .intro-foot { display: none; }
  .login-panel { padding: 38px 25px; }
  .pagination { gap: 10px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
