/* Shoujia 后台 */
:root { --ink: #171916; --paper: #fff8ea; --yellow: #ffd83d; --coral: #ff604b; --cyan: #54d4de; --green: #25d366; --blue: #3557d7; --line: #e6dfcf; --muted: #6b6a62; }
*, *::before, *::after { box-sizing: border-box; }
body.admin { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; color: var(--ink); background: #f6f1e6; }
body.admin--bare { display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, p, ul { margin: 0; }
.ic { width: 1em; height: 1em; vertical-align: -0.15em; flex: none; }
.ic-14 { width: 14px; height: 14px; } .ic-16 { width: 16px; height: 16px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.block { display: block; margin-top: 8px; }
.inline { display: inline; }

.admin-side { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 20px 14px; background: var(--ink); color: #fff; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; font-weight: 900; color: #fff; letter-spacing: -0.02em; }
.admin-brand--big { padding: 0 0 20px; color: var(--ink); font-size: 18px; }
.admin-brand__tile { display: grid; place-items: center; width: 30px; height: 30px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--coral); color: var(--ink); box-shadow: 2px 2px 0 rgba(0,0,0,.35); }
.admin-brand--big .admin-brand__tile { box-shadow: 2px 2px 0 var(--ink); }
.admin-nav { display: grid; gap: 4px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: rgba(255,255,255,.75); font-weight: 600; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.admin-nav a.is-active { background: var(--yellow); color: var(--ink); }
.admin-side__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; font-size: 12px; color: rgba(255,255,255,.6); }
.admin-link { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.admin-link:hover { text-decoration: underline; }
.admin-link.danger { color: #c8362a; }
.admin-main { padding: 28px 32px 60px; min-width: 0; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head__actions { display: flex; gap: 8px; }
.page-title { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 20px; }
.page-head .page-title { margin-bottom: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs a { padding: 6px 12px; border-radius: 999px; font-weight: 600; color: var(--ink); }
.tabs a.is-active { background: var(--ink); color: #fff; }
.tabs .count { opacity: .6; font-size: 12px; }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); white-space: nowrap; }
.btn:hover { text-decoration: none; transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.btn--primary { background: var(--yellow); }
.btn--wa { background: var(--green); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn--block { width: 100%; justify-content: center; margin-top: 8px; }

.alert { padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 6px; margin-bottom: 18px; font-weight: 600; }
.alert--ok { background: #dff9e6; }
.alert--err { background: #ffe1dc; }
.empty { padding: 28px; border: 1.5px dashed #cdc4b0; border-radius: 8px; color: var(--muted); text-align: center; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1.5px solid var(--ink); border-radius: 8px; background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.stat__label { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat__value { font-size: 30px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; }
.stat__sub { font-size: 12px; color: var(--muted); }
.stat a { font-size: 12px; font-weight: 700; }

.two-col { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 1100px) { .two-col { grid-template-columns: 1fr 1fr; } }
.panel { padding: 20px; border: 1.5px solid var(--ink); border-radius: 8px; background: #fff; box-shadow: 3px 3px 0 var(--ink); margin-bottom: 20px; }
.panel h2 { font-size: 15px; font-weight: 900; margin-bottom: 14px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel__head h2 { margin: 0; }
.panel--sticky { position: sticky; top: 20px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 8px 10px; border-bottom: 1.5px solid var(--ink); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; }
.table .actions > * { margin-right: 10px; }
.table--stores { background: #fff; border: 1.5px solid var(--ink); border-radius: 8px; box-shadow: 3px 3px 0 var(--ink); overflow: hidden; }
.table--stores th, .table--stores td { padding: 12px 14px; }
.table--daily .bars { width: 40%; }
.bar { display: block; height: 6px; margin: 2px 0; border-radius: 3px; background: var(--cyan); }
.bar[style="width:0%"] { display: none; }
.bar--wa { background: var(--green); }

.tag { display: inline-block; white-space: nowrap; padding: 2px 8px; border: 1px solid var(--ink); border-radius: 999px; font-size: 11px; font-weight: 700; background: #fff; }
.tag--new { background: var(--yellow); } .tag--contacted { background: var(--cyan); } .tag--converted, .tag--published { background: var(--green); } .tag--rejected { background: #eee; color: var(--muted); } .tag--draft { background: #f3eee1; }

.cards { display: grid; gap: 12px; }
.app-card { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; padding: 16px 18px; border: 1.5px solid var(--ink); border-radius: 8px; background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.app-card__main { flex: 1 1 360px; min-width: 0; }
.app-card__title { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.app-card__meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.app-card__contact { margin-top: 10px; }
.app-card__note { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--yellow); background: #fffaea; font-size: 13px; }
.app-card__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.app-card__actions select, select, input[type=text], input[type=url], input[type=password], input[type=tel], input[type=email], input[type=number], input[type=file], textarea { font: inherit; }

.f { display: block; margin-bottom: 14px; }
.f > span { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 800; }
.f input[type=text], .f input[type=url], .f input[type=password], .f input[type=tel], .f input[type=email], .f input[type=number], .f select, .f textarea { width: 100%; padding: 9px 11px; border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; font-size: 14px; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 3px solid rgba(53,87,215,.3); }
.f textarea { resize: vertical; }
.f small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.f--error input, .f--error select { border-color: #c8362a; }
.f__error { margin-top: 4px; font-size: 12px; font-weight: 700; color: #c8362a; }
.f-row { display: grid; gap: 14px; }
@media (min-width: 720px) { .f-row { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 1100px) { .form-grid { grid-template-columns: 1fr 300px; } }
.cover-row { display: grid; gap: 16px; }
@media (min-width: 720px) { .cover-row { grid-template-columns: 220px 1fr; } }
.cover-preview { width: 220px; height: 165px; object-fit: cover; border: 1.5px solid var(--ink); border-radius: 6px; }
.cover-preview--empty { display: grid; place-items: center; font-size: 12px; color: var(--muted); background: #f3eee1; }
.items { display: grid; gap: 8px; margin-bottom: 10px; }
.item-row { display: grid; grid-template-columns: 1.3fr 1.5fr .7fr .7fr auto; gap: 8px; align-items: center; }
.item-row input, .item-row select { width: 100%; padding: 8px 10px; border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; font-size: 13px; }
@media (max-width: 719px) { .item-row { grid-template-columns: 1fr 1fr; } }
.side-label { margin: 14px 0 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.side-url { width: 100%; padding: 8px 10px; border: 1.5px solid var(--ink); border-radius: 6px; background: #fffaea; }
.side-links { display: grid; gap: 4px; }
.qr { display: block; border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.login__card { width: min(100%, 380px); padding: 32px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; box-shadow: 5px 5px 0 var(--ink); }
.login__card .btn { width: 100%; justify-content: center; height: 42px; margin-top: 6px; }

@media (max-width: 760px) {
  body.admin { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px; }
  .admin-brand { padding: 0 8px 0 0; }
  .admin-nav { display: flex; flex-wrap: wrap; }
  .admin-nav a { padding: 6px 10px; }
  .admin-side__foot { margin-left: auto; }
  .admin-main { padding: 18px 16px 50px; }
}

/* ---- merchant portal / i18n additions ---- */
.admin--merchant .admin-nav a.is-active { background: var(--green); }
.admin-side__foot--col { flex-direction: column; align-items: stretch; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a, .lang-float a { padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.7); }
.lang-switch a.is-active { background: rgba(255,255,255,.18); color: #fff; }
.lang-float { position: fixed; top: 14px; right: 16px; display: flex; gap: 4px; z-index: 5; }
.lang-float a { color: var(--muted); border: 1px solid transparent; }
.lang-float a.is-active { background: #fff; color: var(--ink); border-color: var(--ink); }
.login__card--wide { width: min(100%, 560px); }
.login__links { margin-top: 14px; font-size: 13px; text-align: center; }
.btn--google { width: 100%; justify-content: center; height: 42px; background: #fff; }
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.small { font-size: 12px; }
.status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 18px; border: 1.5px solid var(--ink); border-radius: 8px; background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.status-bar--ok { background: #e6fbe9; } .status-bar--warn { background: #fff3cc; } .status-bar--err { background: #ffe1dc; }
.tag--ok { background: var(--green); } .tag--warn { background: var(--yellow); } .tag--err { background: #ffb3a8; } .tag--muted { background: #f3eee1; }
.panel--cta { text-align: center; padding: 36px 24px; }
.panel--cta h2 { font-size: 20px; }
.panel--cta p { max-width: 520px; margin: 8px auto 18px; }
.steps { padding-left: 20px; margin: 0; display: grid; gap: 10px; font-size: 14px; }
.steps li.done { color: var(--muted); text-decoration: line-through; }
.steps li a { text-decoration: none; margin-left: 6px; font-weight: 700; }
.feature-list { display: grid; gap: 8px; margin-bottom: 12px; }
.feature-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.feature-list li em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); }
.feature-list li.on em { color: #0a7a3a; font-weight: 700; }
.dotc { width: 10px; height: 10px; border-radius: 999px; background: #d9d2c0; }
.feature-list li.on .dotc { background: var(--green); }
.feature-toggles { display: grid; gap: 10px; margin: 0 0 14px; }
.feature-toggles .check { align-items: flex-start; }
.feature-toggles .check span { display: block; font-size: 12px; }
.review-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 18px; border: 1.5px solid var(--ink); border-radius: 8px; background: #fff3cc; box-shadow: 3px 3px 0 var(--ink); }
.review-bar__form { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.review-bar__form input[type=text] { padding: 6px 10px; border: 1.5px solid var(--ink); border-radius: 6px; min-width: 220px; }
.stat__link { font-size: 14px; font-weight: 700; word-break: break-all; }
textarea.side-url { resize: vertical; font-size: 12px; }
th { text-align: left; }

.alert--warn { background: #fff3cc; }
.f > span.input-with-btn { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; margin: 0; font-size: inherit; font-weight: inherit; }
.f .input-with-btn input[type=email] { width: 100%; }
.f .input-with-btn .btn { height: 30px; padding: 0 12px; font-size: 12px; }

/* ---- nav groups (数据 / 系统) ---- */
.admin-nav__group { display: block; margin: 14px 12px 4px; font-family: var(--mono, ui-monospace, monospace); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.admin-nav__group:first-child { margin-top: 4px; }

/* ---- charts (App\Core\Chart) ---- */
.ch { display: block; }
.ch-spark { display: inline-block; vertical-align: middle; }
.ch-hbar { display: inline-block; width: 100%; max-width: 160px; height: 8px; border: 1px solid var(--ink); border-radius: 3px; background: #fff; vertical-align: middle; overflow: hidden; }
.ch-hbar__fill { display: block; height: 100%; }
