/* 和润优选 V2.0 · 品牌视觉基线（延续既有 Demo，不改动正式 Logo/雪小豆） */
:root {
  --paper: #FAF8F4;
  --surface: #FFFFFF;
  --ink: #262320;
  --ink2: #6F6962;
  --brown: #503B2B;
  --gold: #916A44;
  --accent: #963F32;
  --line: #E9E4DD;
  --success: #287454;
  --warn: #9A5C1B;
  --danger: #B33A35;
  --admin-bg: #F5F6F7;
  --admin-ink: #202428;
  --admin-main: #765337;
  --shadow: 0 8px 30px rgba(80, 59, 43, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- H5 ---------- */
.h5-shell { max-width: 430px; margin: 0 auto; min-height: 100vh; background: var(--paper); position: relative; padding-bottom: 76px; }
.h5-top { position: sticky; top: 0; z-index: 20; background: rgba(250,248,244,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.brand-mini { width: 34px; height: 34px; border-radius: 10px; background: var(--brown); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; letter-spacing: -1px; }
.h5-top .titles { flex: 1; min-width: 0; }
.h5-top .t1 { font-weight: 700; font-size: 16px; color: var(--brown); }
.h5-top .t2 { font-size: 11px; color: var(--ink2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-pill { font-size: 11px; padding: 4px 8px; border-radius: 999px; background: #EFE7DC; color: var(--brown); border: 1px solid #E3D7C8; white-space: nowrap; }
.h5-body { padding: 14px 16px 20px; }
.h5-hero { background: linear-gradient(135deg,#5B4331,#8A684A); color: #fff; border-radius: 18px; padding: 18px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.h5-hero h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: .5px; }
.h5-hero p { margin: 0; font-size: 12px; opacity: .88; }
.h5-hero .bean { position: absolute; right: -10px; bottom: -18px; width: 118px; opacity: .22; }
.searchbar { display: flex; gap: 8px; margin: 14px 0; }
.searchbar input { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
.searchbar input:focus { border-color: var(--gold); }
.category-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: 12px 0 18px; }
.category-row button { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; font-size: 12px; color: var(--brown); }
.category-row button.active { border-color: var(--gold); background: #F5E9DA; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 10px; }
.section-title h2 { margin: 0; font-size: 17px; color: var(--brown); }
.section-title span { font-size: 11px; color: var(--ink2); }
.product-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.product-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.product-card .thumb { height: 120px; background: #EFE7DC; display: grid; place-items: center; color: #A99177; font-size: 12px; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .info { padding: 10px; }
.product-card .name { font-size: 14px; font-weight: 600; min-height: 20px; }
.product-card .meta { font-size: 11px; color: var(--ink2); margin: 4px 0 8px; }
.product-card .price { color: var(--accent); font-size: 18px; font-weight: 700; }
.product-card .price small { font-size: 11px; }
.list-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.list-card h3 { margin: 0 0 6px; font-size: 15px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .muted { color: var(--ink2); }
.status-tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #E8F2EC; color: var(--success); }
.status-tag.warn { background: #F7EBD8; color: var(--warn); }
.status-tag.danger { background: #F8E5E3; color: var(--danger); }
.status-tag.info { background: #EAEFF5; color: #3E5D7A; }
.btn { border: 0; border-radius: 10px; padding: 10px 14px; min-height: 44px; cursor: pointer; background: var(--brown); color: #fff; font-weight: 600; }
.btn.ghost { background: #fff; color: var(--brown); border: 1px solid var(--line); }
.btn.accent { background: var(--accent); }
.btn.sm { min-height: 34px; padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.action-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.action-chip { font-size: 11px; padding: 6px 10px; border-radius: 999px; border: 1px solid #DDD2C5; background: #fff; color: var(--brown); cursor: pointer; }
.action-chip:hover { border-color: var(--gold); background: #F8F1E8; }
.action-chip.reserved { border-style: dashed; color: var(--warn); }
.h5-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; height: 66px; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4,1fr); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.h5-nav a { display: grid; place-items: center; gap: 3px; font-size: 11px; color: var(--ink2); }
.h5-nav a.active { color: var(--brown); font-weight: 700; }
.h5-nav a .ic { font-size: 18px; }

/* ---------- PC ---------- */
.admin-shell { display: flex; min-height: 100vh; background: var(--admin-bg); color: var(--admin-ink); }
.admin-side { width: 220px; background: #4A382A; color: #F3ECE3; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.12); font-weight: 700; }
.admin-side .brand img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; background: #fff; }
.admin-side nav a { display: block; padding: 9px 16px; font-size: 13px; color: #DCCFC1; border-left: 3px solid transparent; }
.admin-side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-side nav a.active { background: rgba(255,255,255,.1); color: #fff; border-left-color: #D9B98F; }
.admin-side nav .group { padding: 14px 16px 5px; font-size: 11px; color: #A89684; letter-spacing: 1px; }
.admin-main { flex: 1; min-width: 0; }
.admin-top { height: 60px; background: #fff; border-bottom: 1px solid #E7E8EA; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 15; }
.admin-top .crumb { font-size: 13px; color: #6A6F75; }
.admin-top .right { display: flex; align-items: center; gap: 10px; }
.admin-top select, .admin-top input { border: 1px solid #DDE0E3; border-radius: 8px; padding: 7px 9px; font-size: 12px; background: #fff; }
.admin-content { padding: 24px; }
.admin-content h1 { margin: 0 0 4px; font-size: 22px; }
.admin-sub { color: #6A6F75; font-size: 12px; margin-bottom: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid #ECEEF0; border-radius: 12px; padding: 16px; box-shadow: 0 2px 10px rgba(32,36,40,.03); }
.stat-card .label { font-size: 12px; color: #6A6F75; }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 6px; color: var(--admin-main); }
.stat-card .hint { font-size: 11px; color: #8A9096; margin-top: 6px; }
.panel { background: #fff; border: 1px solid #ECEEF0; border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(32,36,40,.03); }
.panel h2 { margin: 0 0 12px; font-size: 15px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { border: 1px solid #DDE0E3; border-radius: 8px; padding: 7px 9px; font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: #6A6F75; font-weight: 600; background: #F8F9FA; position: sticky; top: 0; }
th, td { padding: 10px 8px; border-bottom: 1px solid #EEF0F2; vertical-align: middle; }
tr:hover td { background: #FAFAFB; }
.btn-pc { border: 1px solid #D8DCE0; background: #fff; color: #3E454B; border-radius: 7px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.btn-pc.primary { background: var(--admin-main); border-color: var(--admin-main); color: #fff; }
.btn-pc.danger { color: var(--danger); border-color: #E8C9C6; }
.empty { padding: 32px; text-align: center; color: #8A9096; font-size: 13px; }
.error-box { background: #FFF3F1; border: 1px solid #F0D2CE; color: var(--danger); border-radius: 10px; padding: 12px; font-size: 13px; }
.notice { background: #FFF8EA; border: 1px solid #F0DDBB; color: #8A5A19; border-radius: 10px; padding: 10px 12px; font-size: 12px; margin-bottom: 14px; }

/* ---------- 通用浮层 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,18,16,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal { background: #fff; border-radius: 16px; width: min(560px,100%); max-height: 84vh; overflow: auto; padding: 20px; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.modal h3 { margin: 0 0 12px; font-size: 17px; }
.modal label { display: block; font-size: 12px; color: var(--ink2); margin: 10px 0 4px; }
.modal input, .modal select, .modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px; }
.toast { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: 86px; background: rgba(38,35,32,.94); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 12px; max-width: 90%; box-shadow: var(--shadow); }
pre.json { background: #F7F5F1; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 11px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.hidden { display: none !important; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .admin-side { width: 180px; }
}
@media (max-width: 820px) {
  .admin-side { width: 64px; }
  .admin-side nav a, .admin-side .group { display: none; }
  .admin-side .brand span { display: none; }
  .admin-content { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
}
