:root {
  --bg: #f7f3ed;
  --panel: #fffaf4;
  --ink: #362d25;
  --muted: #948673;
  --line: #eadfce;
  --brand: #6a4e36;
  --brand-dark: #523a28;
  --ok: #6a4e36;
  --warn: #e6a23c;
  --danger: #f56c6c;
  --radius: 4px;
  --shadow: 0 6px 22px rgba(92, 70, 47, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei",
    "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(circle at 94% 0%, rgba(183,146,82,.08), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
small { color: var(--muted); }

/* ---------- 版面 ---------- */
.topbar {
  height: 56px; padding: 0 20px; background: #fff;
  border-bottom: 1px solid #e4e7ed;
  display: flex; align-items: center; gap: 18px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-toggle {
  width: 28px; height: 28px; padding: 0; flex: none;
  border: 0; background: transparent; color: #606266;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.topbar-toggle:hover { color: var(--brand); }
.topbar-logo {
  width: 26px; height: 26px; flex: none; border-radius: 4px;
  background: linear-gradient(145deg, #c8a25f, #8c6b38); color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); text-decoration: none; }
.crumb-sep { color: #c0c4cc; }
.crumb-current { color: #303133; }
.topbar-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 28px;
  font-size: 13px; color: #606266; white-space: nowrap;
}
.top-item { display: flex; align-items: center; gap: 6px; }
.top-icon { color: #909399; font-size: 14px; filter: grayscale(1); opacity: .7; }
.top-status { display: flex; align-items: center; gap: 6px; color: var(--brand); font-size: 12px; }
.top-status i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none;
}
.top-status-time { color: var(--muted); margin-left: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; }
.store-menu { position: relative; }
.store-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 4px; color: #303133; font-size: 13px;
}
.store-menu summary::-webkit-details-marker { display: none; }
.store-menu summary:hover { background: #f5f7fa; }
.store-menu .chev { color: #909399; font-size: 12px; transition: transform .15s; }
.store-menu[open] .chev { transform: rotate(180deg); }
.store-menu-body {
  position: absolute; right: 0; top: 38px; min-width: 168px; z-index: 60;
  background: #fff; border: 1px solid #ebeef5; border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08); padding: 6px;
}
.store-menu-body a {
  display: block; padding: 8px 10px; border-radius: 3px;
  color: #606266; font-size: 13px;
}
.store-menu-body a:hover { background: #f5f7fa; color: var(--brand); text-decoration: none; }

.layout { display: flex; min-height: calc(100vh - 56px); }

.sidebar {
  width: 200px; flex: 0 0 200px;
  background: #ffffff; color: #606266;
  display: flex; flex-direction: column;
  position: sticky; top: 56px; height: calc(100vh - 56px);
  border-right: 1px solid #e4e7ed;
  transition: width .2s ease, flex-basis .2s ease;
}
.nav { flex: 1; overflow-y: auto; padding: 6px 0; }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 18px; margin: 0;
  color: #606266; font-size: 14px;
}
.nav a:hover { background: #f5f7fa; color: var(--brand); text-decoration: none; }
.nav a.active { background: #f4ecdf; color: var(--brand); font-weight: 500; }
.nav-icon {
  width: 18px; flex: none; text-align: center; font-size: 14px;
  filter: grayscale(1); opacity: .62;
}
.nav a.active .nav-icon { filter: none; opacity: 1; }
.nav-group { margin-top: 0; }
.nav-group:first-child { margin-top: 0; }
.nav-group-label {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 500; font-family: inherit;
  color: #303133; padding: 11px 18px;
  background: none; border: 0; cursor: pointer;
}
.nav-group-label:hover { color: var(--brand); background: #fafafa; }
.nav-group.has-active > .nav-group-label { color: var(--brand); }
.nav-group-title { display: flex; align-items: center; gap: 8px; }
.nav-group-icon { font-size: 14px; filter: grayscale(1); opacity: .55; }
.nav-group.has-active .nav-group-icon { filter: none; opacity: 1; }
.nav-group-label .chev { font-size: 12px; transition: transform .15s ease; }
.nav-group.open .nav-group-label .chev { transform: rotate(180deg); }
.nav-group-body { display: none; }
.nav-group.open .nav-group-body { display: block; }
.layout.collapsed .nav-group-body { display: block; }
.layout.collapsed .nav-group { margin-top: 0; }
.sidebar-foot {
  border-top: 1px solid #ebeef5; padding: 12px 14px;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
}
.who { display: flex; gap: 9px; align-items: center; min-width: 0; }
.who-text { min-width: 0; }
.who strong { color: #303133; font-size: 13px; display: block; }
.who small { color: #909399; font-size: 11px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #f4ecdf; color: var(--brand); display: grid; place-items: center;
  font-size: 14px; flex: none;
}
.foot-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  font-size: 12px;
}
.foot-actions a { color: #909399; }
.foot-actions a:hover { color: var(--brand); }

.main { flex: 1; min-width: 0; }
.page-body { padding: 20px 24px 60px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-head h1 { font-size: 20px; font-weight: 500; letter-spacing: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 收起侧栏：只留图标，让内容区更宽 */
.layout.collapsed .sidebar { width: 60px; flex-basis: 60px; }
.layout.collapsed .nav-group-label,
.layout.collapsed .nav-text,
.layout.collapsed .who-text,
.layout.collapsed .foot-actions { display: none; }
.layout.collapsed .nav { padding: 6px 0; }
.layout.collapsed .nav a { justify-content: center; padding: 12px 0; }
.layout.collapsed .nav-icon { font-size: 16px; }
.layout.collapsed .sidebar-foot { padding: 10px 6px; align-items: center; }
.layout.collapsed .who { justify-content: center; }

/* ---------- 元件 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }

.donut-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut {
  width: 148px; height: 148px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
}
.donut-hole {
  width: 96px; height: 96px; border-radius: 50%; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-hole strong { font-size: 16px; line-height: 1.2; }
.donut-hole small { color: var(--muted); font-size: 11px; }
.legend { flex: 1; min-width: 140px; }
.legend-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid #f5f7fa; font-size: 13px;
}
.legend-row:last-child { border-bottom: 0; }
.legend-row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.legend-row span { flex: 1; color: #606266; }
.legend-row strong { font-weight: 500; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.rank-name { width: 52px; flex: none; font-size: 13px; }
.rank-bar { flex: 1; height: 8px; background: #f0f2f5; border-radius: 4px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: #d4b982; border-radius: 4px; }
.rank-value { width: 82px; text-align: right; font-size: 13px; font-weight: 500; }

/* ---------- 护理房间 ---------- */
.room-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px;
}
.room-card {
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.room-card.room-off { opacity: .6; }
.room-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.room-head strong { display: block; font-size: 16px; font-weight: 500; }
.room-head small { color: var(--muted); font-size: 12px; }
.room-meta { font-size: 13px; color: #606266; }
.room-meta strong { color: var(--ink); font-size: 18px; }
.room-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

.tag-picks { display: flex; gap: 10px; flex-wrap: wrap; }
.tag-pick { cursor: pointer; }
.tag-pick input { display: none; }
.tag-pick span {
  display: inline-block; padding: 5px 12px; border: 1px solid #dcdfe6;
  border-radius: 999px; font-size: 12px; background: #fff;
}
.tag-pick input:checked + span { background: #f4ecdf; font-weight: 500; }

.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat .sub { color: var(--muted); font-size: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tbody tr:hover { background: #fafbfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.table-wrap { overflow-x: auto; }
.table-wrap table { width: max-content; min-width: 100%; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #eef1f7; color: #5b6478;
  white-space: nowrap;
}
.badge.ok { background: #f1e7d6; color: var(--ok); }
.badge.warn { background: #fdf1dc; color: #b9740a; }
.badge.danger { background: #fdeaee; color: var(--danger); }
.badge.info { background: #e7edfd; color: var(--brand); }
.badge.muted { background: #eef1f7; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 14px; cursor: pointer;
  font-family: inherit; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f5f7fb; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { background: #fff; border-color: #f3c2ca; color: var(--danger); }
.btn-danger:hover { background: #fdeaee; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #128a61; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
label.field { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
label.field > span { display: block; margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14px; font-family: inherit;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(157, 122, 63, .16);
}
textarea { min-height: 84px; resize: vertical; }
.form-row { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; }
legend { font-size: 13px; color: var(--muted); font-weight: 700; padding: 0 6px; }

.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar input, .toolbar select { width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; }
.filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-row input { min-width: 240px; }
.inline-edit { display: flex; gap: 6px; align-items: center; }
.inline-edit input { min-width: 0; width: 150px; }
.category-add-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.category-add-form select { width: 180px; min-width: 0; }
.category-add-form input[name="name"] { min-width: 220px; width: 280px; }
.category-add-form input[name="sort"] { width: 90px; min-width: 0; }
.categories-table .btn { white-space: nowrap; }
.categories-table td:last-child { min-width: 136px; text-align: right; }
.status-tabs {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 5px; margin-bottom: 14px;
}
.status-tabs a {
  padding: 6px 14px; border-radius: 7px; color: #667085; font-size: 13px;
}
.status-tabs a:hover { background: #faf4eb; color: var(--brand); text-decoration: none; }
.status-tabs a.active { background: #f1e7d6; color: #6a4e36; font-weight: 600; }

/* ---------- 设置中心 ---------- */
.settings-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 5px; margin-bottom: 14px;
}
.settings-tabs a {
  padding: 7px 16px; border-radius: 3px; color: #606266; font-size: 13px;
}
.settings-tabs a:hover { background: #f5f7fa; color: var(--brand); text-decoration: none; }
.settings-tabs a.active { background: #f4ecdf; color: var(--brand); font-weight: 500; }
.settings-list > div {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #f5f7fa; font-size: 13px;
}
.settings-list > div:last-child { border-bottom: 0; }
.settings-list > div > span:first-child { width: 150px; flex: none; color: var(--muted); }
.settings-list strong { flex: 1; font-weight: 500; word-break: break-all; }
.lang-choice { display: flex; gap: 6px; }
.lang-choice a {
  padding: 4px 12px; border: 1px solid var(--line); border-radius: 3px;
  color: #606266; font-size: 12px;
}
.lang-choice a:hover { color: var(--brand); border-color: #d9c6a6; text-decoration: none; }
.lang-choice a.active {
  background: #f4ecdf; color: var(--brand); border-color: #d9c6a6; font-weight: 500;
}
.settings-switches { max-width: 760px; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid #f5f7fa;
}
.switch-row span strong { display: block; font-size: 14px; font-weight: 500; }
.switch-row span small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.switch-row input {
  width: 40px; height: 22px; flex: none; accent-color: var(--brand); cursor: pointer;
}
.banner-config-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px;
}
.banner-config {
  border: 1px solid var(--line); border-radius: 4px; padding: 14px;
}
.banner-config h3 { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.banner-config textarea { min-height: 64px; }
.banner-preview {
  margin-top: 12px; padding: 16px; border-radius: 4px; color: #fff;
  background: linear-gradient(135deg, #604734, #c8af86);
  display: flex; flex-direction: column; gap: 5px;
}
.banner-preview-image {
  width: 100%;
  height: 124px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 8px;
}
.banner-preview small { color: rgba(255,255,255,.7); font-size: 9px; letter-spacing: .12em; }
.banner-preview em { font-style: normal; font-size: 10px; letter-spacing: .12em; opacity: .8; }
.banner-preview strong { white-space: pre-line; font-size: 20px; line-height: 1.3; }
.banner-preview span { font-size: 11px; opacity: .85; }

.permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffaf4;
}

.account-settings {
  display: grid;
  gap: 16px;
}

.account-form-card,
.account-password-card {
  width: 100%;
}

.account-password-card {
  max-width: 760px;
}

.permission-summary-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.permission-summary-row strong {
  min-width: 72px;
  font-size: 14px;
}

.permission-summary-row span {
  color: var(--muted);
  font-size: 13px;
}

.permission-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2b8a5a;
  font: inherit;
  cursor: pointer;
}

.permission-link:hover {
  text-decoration: underline;
}

.muted-link {
  color: var(--muted);
}

body.permission-modal-open {
  overflow: hidden;
}

.permission-modal[hidden] {
  display: none;
}

.permission-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
}

.permission-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 27, 22, .48);
  backdrop-filter: blur(2px);
}

.permission-modal-panel {
  position: relative;
  width: min(1120px, calc(100vw - 40px));
  height: min(760px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(28, 22, 16, .28);
}

.permission-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 26px;
  border-bottom: 1px solid #eee9e3;
}

.permission-modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.permission-modal-x {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8b8177;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.permission-modal-x:hover {
  background: #f5f1ec;
  color: var(--ink);
}

.permission-modal-tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 48px;
  padding: 0 26px;
  border-bottom: 1px solid #eee9e3;
}

.permission-modal-tabs span {
  height: 48px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
}

.permission-modal-tabs span.active {
  border-bottom-color: #2b8a5a;
  color: #23794f;
  font-weight: 600;
}

.permission-modal-body {
  display: grid;
  grid-template-columns: 160px minmax(360px, 1fr) 300px;
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.permission-module-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 14px;
  overflow-y: auto;
  background: #fbfaf8;
  border-right: 1px solid #eee9e3;
}

.permission-module-nav button {
  padding: 10px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #62584f;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.permission-module-nav button:hover {
  background: #f4efe8;
}

.permission-module-nav button.active {
  background: #eef7f1;
  color: #21764d;
  font-weight: 600;
}

.permission-tree {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
}

.permission-tree-tools {
  display: flex;
  gap: 18px;
  padding-bottom: 12px;
}

.permission-tree-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 14px;
  border: 1px solid #e8e2da;
  border-radius: 7px;
}

.permission-tree-group + .permission-tree-group {
  border-top: 1px solid #f0ebe5;
}

.permission-tree-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  color: #4f463e;
  font-weight: 600;
  cursor: pointer;
}

.permission-tree-group-head small {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
}

.permission-tree-children {
  margin-left: 26px;
  padding-bottom: 8px;
}

.permission-tree-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.permission-tree-item:hover {
  background: #f8f3ed;
}

.permission-tree-item span {
  display: grid;
  grid-template-columns: minmax(120px, .4fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.permission-tree-item strong {
  color: #4d443c;
  font-size: 13px;
  font-weight: 500;
}

.permission-tree-item small {
  font-size: 11px;
  line-height: 1.45;
}

.permission-tree input[type="checkbox"] {
  flex: none;
  margin-top: 3px;
  accent-color: #2b8a5a;
}

.permission-tree input:disabled + span,
.permission-tree-group-head input:disabled {
  opacity: .58;
}

.permission-selected {
  min-width: 0;
  min-height: 0;
  padding: 18px 20px;
  overflow: hidden;
  border-left: 1px solid #e8e2da;
  background: #fff;
}

.permission-selected h3 {
  margin: 0;
  padding: 0 0 12px;
  color: #4d443c;
  font-size: 15px;
  border-bottom: 1px solid #f0ebe5;
}

.selected-permission-list {
  height: calc(100% - 42px);
  overflow-y: auto;
  padding-top: 6px;
}

.selected-permission-empty {
  padding: 66px 0;
  color: #aaa198;
  text-align: center;
  font-size: 13px;
}

.selected-permission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 7px 4px;
  border-bottom: 1px solid #f3eee8;
  color: #544a41;
  font-size: 13px;
}

.selected-permission-remove {
  width: 24px;
  height: 24px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #aaa198;
  font-size: 18px;
  cursor: pointer;
}

.selected-permission-remove:hover {
  background: #f8eeeb;
  color: #c45656;
}

.permission-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 12px 26px;
  border-top: 1px solid #eee9e3;
}

.permission-modal-footer > div {
  display: flex;
  gap: 10px;
}

.permission-cancel,
.permission-confirm {
  min-width: 96px;
}

@media (max-width: 900px) {
  .permission-modal {
    padding: 10px;
  }

  .permission-modal-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  .permission-modal-body {
    grid-template-columns: 135px minmax(0, 1fr);
  }

  .permission-selected {
    grid-column: 1 / -1;
    max-height: 190px;
    border-top: 1px solid #e8e2da;
    border-left: 0;
  }

  .selected-permission-empty {
    padding: 24px 0;
  }
}

@media (max-width: 720px) {
  .permission-modal-body {
    grid-template-columns: 1fr;
  }

  .permission-module-nav {
    flex-direction: row;
    padding: 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #eee9e3;
  }

  .permission-module-nav button {
    flex: none;
    white-space: nowrap;
  }

  .permission-tree {
    padding: 12px;
  }

  .permission-selected {
    grid-column: auto;
  }

  .permission-tree-item span {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .permission-modal-footer {
    align-items: flex-end;
  }

  .permission-modal-footer .hint {
    display: none;
  }
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.skill-check {
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffaf4;
}

.skill-check input {
  margin-top: 3px;
}

.skill-check span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.skill-check small {
  color: var(--muted);
  font-size: 12px;
}

.article-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
}

.article-cover {
  width: 68px;
  height: 48px;
  flex: none;
  overflow: hidden;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 700;
  background: linear-gradient(145deg, #f0e2cc, #e0cdb0);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.customer-360-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-bottom: 16px;
  background: #fffaf4;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.customer-360-nav a {
  padding: 6px 11px;
  border-radius: 6px;
  color: #6a5a49;
  font-size: 13px;
}

.customer-360-nav a:hover {
  color: var(--brand);
  background: #f4ecdf;
  text-decoration: none;
}

.customer-info-grid,
.level-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
}

.customer-info-grid > div,
.level-overview > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  background: #fffaf4;
}

.customer-info-grid span,
.level-overview span {
  color: var(--muted);
  font-size: 12px;
}

.customer-info-grid strong,
.level-overview strong {
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form select,
.inline-form input {
  width: auto;
  min-width: 150px;
}

.customer-master-note {
  padding: 12px 14px;
  border-radius: 9px;
  background: #f4ecdf;
}

.customer-master-note p {
  margin: 4px 0 0;
}

.note-timeline {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.note-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffaf4;
}

.note-item.pinned {
  border-color: #d4b982;
  background: #fff8ec;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.note-meta span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.note-content {
  white-space: pre-wrap;
}

.note-item form {
  margin-top: 8px;
}

.customer-analytics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.analytics-card {
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 8px 14px;
  align-items: center;
  padding: 16px 18px;
  background: #fffaf4;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.analytics-card h3 {
  margin: 0;
  font-size: 15px;
}

.analytics-card p {
  margin: 3px 0 0;
  font-size: 12px;
}

.mini-donut {
  grid-row: span 2;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.mini-donut > span {
  width: 58px;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fffaf4;
  font-size: 17px;
  font-weight: 600;
}

.mini-donut small {
  font-size: 9px;
  font-weight: 400;
}

.analytics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: var(--muted);
  font-size: 11px;
}

.analytics-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.analytics-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.customer-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.customer-filter-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.customer-filter-form input,
.customer-filter-form select {
  min-width: 0;
}

.filter-actions {
  display: flex;
  gap: 7px;
}

.customer-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 150px;
}

.customer-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: #eee1ce;
  font-weight: 600;
  overflow: hidden;
}

.customer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.customer-avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.customer-profile-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.customer-profile-heading > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.customer-cell .badge {
  margin-top: 4px;
}

.row-menu {
  position: relative;
  display: inline-block;
  text-align: left;
}

.row-menu summary {
  list-style: none;
  cursor: pointer;
  color: var(--brand);
  font-size: 12px;
}

.row-menu summary::-webkit-details-marker {
  display: none;
}

.row-menu > div {
  position: absolute;
  right: 0;
  top: 22px;
  z-index: 30;
  width: 138px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 6px 18px rgba(92, 70, 47, .12);
}

.row-menu > div a {
  display: block;
  padding: 7px 9px;
  border-radius: 5px;
  color: #5f5042;
  white-space: nowrap;
}

.row-menu > div a:hover {
  color: var(--brand);
  background: #f7f1e8;
  text-decoration: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 34px;
  padding: 6px 10px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #665648;
  font-size: 13px;
}

.pagination a:hover {
  color: var(--brand);
  border-color: #d4b982;
  text-decoration: none;
}

.pagination a.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.pagination .disabled {
  color: #c0bbb4;
  background: #f7f4ef;
}

.pagination .page-summary {
  min-width: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.designer-shell {
  display: grid;
  grid-template-columns: 220px minmax(420px, 1fr) 350px;
  gap: 14px;
  align-items: start;
}

.designer-palette,
.designer-preview-wrap,
.designer-structure {
  background: #fffaf4;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

.designer-palette {
  padding: 14px;
  position: sticky;
  top: 72px;
}

.designer-palette h2,
.designer-structure h2 {
  margin-bottom: 4px;
}

.palette-item {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 10px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.palette-item:hover {
  border-color: #d4b982;
  background: #fff8ec;
}

.palette-item > span {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #f4ecdf;
  color: var(--brand);
  font-weight: 700;
}

.palette-item strong {
  font-size: 13px;
}

.palette-item small {
  color: var(--muted);
  font-size: 10px;
}

.designer-preview-wrap {
  min-height: 760px;
  padding: 12px 16px 20px;
  background: #eee9e1;
}

.designer-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.designer-preview-head strong {
  color: var(--ink);
  font-size: 14px;
}

.phone-frame {
  width: 390px;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border: 8px solid #41372f;
  border-radius: 34px;
  background: #f7f1e8;
  box-shadow: 0 20px 50px rgba(52, 40, 31, .18);
}

.phone-top {
  padding: 13px;
  text-align: center;
  color: #3d3329;
  font-size: 12px;
  font-weight: 600;
  background: #fffaf4;
  border-bottom: 1px solid #eadfce;
}

.phone-content {
  min-height: 650px;
  max-height: 730px;
  overflow-y: auto;
  color: #3d3329;
}

.phone-tabbar {
  display: flex;
  justify-content: space-around;
  padding: 10px 0 12px;
  color: #8f806f;
  font-size: 10px;
  background: #fffaf4;
  border-top: 1px solid #eadfce;
}

.preview-banner {
  position: relative;
  height: 196px;
  overflow: hidden;
  background: #d9c6a6;
}

.preview-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-banner span {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 8px;
  color: #fff;
  background: rgba(62, 47, 34, .38);
  font-size: 8px;
  letter-spacing: 1px;
}

.preview-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin: -12px 10px 0;
  padding: 14px 6px;
  position: relative;
  background: #fffaf4;
  border-radius: 10px;
  text-align: center;
  font-size: 9px;
  box-shadow: 0 7px 18px rgba(80, 60, 40, .08);
}

.preview-editorial,
.preview-section,
.preview-store {
  margin: 10px;
  padding: 18px;
  background: #fffaf4;
  border: 1px solid #eadfce;
  border-radius: 12px;
}

.preview-editorial small,
.preview-section small {
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 1px;
}

.preview-editorial h3,
.preview-section h3 {
  margin: 7px 0;
  font-family: "Songti SC", serif;
  font-size: 20px;
  line-height: 1.35;
}

.preview-editorial p {
  color: #756453;
  font-size: 10px;
  line-height: 1.6;
}

.preview-editorial button {
  margin-right: 5px;
  padding: 6px 10px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 999px;
  font-size: 8px;
}

.preview-editorial button + button {
  color: var(--brand);
  background: #f4ecdf;
}

.preview-two,
.preview-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.preview-two div,
.preview-gallery i {
  height: 86px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e9d9c0, #c9b18b);
  border-radius: 7px;
  color: #79674f;
  font-size: 9px;
}

.preview-gallery {
  grid-template-columns: 1.4fr 1fr 1fr;
}

.preview-store {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 10px;
}

.preview-store b {
  align-self: flex-start;
  padding: 6px 12px;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  font-size: 9px;
}

.preview-member-hero {
  margin: 10px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(145deg, #322920, #674f39);
}

.preview-member-hero span {
  color: #d8bd86;
  font-size: 8px;
  letter-spacing: 1px;
}

.preview-member-hero strong {
  font-family: "Songti SC", serif;
  font-size: 20px;
}

.preview-member-hero p {
  margin: 0;
  color: rgba(255,255,255,.68);
  font-size: 9px;
}

.preview-list-row {
  margin: 10px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: #fffaf4;
  border: 1px solid #eadfce;
  border-radius: 10px;
  font-size: 10px;
}

.preview-list-row span {
  color: #8d7b68;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 10px;
  padding: 14px 6px;
  background: #fffaf4;
  border: 1px solid #eadfce;
  border-radius: 10px;
  text-align: center;
}

.preview-metrics div {
  border-right: 1px solid #eadfce;
}

.preview-metrics div:last-child {
  border-right: 0;
}

.preview-metrics b,
.preview-metrics span {
  display: block;
}

.preview-metrics b {
  font-size: 16px;
}

.preview-metrics span {
  margin-top: 3px;
  color: #958675;
  font-size: 8px;
}

.preview-function-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px;
  padding: 14px;
  background: #fffaf4;
  border: 1px solid #eadfce;
  border-radius: 10px;
}

.preview-function-grid span {
  padding: 12px 4px;
  text-align: center;
  border-radius: 8px;
  background: #f7f1e8;
  font-size: 9px;
}

.designer-structure {
  padding: 14px;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

.designer-save-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.designer-save-head small {
  color: var(--muted);
}

.component-card {
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.component-card summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  list-style: none;
  cursor: pointer;
}

.component-card summary::-webkit-details-marker {
  display: none;
}

.drag-mark {
  color: #aaa098;
}

.component-name {
  flex: 1;
  font-weight: 500;
}

.mini-switch {
  color: var(--muted);
  font-size: 11px;
}

.mini-switch input {
  width: auto;
}

.component-edit {
  padding: 0 12px 12px;
  border-top: 1px solid #f1ece4;
}

.builder-field {
  display: block;
  margin-top: 9px;
}

.builder-field span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.builder-field input,
.builder-field textarea {
  padding: 7px 9px;
  font-size: 12px;
}

.builder-field textarea {
  min-height: 58px;
}

.component-actions {
  display: flex;
  gap: 5px;
  margin-top: 9px;
}

@media (max-width: 1180px) {
  .designer-shell {
    grid-template-columns: 1fr;
  }
  .designer-palette,
  .designer-structure {
    position: static;
    max-height: none;
  }
  .designer-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 6px;
  }
  .designer-palette h2,
  .designer-palette .hint {
    grid-column: 1 / -1;
  }
}

/* ---------- 服务项目 ---------- */
.mini-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.mini-stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.mini-stat span { display: block; color: var(--muted); font-size: 12px; }
.mini-stat strong { display: block; margin-top: 2px; font-size: 22px; letter-spacing: -.02em; }
.svc-cell { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.svc-thumb {
  width: 48px; height: 48px; flex: none; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; font-weight: 700; color: var(--brand);
  background: linear-gradient(135deg, #f4ecdf, #fff8ef);
}
.svc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.svc-preview {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 14px;
  padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #fffaf4; max-width: 460px;
}
.svc-preview img {
  width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex: none;
}
.table-compact th, .table-compact td { padding: 9px 8px; }
.table-compact .svc-cell { min-width: 190px; gap: 10px; }
.table-compact .svc-thumb { width: 42px; height: 42px; }
.table-wrap .service-table { width: 100%; table-layout: fixed; }
.service-table .svc-cell { min-width: 0; }
.service-table .svc-cell > div:last-child { min-width: 0; }
.service-table .svc-cell strong { display: block; line-height: 1.35; }
.service-table .svc-cell small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 营销工具中心 ---------- */
.hub-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 22px 24px; margin-bottom: 22px; border: 1px solid #d9eee6;
  border-radius: 14px;
  background: linear-gradient(120deg, #f2fbf7 0%, #fffaf4 55%, #f8f5ef 100%);
}
.hub-hero h2 { font-size: 20px; margin: 4px 0 6px; }
.hub-hero p { margin: 0; color: var(--muted); font-size: 13px; max-width: 640px; }
.eyebrow {
  font-size: 10px; letter-spacing: .16em; color: var(--brand); font-weight: 700;
}
.hub-label {
  font-size: 12px; font-weight: 700; color: #667085;
  margin: 0 0 10px 2px; letter-spacing: .04em;
}
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.feature-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: inherit; box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease;
}
.feature-card:hover { text-decoration: none; border-color: #bfe8d9; transform: translateY(-1px); }
.feature-icon {
  width: 40px; height: 40px; flex: none; border-radius: 10px;
  display: grid; place-items: center; font-size: 19px;
  background: #edf8f3;
}
.feature-body { flex: 1; min-width: 0; }
.feature-body strong { display: block; font-size: 15px; }
.feature-body small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.feature-metric { text-align: right; white-space: nowrap; }
.feature-metric strong { display: block; font-size: 18px; }
.feature-metric small { color: var(--muted); font-size: 11px; }
.feature-arrow { color: #98a2b3; font-size: 22px; line-height: 1; }

/* ---------- 提示 ---------- */
.flash-stack {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 99; display: flex; flex-direction: column; gap: 8px; width: min(560px, 92vw);
}
.flash {
  padding: 11px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow); animation: drop .25s ease;
}
.flash-ok { background: #f1e7d6; color: #0d7a54; border: 1px solid #b6e8d5; }
.flash-err { background: #fdeaee; color: #b62c41; border: 1px solid #f6c6ce; }
.flash-message { background: #e7edfd; color: var(--brand-dark); border: 1px solid #c9d6fb; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

.empty {
  text-align: center; color: var(--muted); padding: 34px 16px;
  border: 1px dashed var(--line); border-radius: var(--radius); background: #fbfcfe;
}
.empty p { margin: 6px 0 12px; }

/* ---------- 登入 / 公開頁 ---------- */
body.is-public { background: #f7f3ed; }
.public-topbar {
  height: 56px; padding: 0 24px;
  background: #fffaf4; color: var(--ink);
  border-bottom: 1px solid #eadfce;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 20;
}
.public-topbar .brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 500; padding: 0;
}
.public-topbar .brand:hover { color: var(--brand); text-decoration: none; }
.public-topbar .brand-mark {
  width: 28px; height: 28px; border-radius: 4px;
  background: linear-gradient(145deg, #c8a25f, #8c6b38); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.public-topbar nav { display: flex; gap: 18px; }
.public-topbar nav a { color: #606266; font-size: 13px; }
.public-topbar nav a:hover { color: var(--brand); text-decoration: none; }
.public-main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }

.login-shell {
  display: grid; grid-template-columns: 1.08fr .92fr;
  gap: 24px; min-height: calc(100vh - 140px); align-items: stretch;
}
.login-visual {
  position: relative; min-height: 540px; border-radius: 8px; overflow: hidden;
  background: url('/images/store-lounge.jpg') center / cover no-repeat;
}
.login-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(140deg, rgba(54, 39, 27, .86), rgba(78, 58, 41, .2));
}
.login-visual-content {
  position: relative; height: 100%; padding: 48px;
  display: flex; flex-direction: column; justify-content: flex-end; color: #fff;
}
.login-visual-kicker {
  font-size: 10px; letter-spacing: .2em; color: rgba(255,255,255,.7);
  margin-bottom: 14px;
}
.login-visual-content h2 {
  font-size: 34px; line-height: 1.35; font-weight: 500; margin: 0 0 14px;
  font-family: "Songti SC", "STSong", serif;
}
.login-visual-content p {
  max-width: 360px; margin: 0 0 22px; color: rgba(255,255,255,.78);
  font-size: 13px; line-height: 1.8;
}
.login-visual-badge {
  align-self: flex-start; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08);
  font-size: 11px; letter-spacing: .08em;
}
.login-card {
  background: #fffaf4; border: 1px solid var(--line); border-radius: 8px;
  padding: 52px 48px; display: flex; flex-direction: column; justify-content: center;
  box-shadow: var(--shadow);
}
.login-eyebrow { font-size: 10px; letter-spacing: .18em; color: var(--brand); font-weight: 600; }
.login-card h1 { font-size: 28px; font-weight: 500; margin: 8px 0 6px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 0 0 28px; }
.login-form .field { margin-bottom: 18px; }
.login-form input { height: 44px; background: #fbf6ef; }
.login-submit { width: 100%; justify-content: center; height: 44px; font-size: 14px; }
.login-links {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid #f0f2f5;
  font-size: 12px; color: var(--muted);
}
.login-links a { color: var(--brand); }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-visual { min-height: 240px; }
  .login-visual-content { padding: 28px; }
  .login-visual-content h2 { font-size: 26px; }
  .login-visual-content p { display: none; }
  .login-card { padding: 34px 26px; }
}

/* 網店商品 */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.product {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
}
.product .thumb {
  height: 110px; border-radius: 9px; background: linear-gradient(135deg, #eef2ff, #f7f2ff);
  display: grid; place-items: center; font-size: 34px; overflow: hidden;
}
.product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product .pname { font-weight: 700; }
.product .price { font-size: 19px; font-weight: 800; color: var(--brand); }
.product .meta { font-size: 12px; color: var(--muted); }
.qty-input { display: flex; align-items: center; gap: 8px; }
.qty-input input { text-align: center; }
.stock-tag { font-size: 12px; }
.stock-tag.low { color: var(--danger); font-weight: 600; }

.cat-title {
  margin: 26px 0 12px; font-size: 17px; border-left: 4px solid var(--brand);
  padding-left: 10px;
}
.order-bar {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  padding: 14px 20px; display: flex; justify-content: space-between;
  align-items: center; gap: 14px; border-radius: 14px 14px 0 0;
  box-shadow: 0 -6px 22px rgba(23, 37, 84, .09); margin-top: 24px; flex-wrap: wrap;
}

/* 日期導覽 */
.daynav { display: flex; align-items: center; gap: 8px; }
.daynav input { width: auto; }

.item-row { display: grid; grid-template-columns: 2fr 90px 110px 110px 44px; gap: 10px; align-items: end; margin-bottom: 10px; }
.item-row .rm { align-self: end; }
@media (max-width: 720px) {
  .topbar { height: 52px; padding: 0 10px; gap: 8px; }
  .topbar-center, .topbar-logo { display: none; }
  .topbar-right { min-width: 0; }
  .store-menu summary {
    max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .crumb-sep, .crumbs a { display: none; }
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    border-right: 0; border-bottom: 1px solid #e4e7ed;
  }
  .nav { display: flex; flex-wrap: wrap; padding: 8px; overflow: visible; }
  .nav-group { display: contents; }
  .nav-group-label { display: none; }
  .nav-group-body { display: block; }
  .nav a { padding: 7px 10px; font-size: 13px; }
  .nav-text { display: none; }
  .sidebar-foot { display: none; }
  .page-body { padding: 18px 14px 50px; }
  .item-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .topbar-center { display: none; }
}

.lang-switch {
  display: flex;
  gap: 4px;
  margin: 0;
}

.lang-switch a {
  flex: none;
  text-align: center;
  padding: 1px 6px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: #667085;
  text-decoration: none;
}

.lang-switch a.active {
  background: #f1e7d6;
  color: #6a4e36;
  border-color: #bfe8d9;
  font-weight: 600;
}
