:root {
  --brand: #007AFF;
  --brand-hover: #0068D9;
  --success: #34C759;
  --warning: #FF9500;
  --danger: #FF3B30;
  --text-main: #1D1D1F;
  --text-secondary: #8A8A8F;
  --text-disabled: #C7C7CC;
  --surface: #FFFFFF;
  --surface-muted: #F8F9FA;
  --hover: #F5F5F7;
  --border: #ECECEF;
  --shadow: 0 8px 24px rgba(0,0,0,.04);
  --radius: 12px;
  --font: SF Pro Text, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); color: var(--text-main); background: var(--surface-muted); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 6px 8px 18px; border-bottom: 1px solid var(--border); }
.brand-logo { width: 100%; min-height: 72px; border-radius: 16px; background: transparent; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; padding: 8px 10px; }
.brand-logo img { display: block; height: 56px; width: 100%; max-width: 210px; object-fit: contain; filter: none; }
.brand-logo.logo-missing::after { content: "先锋探店"; color: var(--text-main); font-weight: 700; letter-spacing: .08em; }
.login-logo { max-width: 320px; margin: 0 auto 22px; }
.login-logo img { display: block; height: 92px; width: auto; max-width: 100%; margin: 0 auto; }
.login-logo.logo-missing::after { content: "先锋探店"; color: var(--text-main); font-size: 24px; font-weight: 700; letter-spacing: .08em; }
.brand-title { font-weight: 600; font-size: 15px; white-space: nowrap; }
.brand-subtitle { color: var(--text-secondary); font-size: 12px; margin-top: 2px; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 18px 0; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; color: var(--text-secondary); font-weight: 500; font-size: 14px; transition: .18s ease; }
.nav-item span { width: 18px; text-align: center; font-weight: 300; }
.nav-item:hover { background: var(--hover); color: var(--text-main); }
.nav-item.active { background: var(--hover); color: var(--brand); font-weight: 600; }
.user-panel { border-top: 1px solid var(--border); padding-top: 14px; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--hover); display: flex; align-items: center; justify-content: center; color: var(--brand); font-weight: 600; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 12px; color: var(--text-secondary); }
.logout { color: var(--danger); font-size: 12px; }
.main { flex: 1; padding: 24px 32px 48px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.breadcrumb { color: var(--text-secondary); font-size: 12px; margin-bottom: 4px; }
.topbar h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.clock { color: var(--text-secondary); font-size: 12px; }
.role-pill, .tag { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--hover); padding: 5px 10px; font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.tag.blue { background: rgba(0,122,255,.10); color: var(--brand); }
.tag.green { background: rgba(52,199,89,.12); color: var(--success); }
.tag.orange { background: rgba(255,149,0,.12); color: var(--warning); }
.tag.red { background: rgba(255,59,48,.12); color: var(--danger); }
.toast-wrap { position: fixed; z-index: 9999; top: 18px; left: 50%; transform: translateX(-50%); width: min(420px, 92vw); }
.toast { padding: 12px 16px; border-radius: 12px; margin-bottom: 8px; color: #fff; box-shadow: var(--shadow); font-weight: 600; text-align: center; font-size: 14px; }
.toast.success { background: var(--success); }
.toast.danger { background: var(--danger); }
.toast.warning { background: var(--warning); }
.hero-card { background: var(--surface); border-radius: 20px; padding: 28px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow); margin-bottom: 22px; }
.hero-card h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.hero-card p { margin: 8px 0 0; color: var(--text-secondary); }
.card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card.compact { padding: 18px; }
.card.wide { min-height: 100%; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.card-head h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.card-head a { color: var(--brand); font-size: 13px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stats-grid.small { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; transition: .18s ease; }
.stat-card:hover { transform: translateY(-1px); background: #fff; }
.stat-card small { display: block; color: var(--text-secondary); font-size: 12px; margin-bottom: 8px; }
.stat-card strong { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.stat-card a { color: var(--brand); font-weight: 600; }
.stat-icon { float: right; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--hover); }
.stat-icon.blue { color: var(--brand); }
.stat-icon.green { color: var(--success); }
.stat-icon.orange { color: var(--warning); }
.stat-icon.red { color: var(--danger); }
.two-col, .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.detail-grid { margin-bottom: 20px; }
.detail-header { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.detail-header h2 { margin: 4px 0; font-size: 26px; letter-spacing: -.03em; }
.detail-header p, .detail-kicker, .muted { color: var(--text-secondary); font-size: 13px; }
.detail-actions { display: flex; align-items: flex-start; gap: 10px; }
.apple-list { display: flex; flex-direction: column; gap: 2px; }
.apple-list.compact-list { margin-top: 14px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 10px; border-radius: 10px; transition: .16s ease; }
.list-row:hover { background: var(--hover); }
.list-row strong { display: block; font-size: 14px; }
.list-row small, .data-table small, .timeline small, .list-card small { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 3px; }
.row-right { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 13px; }
.list-card { padding: 14px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.list-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.list-card p { margin: 6px 0; color: var(--text-main); }
.timeline { max-height: 420px; overflow: auto; padding-left: 6px; }
.timeline.tall { max-height: 780px; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 14px; }
.timeline-item > span { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 5px; box-shadow: 0 0 0 4px rgba(0,122,255,.10); }
.timeline-item strong { font-size: 14px; }
.timeline-item p { margin: 5px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.empty { padding: 24px; text-align: center; color: var(--text-secondary); }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; border: 0; border-radius: 10px; cursor: pointer; transition: .18s ease; font-weight: 600; font-size: 13px; white-space: nowrap; }
.btn.primary { color: #fff; background: var(--brand); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ghost { background: var(--hover); color: var(--brand); }
.btn.ghost:hover { background: #ededf0; }
.btn.danger { background: var(--danger); color: white; }
.btn.full { width: 100%; }
.round-action { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--hover); color: var(--brand); font-weight: 600; border: 0; cursor: pointer; text-decoration: none; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.round-action.danger-action { color: var(--danger); background: #fff1f0; }
.round-action.danger-action:hover { background: #ffe1df; }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
.grid-form.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: span 4; }
.right { text-align: right; justify-self: end; }
label { display: block; color: var(--text-secondary); font-size: 12px; margin-bottom: 6px; }
input, select, textarea { width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 10px 12px; min-height: 38px; outline: none; color: var(--text-main); transition: .16s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,122,255,.08); }
textarea.rich { min-height: 220px; line-height: 1.7; }
.sop-view { min-height: 180px; padding: 14px; border-radius: 12px; background: var(--surface-muted); line-height: 1.7; }
.tip { color: var(--text-secondary); font-size: 12px; margin: 8px 0 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 150px; }
.filter-form { display: grid; grid-template-columns: 2fr repeat(6, 1fr) auto; gap: 10px; }
.hidden { display: none !important; }
.import-box, .batch-box { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--surface-muted); display: flex; align-items: center; gap: 10px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { color: var(--text-secondary); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--hover); }
.data-table strong { display: block; font-weight: 600; }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv span { color: var(--text-secondary); font-size: 13px; }
.kv strong { font-size: 13px; }
.review-form { display: grid; grid-template-columns: 120px 1fr 1fr auto; gap: 8px; margin-top: 10px; }
.login-page, .confirm-body { min-height: 100vh; background: #fff; display: grid; place-items: center; padding: 24px; }
.login-box, .confirm-card { width: min(390px, 94vw); text-align: center; }
.login-box h1, .confirm-card h1 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.login-box p { margin: 6px 0 32px; color: var(--text-secondary); }
.login-form { text-align: left; display: flex; flex-direction: column; gap: 10px; }
.login-form input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding-left: 0; padding-right: 0; height: 44px; }
.login-form input:focus { box-shadow: none; border-bottom-color: var(--brand); }
.login-form button { margin-top: 14px; height: 44px; border-radius: 10px; }
.login-help { color: var(--text-disabled); font-size: 12px; margin-top: 24px; line-height: 1.7; }
.confirm-card { background: #fff; box-shadow: var(--shadow); border-radius: 20px; padding: 26px; text-align: left; }
.confirm-card h1, .confirm-card > .muted { text-align: center; }
.confirm-card .login-logo { margin: 0 auto 18px; max-width: 100px; }
.confirm-card .login-logo img { width: auto; height: auto; max-width: 100%; max-height: 80px; }
.confirm-info { background: var(--surface-muted); padding: 14px; border-radius: 12px; margin: 18px 0; }
.confirm-info div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.confirm-info span { color: var(--text-secondary); }
.confirm-form { display: flex; flex-direction: column; gap: 10px; }
.warning-box { background: rgba(255,149,0,.12); color: #9a5a00; padding: 12px; border-radius: 10px; line-height: 1.6; font-size: 13px; }
.success-box { background: rgba(52,199,89,.12); color: var(--success); padding: 12px; border-radius: 10px; line-height: 1.6; font-size: 13px; }
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } .two-col, .detail-grid { grid-template-columns: 1fr; } .filter-form { grid-template-columns: 1fr 1fr; } .grid-form { grid-template-columns: repeat(2, 1fr); } .span-4 { grid-column: span 2; } }
@media (max-width: 760px) { .app-shell { display: block; } .sidebar { width: 100%; height: auto; position: static; } .main { padding: 18px; } .topbar { display: block; } .grid-form, .grid-form.two, .filter-form, .review-form { grid-template-columns: 1fr; } .span-2, .span-4 { grid-column: span 1; } .stats-grid { grid-template-columns: 1fr; } .detail-header { display: block; } .detail-actions { margin-top: 16px; } }

/* 富文本 SOP 编辑器 */
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #E5E5EA;
  border-radius: 12px 12px 0 0;
  background: #F8F9FA;
}
.rich-toolbar button,
.rich-toolbar select,
.rich-toolbar input[type="color"] {
  min-height: 32px;
  border: 1px solid #E5E5EA;
  border-radius: 8px;
  background: #fff;
  padding: 4px 10px;
  font-size: 13px;
}
.rich-editor {
  min-height: 220px;
  padding: 16px;
  border: 1px solid #E5E5EA;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #fff;
  outline: none;
  line-height: 1.8;
}
.rich-editor:focus { border-color: #007AFF; }
.rich-editor img, .sop-view img { max-width: 100%; border-radius: 12px; }
.rich-editor video, .sop-view video { max-width: 100%; border-radius: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-10 { margin-bottom: 10px; }
.note-box {
  margin: 10px 0;
  padding: 10px 12px;
  background: #F8F9FA;
  border-radius: 10px;
  color: #1D1D1F;
  font-size: 13px;
}
.btn.danger {
  background: #FF3B30;
  color: #fff;
  border-color: #FF3B30;
}
.btn.danger:hover { background: #E12D24; }
.small-btn { padding: 6px 10px; font-size: 12px; }
.mini-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #F1F1F4; }
