/* ==========================================================================
   广旻询盘后台
   ========================================================================== */
:root {
  --brand: #0b5ea8;
  --brand-2: #0d74c4;
  --teal: #12b3ab;
  --accent: #f26a21;
  --ink: #0f1e2e;
  --text: #334155;
  --muted: #6b7c92;
  --line: #e3eaf2;
  --bg: #f3f7fb;
  --sidebar: #072b47;
  --font: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.35; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

.adm-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: var(--sidebar); color: rgba(255,255,255,.7);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  padding: 22px 16px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-brand img { width: 40px; height: 36px; border-radius: 6px; }
.side-brand strong { display: block; color: #fff; font-size: 15px; letter-spacing: .02em; }
.side-brand span { font-size: 11px; color: rgba(255,255,255,.45); }
.side-nav { margin-top: 20px; display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px;
  font-size: 14px; color: rgba(255,255,255,.68); transition: all .15s;
}
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: rgba(13,116,196,.28); color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.side-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12.5px; }
.side-foot .who { display: flex; align-items: center; gap: 8px; color: #fff; margin-bottom: 10px; }
.side-foot .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #052338; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.side-foot a { color: rgba(255,255,255,.55); }
.side-foot a:hover { color: #fff; }

.adm-main { flex: 1; min-width: 0; padding: 26px 32px 60px; }
.adm-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.adm-top h1 { font-size: 22px; letter-spacing: -.01em; }
.adm-top .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.adm-top .view-site { font-size: 13px; color: var(--brand); border: 1px solid #d8e6f4; background: #fff; padding: 8px 14px; border-radius: 8px; }

.flash { padding: 11px 16px; border-radius: 9px; margin-bottom: 16px; font-size: 13.5px; }
.flash-ok { background: #e8f7ee; color: #1a7f45; border: 1px solid #c9ebd7; }
.flash-err { background: #fdeeee; color: #b93838; border: 1px solid #f5d3d3; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 3px rgba(9,40,70,.03); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15.5px; }
.card-head .hint { color: var(--muted); font-size: 12px; }
.card-body { padding: 22px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: #f0f7fe; }
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat .value { font-size: 32px; font-weight: 700; color: var(--ink); letter-spacing: -.03em; margin: 6px 0 2px; line-height: 1.1; }
.stat .foot { font-size: 11.5px; color: var(--muted); }
.stat.hot .value { color: var(--accent); }
.stat.ok .value { color: #0e9a6b; }

.dash-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; margin-bottom: 20px; }
.chart { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 8px 6px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 44px; background: linear-gradient(180deg, #2f97e0, #0b5ea8); border-radius: 6px 6px 3px 3px; min-height: 4px; position: relative; transition: height .4s; }
.chart-bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.chart-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th, table.grid td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eef3f8; vertical-align: middle; }
table.grid thead th { background: #f8fbfe; color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .03em; white-space: nowrap; }
table.grid tbody tr:hover { background: #fbfdff; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid .num { color: var(--muted); font-variant-numeric: tabular-nums; }
table.grid .name { font-weight: 600; color: var(--ink); }
table.grid .phone { font-variant-numeric: tabular-nums; color: #334155; }
table.grid .product { color: var(--muted); }
table.grid .actions a { color: var(--brand); font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-pending { background: #fff5e6; color: #b9740a; }
.badge-contacted { background: #eaf4ff; color: #0b5ea8; }
.badge-quoted { background: #f1ecff; color: #6d43c8; }
.badge-won { background: #e7f7ee; color: #15803d; }
.badge-invalid { background: #f1f5f9; color: #64748b; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar input[type="search"], .toolbar input[type="text"], .toolbar select {
  height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; color: var(--text);
}
.toolbar input[type="search"] { width: 240px; }
.toolbar .spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; background: #fff; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text); transition: all .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #0a5396; }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #d95812; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pager .pages { display: flex; gap: 6px; }
.pager a, .pager span { min-width: 30px; height: 30px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .current { background: var(--brand); border-color: var(--brand); color: #fff; }

.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px; border-bottom: 1px solid var(--line); }
.detail-head h2 { font-size: 20px; }
.detail-head .meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; padding: 22px; }
.info-item .k { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.info-item .v { font-size: 14px; color: var(--ink); word-break: break-all; }
.info-item .v a { color: var(--brand); font-weight: 600; }
.message-box { margin: 0 22px 22px; background: #f8fbfe; border: 1px solid #eaf2f9; border-radius: 10px; padding: 16px 18px; font-size: 13.5px; color: #334155; white-space: pre-wrap; }
.sub-block { padding: 20px 22px; border-top: 1px solid var(--line); }
.sub-block h3 { font-size: 14px; margin-bottom: 12px; }

.files { display: flex; flex-direction: column; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fff; }
.file-row .fname { flex: 1; font-size: 13px; color: var(--ink); word-break: break-all; }
.file-row .fsize { font-size: 11.5px; color: var(--muted); }
.file-row a.dl { color: var(--brand); font-size: 12.5px; font-weight: 600; }

.follow-form { display: flex; flex-direction: column; gap: 10px; }
.follow-form textarea { border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; min-height: 84px; resize: vertical; background: #fbfdff; }
.follow-form textarea:focus { outline: 0; border-color: var(--brand); background: #fff; }
.timeline { display: flex; flex-direction: column; gap: 0; margin-top: 16px; }
.tl-item { position: relative; padding: 0 0 18px 22px; border-left: 2px solid #e3edf7; margin-left: 5px; }
.tl-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); border: 2px solid #fff; box-shadow: 0 0 0 2px #d9f2f0; }
.tl-item .tl-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.tl-item .tl-text { font-size: 13.5px; color: #334155; white-space: pre-wrap; }

.side-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 18px; overflow: hidden; }
.side-card .hd { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink); }
.side-card .bd { padding: 16px 18px; }
.side-card select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; margin-bottom: 10px; }
.kv { display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; }
.kv div { display: flex; gap: 8px; }
.kv .k { flex: 0 0 70px; color: var(--muted); }
.kv .v { color: #334155; word-break: break-all; }
.notify-row { display: flex; align-items: flex-start; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.notify-row:last-child { border-bottom: 0; }
.notify-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: #cbd5e1; }
.notify-dot.sent { background: #16a34a; }
.notify-dot.mock { background: #f59e0b; }
.notify-dot.failed { background: #dc2626; }
.notify-dot.skipped { background: #94a3b8; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.settings-grid .full { grid-column: 1 / -1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-row.single { grid-template-columns: 1fr; }
.field label { display: block; font-size: 12.5px; color: #42576c; font-weight: 600; margin-bottom: 5px; }
.field input, .field select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; background: #fbfdff; }
.field input:focus, .field select:focus { outline: 0; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(11,94,168,.08); }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.switch { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #42576c; margin-bottom: 14px; }
.switch input { width: 16px; height: 16px; accent-color: var(--brand); }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(900px 500px at 70% 10%, #0f4b7f, transparent), linear-gradient(115deg, #052741, #0b5ea8); padding: 24px; }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 18px; padding: 38px 34px 32px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.login-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-card .brand img { width: 46px; height: 41px; border-radius: 6px; }
.login-card .brand strong { display: block; font-size: 16px; color: var(--ink); }
.login-card .brand span { font-size: 10.5px; color: var(--muted); letter-spacing: .1em; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { height: 44px; margin-top: 6px; }
.login-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted); }
.login-err { background: #fdeeee; border: 1px solid #f5d3d3; color: #b93838; border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }

/* 产品编辑 */
.field textarea { width: 100%; min-height: 90px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; background: #fbfdff; font-size: 13.5px; line-height: 1.6; resize: vertical; }
.field textarea:focus { outline: 0; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(11, 94, 168, .08); }
.field input[type="file"] { width: auto; height: auto; padding: 0; border: 0; background: none; font-size: 12.5px; color: #42576c; }
.cover-row { display: flex; gap: 16px; align-items: flex-start; }
.cover-preview { width: 120px; height: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; flex: 0 0 auto; }
.spec-head { display: flex; align-items: center; gap: 14px; margin: 20px 0 10px; flex-wrap: wrap; }
.spec-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.spec-edit { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 13px; }
.spec-edit th, .spec-edit td { padding: 8px; border-bottom: 1px solid #eef3f8; vertical-align: middle; }
.spec-edit thead th { background: #f8fbfe; color: #6b7c92; font-weight: 600; font-size: 12px; white-space: nowrap; text-align: left; }
.spec-edit tbody tr:last-child td { border-bottom: 0; }
.spec-edit input:not([type="checkbox"]) { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; background: #fff; font-size: 12.5px; }
.spec-edit input:not([type="checkbox"]):focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(11, 94, 168, .08); }
.spec-edit .s-label { min-width: 130px; }
.spec-edit .s-unit { min-width: 60px; }
.spec-edit .s-val { min-width: 130px; }
.spec-edit .s-del { border: 0; background: none; color: #d33d3d; font-size: 12px; cursor: pointer; padding: 0 4px; white-space: nowrap; }
.spec-edit .s-del:hover { text-decoration: underline; }
.spec-edit input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); }
.gallery-manage { display: flex; flex-wrap: wrap; gap: 12px; }
.gallery-manage-item { display: flex; flex-direction: column; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 12px; color: #6b7c92; }
.gallery-manage-item img { width: 92px; height: 92px; object-fit: contain; background: #fff; }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .detail-grid, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .adm-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex: none; flex-direction: row; align-items: center; padding: 12px 16px; gap: 16px; overflow-x: auto; }
  .side-brand { border: 0; padding: 0; }
  .side-brand span { display: none; }
  .side-nav { flex-direction: row; margin: 0; }
  .side-nav a { white-space: nowrap; padding: 8px 10px; }
  .side-nav a.active { box-shadow: none; }
  .side-foot { display: none; }
  .adm-main { padding: 18px 16px 60px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .toolbar input[type="search"] { width: 100%; }
  .toolbar form { width: 100%; }
}
