:root { --ink:#1d1b18; --muted:#706a62; --paper:#f6f3ed; --card:#fff; --dark:#25221e; --wood:#8a5a34; --line:#ded8cf; --danger:#a43030; --success:#316b4b; }
* { box-sizing: border-box; }
body { margin:0; color:var(--ink); background:var(--paper); font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif; line-height:1.55; }
body.preview-open { overflow:hidden; }
button,input,textarea { font:inherit; }
button,a { touch-action:manipulation; }
a { color:inherit; text-decoration:none; }
:focus-visible { outline:3px solid #b07b4f; outline-offset:3px; }
[hidden] { display:none !important; }
.login-view { min-height:100dvh; display:grid; place-items:center; padding:24px; background:radial-gradient(circle at 80% 15%,#e7d4bc,transparent 35%),#28241f; }
.login-card { width:min(460px,100%); padding:44px; border-radius:26px; background:#fff; box-shadow:0 35px 90px rgba(0,0,0,.25); }
.admin-brand { display:grid; width:fit-content; }
.admin-brand strong { font-size:27px; letter-spacing:-.05em; }
.admin-brand span { font-size:11px; color:var(--muted); letter-spacing:.15em; }
.login-card h1 { margin:15px 0 5px; font-size:42px; letter-spacing:-.05em; }
.muted { color:var(--muted); }
.kicker { margin:34px 0 0; color:var(--wood); text-transform:uppercase; font-size:11px; letter-spacing:.16em; font-weight:800; }
form label { display:grid; gap:8px; color:#46413b; font-size:14px; font-weight:650; }
.login-card form { display:grid; gap:18px; margin-top:30px; }
input,textarea { width:100%; min-height:48px; border:1px solid var(--line); border-radius:11px; padding:11px 13px; background:#fff; color:var(--ink); resize:vertical; }
input:focus,textarea:focus { border-color:var(--wood); box-shadow:0 0 0 3px rgba(138,90,52,.12); outline:0; }
button,.primary,.secondary,.upload-button { min-height:45px; border:0; border-radius:10px; padding:11px 18px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font-weight:750; }
.primary { color:#fff; background:var(--ink); }
.primary:hover { background:#3b352e; }
.secondary { color:var(--ink); background:#eee9e1; }
.back-link { display:inline-block; margin-top:22px; color:var(--muted); font-size:13px; }
.form-message { min-height:20px; margin:0; color:var(--danger); font-size:13px; }
.dashboard { min-height:100dvh; display:grid; grid-template-columns:260px 1fr; }
.sidebar { height:100dvh; position:sticky; top:0; padding:34px 22px; color:#ddd6cc; background:var(--dark); display:flex; flex-direction:column; z-index:20; }
.admin-brand.light strong { color:#fff; }
.admin-brand.light span { color:#a79f95; }
.sidebar nav { display:grid; gap:7px; margin-top:55px; }
.nav-item { min-height:46px; padding:0 15px; border:0; border-radius:9px; color:#aaa39a; background:transparent; text-align:left; cursor:pointer; }
.nav-item:hover,.nav-item.active { color:#fff; background:rgba(255,255,255,.09); }
.sidebar-bottom { margin-top:auto; display:grid; gap:12px; font-size:13px; }
.sidebar-bottom a,.sidebar-bottom button { min-height:44px; display:flex; align-items:center; }
.sidebar-bottom button { justify-content:flex-start; padding:0; color:#aaa39a; background:transparent; }
.workspace { min-width:0; padding:0 42px 110px; }
.admin-header { min-height:112px; display:flex; align-items:center; justify-content:space-between; gap:25px; border-bottom:1px solid var(--line); }
.admin-header p { margin:0; color:var(--muted); font-size:12px; }
.admin-header h1 { margin:0; font-size:30px; letter-spacing:-.04em; }
.admin-actions { display:flex; gap:10px; }
.admin-actions .primary.dirty { background:#9a5e2f; box-shadow:0 0 0 4px rgba(154,94,47,.13); }
.admin-actions .primary.saving { opacity:.65; pointer-events:none; }
.sidebar-toggle { display:none; background:transparent; font-size:24px; }
.notice { margin:22px 0 0; padding:14px 17px; border-radius:10px; }
.notice.warning { color:#7b4c16; background:#fae7c7; }
.toast { position:fixed; z-index:100; right:28px; bottom:28px; padding:14px 20px; border-radius:10px; color:#fff; background:var(--success); box-shadow:0 15px 50px rgba(0,0,0,.2); opacity:0; transform:translateY(15px); pointer-events:none; transition:.25s ease; }
.toast.show { opacity:1; transform:none; }
.toast.error { background:var(--danger); }
.panel { display:none; padding-top:32px; }
.panel.active { display:block; }
.editor-guide { margin-bottom:22px; padding:30px; display:grid; grid-template-columns:.8fr 1.2fr; gap:35px; align-items:end; border:1px solid #d8cdbf; border-radius:20px; background:linear-gradient(125deg,#251f1a,#4b3829); color:#fff; }
.editor-guide .kicker { margin:0; color:#d9b58d; }
.editor-guide h2 { margin:6px 0 9px; font-size:27px; letter-spacing:-.04em; }
.editor-guide p { margin:0; color:#c9c0b7; }
.page-map { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; }
.page-map button { min-height:58px; padding:10px 12px; justify-content:flex-start; gap:9px; color:#ded7ce; border:1px solid rgba(255,255,255,.13); background:rgba(255,255,255,.06); font-size:12px; text-align:left; }
.page-map button:hover { color:#fff; background:rgba(255,255,255,.12); }
.page-map span { color:#d4a979; font:700 11px Georgia,serif; }
.metric-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.metric-grid article,.card { border:1px solid var(--line); border-radius:18px; background:var(--card); }
.metric-grid article { padding:25px; }
.metric-grid span { color:var(--muted); font-size:13px; }
.metric-grid strong { display:block; margin-top:8px; font-size:30px; }
.card { padding:30px; }
.edit-card { position:relative; padding-top:72px; scroll-margin-top:90px; overflow:hidden; }
.edit-card::before { content:"对应官网位置：" attr(data-front-location); position:absolute; inset:0 0 auto; min-height:44px; padding:11px 20px; display:flex; align-items:center; color:#6f543d; background:#f4eadc; border-bottom:1px solid #e6d9c8; font-size:12px; font-weight:700; }
.edit-card::after { content:"↗"; position:absolute; top:11px; right:18px; color:#9b6b43; font-weight:800; }
.panel > .card + .card,.stack > .card + .card { margin-top:20px; }
.getting-started { margin-top:20px; display:flex; justify-content:space-between; gap:30px; align-items:center; background:linear-gradient(110deg,#fff,#f1e5d6); }
.card h2 { margin:4px 0 8px; font-size:25px; letter-spacing:-.035em; }
.card p { color:var(--muted); }
.section-explainer { margin:-10px 0 24px; padding:14px 17px; border-radius:10px; background:#f4f0e9; }
.checklist { margin-top:20px; }
.check-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin-top:20px; color:var(--muted); }
.stack { display:grid; gap:20px; }
.card-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:25px; }
.card-heading .kicker { margin:0; }
.form-grid { display:grid; gap:18px; }
.form-grid.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.form-grid.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.form-grid.four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.navigation-editors { margin-top:18px; }
.stat-editors { margin-top:22px; padding-top:22px; border-top:1px solid var(--line); }
.image-editor { display:grid; gap:12px; }
.image-editor img { width:100%; aspect-ratio:16/10; border-radius:14px; background:#ddd; object-fit:cover; }
.upload-button { width:fit-content; background:#eee9e1; }
small { color:var(--muted); }
.support-editor { padding:18px; border:1px solid var(--line); border-radius:12px; display:grid; gap:12px; }
.support-editor::before { content:"官网服务卡片"; color:var(--wood); font-size:11px; font-weight:800; letter-spacing:.1em; }
.product-list { display:grid; gap:12px; }
.product-row { display:grid; grid-template-columns:84px 1fr auto; gap:18px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:14px; }
.product-row img { width:84px; height:72px; object-fit:cover; border-radius:9px; background:#ddd; }
.product-row h3 { margin:0; font-size:17px; }
.product-row p { margin:4px 0 0; font-size:13px; }
.product-actions { display:flex; gap:7px; }
.product-actions button { min-height:44px; padding:8px 12px; background:#eee9e1; }
.product-actions .danger { color:var(--danger); }
.status { width:fit-content; margin-top:6px; padding:3px 8px; border-radius:999px; color:var(--success); background:#e5f1e9; font-size:11px; }
.status.off { color:#6d6861; background:#eeeae4; }
.narrow { max-width:620px; }
.checkbox { display:flex; align-items:center; gap:10px; }
.checkbox input { width:18px; min-height:18px; }
.pet-checkboxes { display:flex; flex-wrap:wrap; gap:12px; }
.pet-checkbox { min-width:120px; min-height:44px; padding:9px 13px; display:flex; align-items:center; gap:10px; border:1px solid var(--line); border-radius:11px; background:#faf8f4; cursor:pointer; }
.pet-checkbox input { width:20px; min-height:20px; margin:0; }
.pets-error { margin:0; }
dialog { width:min(700px,calc(100% - 30px)); padding:0; border:0; border-radius:20px; box-shadow:0 30px 100px rgba(0,0,0,.3); }
.product-dialog { width:min(1000px,calc(100% - 30px)); max-height:calc(100dvh - 30px); }
dialog::backdrop { background:rgba(29,27,24,.65); backdrop-filter:blur(4px); }
.dialog-form { padding:30px; display:grid; gap:20px; }
.product-dialog .dialog-form { max-height:calc(100dvh - 30px); overflow:auto; }
.dialog-heading { display:flex; justify-content:space-between; align-items:center; }
.dialog-heading h2 { margin:0; }
.dialog-heading button { width:44px; padding:0; font-size:26px; background:#eee9e1; }
.dialog-actions { display:flex; justify-content:flex-end; gap:10px; }
.preview-drawer { position:fixed; z-index:60; inset:0 0 0 auto; width:min(760px,62vw); display:grid; grid-template-rows:70px 1fr; background:#ded8cf; box-shadow:-28px 0 80px rgba(20,16,12,.28); animation:preview-in .3s ease both; }
.preview-drawer[hidden] { display:none; }
@keyframes preview-in { from { transform:translateX(100%); } to { transform:none; } }
.preview-header { padding:0 20px; display:flex; align-items:center; justify-content:space-between; color:#eee8df; background:#221f1b; }
.preview-header > div { display:grid; }
.preview-header span { color:#aaa198; font-size:11px; }
.preview-header button { width:44px; min-height:44px; padding:0; color:#fff; background:rgba(255,255,255,.08); font-size:25px; }
.preview-drawer iframe { width:100%; height:100%; border:0; background:#fff; }
.field-help { color:#8b8176; font-size:11px; font-weight:400; }
.wechat-admin { margin-top:28px; padding-top:26px; border-top:1px solid var(--line); }
.wechat-admin h3 { margin:3px 0; font-size:21px; }
.wechat-admin > div:first-child { margin-bottom:18px; }
.wechat-admin > div:first-child p:last-child { margin:0; }
.story-image-admin { margin-top:28px; padding-top:26px; border-top:1px solid var(--line); }
.story-image-admin h3 { margin:3px 0; font-size:21px; }
.story-image-admin > div:first-child { margin-bottom:18px; }
.story-image-admin > div:first-child p:last-child { margin:0; }
fieldset { min-width:0; margin:0; padding:24px; border:1px solid var(--line); border-radius:14px; display:grid; gap:18px; }
legend { padding:0 8px; color:var(--wood); font-size:12px; font-weight:800; letter-spacing:.1em; }
.repeat-editor { display:grid; gap:12px; }
.repeat-row { padding:15px; display:flex; align-items:end; gap:12px; border:1px solid var(--line); border-radius:12px; background:#faf8f4; }
.repeat-fields { min-width:0; flex:1; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.repeat-actions { display:flex; gap:7px; }
.repeat-actions > button:not(.danger) { min-height:44px; padding:9px 11px; background:#eee9e1; }
.repeat-row .danger { min-height:44px; color:var(--danger); background:#f2e7e2; }
.compact-upload { min-height:44px; padding:9px 12px; }
.add-repeat { width:fit-content; }
.checkbox-stack { display:grid; align-content:center; gap:14px; }
.product-preview-link { width:fit-content; }
.product-statuses { display:flex; flex-wrap:wrap; gap:6px; }
.detail-status { color:#725636; background:#f3e7d6; }
.product-actions a { min-height:44px; padding:8px 12px; display:inline-flex; align-items:center; border-radius:10px; background:#eee9e1; font-weight:750; }

@media (max-width:900px) {
  .dashboard { grid-template-columns:1fr; }
  .sidebar { position:fixed; inset:0 auto 0 0; width:260px; transform:translateX(-100%); transition:transform .25s ease; }
  .sidebar.open { transform:none; }
  .workspace { padding-inline:20px; }
  .sidebar-toggle { display:inline-flex; }
  .admin-header { position:sticky; top:0; z-index:10; background:rgba(246,243,237,.94); backdrop-filter:blur(15px); }
  .admin-header > div:first-of-type { margin-right:auto; }
  .admin-actions .secondary { display:none; }
  .admin-actions .preview-button { display:inline-flex; }
  .editor-guide { grid-template-columns:1fr; }
  .preview-drawer { width:100%; }
}
@media (max-width:650px) {
  .login-card { padding:30px 23px; }
  .metric-grid,.form-grid.two,.form-grid.three,.form-grid.four,.check-grid { grid-template-columns:1fr; }
  .getting-started { align-items:flex-start; flex-direction:column; }
  .admin-header h1 { font-size:23px; }
  .admin-actions .primary { padding-inline:12px; }
  .product-row { grid-template-columns:70px 1fr; }
  .product-row img { width:70px; height:65px; }
  .product-actions { grid-column:1/-1; }
  .page-map { grid-template-columns:1fr 1fr; }
  .edit-card { padding:66px 20px 24px; }
  .edit-card::before { padding-right:42px; }
  .repeat-row { display:grid; align-items:stretch; }
  .repeat-fields { grid-template-columns:1fr; }
  .repeat-actions { flex-wrap:wrap; }
  fieldset { padding:18px 14px; }
}
