/* ===== CSS Reset & Variables ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;
    --info: #4285f4;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #9aa0a6;
    --border: #dadce0;
    --bg-primary: #f8f9fa;
    --bg-white: #ffffff;
    --bg-sidebar: #1a1f36;
    --sidebar-text: #a4a9c0;
    --sidebar-active: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
html { font-size: 14px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; }

/* ===== Layout ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar { width: 240px; background: var(--bg-sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: transform 0.3s ease; }
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; gap: 12px; }
.sidebar-logo { width: 36px; height: 36px; background: linear-gradient(135deg, #1a73e8, #34a853); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 16px; }
.sidebar-title { font-size: 15px; font-weight: 600; color: var(--sidebar-active); letter-spacing: 0.5px; }
.sidebar-subtitle { font-size: 11px; color: var(--sidebar-text); opacity: 0.7; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section { padding: 8px 20px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: rgba(164,169,192,0.5); }
.nav-item { display: flex; align-items: center; padding: 10px 20px; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; gap: 12px; font-size: 13.5px; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--sidebar-active); }
.nav-item.active { background: rgba(26,115,232,0.15); color: var(--sidebar-active); border-left-color: var(--primary); }
.nav-item .icon { width: 20px; text-align: center; font-size: 16px; }
.nav-item .badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }

/* ===== Main Content ===== */
.main-content { flex: 1; margin-left: 240px; display: flex; flex-direction: column; }

/* ===== Top Header ===== */
.top-header { background: var(--bg-white); padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-left { display: flex; align-items: center; gap: 16px; }
.header-left h2 { font-size: 18px; font-weight: 600; }
.header-breadcrumb { font-size: 12px; color: var(--text-muted); }
.header-right { display: flex; align-items: center; gap: 20px; }
.env-badge { padding: 4px 10px; border-radius: 999px; background: #fff4e5; color: #b26a00; border: 1px solid #ffd699; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: default; }
.env-badge:hover { background: #ffeacb; }
.header-btn { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-white); cursor: pointer; font-size: 13px; color: var(--text-secondary); transition: border-color 0.2s ease, color 0.2s ease; display: flex; align-items: center; gap: 6px; }
.header-btn:hover { border-color: var(--primary); color: var(--primary); }
.header-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #1a73e8, #34a853); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; cursor: pointer; }

/* ===== Page Content ===== */
.page-content { padding: 24px; flex: 1; }
.page { display: none; }
.page.active { display: block; }

/* ===== Cards ===== */
.card { background: var(--bg-white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ===== Stats Cards ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-white); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: box-shadow 0.2s ease, transform 0.2s ease; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-change { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; }
.stat-icon.blue { background: #e8f0fe; color: var(--primary); }
.stat-icon.green { background: #e6f4ea; color: var(--success); }
.stat-icon.orange { background: #fef7e0; color: #e37400; }
.stat-icon.red { background: #fce8e6; color: var(--danger); }
.stat-icon.purple { background: #f3e8fd; color: #8430ce; }
.stat-icon.teal { background: #e0f5f1; color: #00897b; }
.stat-icon.pink { background: #fde7f0; color: #d01884; }

/* ===== Tables ===== */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table thead { background: var(--bg-primary); }
table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
table tr:hover td { background: var(--primary-light); }
.table-footer { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); }

/* ===== Status Badges ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.badge-success { background: #e6f4ea; color: #137333; }
.badge-warning { background: #fef7e0; color: #b06000; }
.badge-danger { background: #fce8e6; color: #c5221f; }
.badge-info { background: #e8f0fe; color: #174ea6; }
.badge-default { background: #f1f3f4; color: #5f6368; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-input, .form-select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; transition: border-color 0.2s ease, box-shadow 0.2s ease; outline: none; background: var(--bg-white); color: var(--text-primary); }
.form-input:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ===== Toolbar ===== */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.toolbar-left { display: flex; align-items: center; gap: 10px; }
.search-box { position: relative; }
.search-box input { padding-left: 36px; width: 260px; }
.search-box .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.filter-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: var(--bg-white); color: var(--text-primary); outline: none; cursor: pointer; }

/* ===== Charts Placeholder ===== */
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-placeholder { height: 300px; background: var(--bg-primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-muted); border: 1px dashed var(--border); }
.bar-chart-placeholder { height: 300px; display: flex; align-items: flex-end; gap: 12px; padding: 20px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar { width: 100%; border-radius: 4px 4px 0 0; transition: opacity 0.2s ease; cursor: pointer; min-height: 8px; }
.bar:hover { opacity: 0.8; }
.bar-label { font-size: 11px; color: var(--text-muted); }
.bar-value { font-size: 11px; font-weight: 600; color: var(--text-secondary); }

/* ===== Donut Chart ===== */
.donut-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 300px; padding: 20px; }
.donut-svg { width: 160px; height: 160px; }
.donut-legend { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 200; display: none; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: var(--bg-white); border-radius: var(--radius-lg); width: 560px; max-width: 90vw; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { width: 32px; height: 32px; border: none; background: none; font-size: 20px; cursor: pointer; border-radius: 50%; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg-primary); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn { width: 32px; height: 32px; border: 1px solid var(--border); background: var(--bg-white); border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-secondary); transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease; }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-info { font-size: 13px; color: var(--text-muted); }

/* ===== Pay Type Icons ===== */
.pay-type-icon { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.pay-type-icon .dot { width: 6px; height: 6px; border-radius: 50%; }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg-white); }
.timeline-item.done::before { background: var(--success); }
.timeline-time { font-size: 12px; color: var(--text-muted); }
.timeline-text { font-size: 13px; }

/* ===== Tab ===== */
.tab-nav { display: flex; border-bottom: 2px solid var(--border); gap: 0; margin-bottom: 20px; }
.tab-item { padding: 10px 20px; font-size: 14px; cursor: pointer; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color 0.2s ease, border-color 0.2s ease; }
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* ===== Grid Layouts ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ===== Mobile Sidebar Toggle ===== */
.mobile-menu-btn { display: none; width: 36px; height: 36px; border: 1px solid var(--border); background: var(--bg-white); border-radius: var(--radius-sm); cursor: pointer; font-size: 18px; color: var(--text-secondary); align-items: center; justify-content: center; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 99; }

/* ===== Loading Overlay ===== */
.loading-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.85); z-index: 9999; align-items: center; justify-content: center; flex-direction: column; gap: 12px; }
.loading-spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 13px; color: var(--text-secondary); }

/* ===== Toast Notifications ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--bg-white); border-radius: var(--radius-md); padding: 12px 20px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 280px; max-width: 400px; animation: slideIn 0.3s ease; border-left: 4px solid var(--primary); pointer-events: auto; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .toast-icon { font-size: 18px; flex-shrink: 0; }
@keyframes slideIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }

/* ===== Enhanced Responsive ===== */
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } .chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 1024px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .sidebar-overlay.show { display: block; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr; }
    .chart-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-left { flex-wrap: wrap; }
    .search-box input { width: 100%; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .top-header { padding: 0 12px; }
    .page-content { padding: 16px; }
    .modal { width: 95vw; max-height: 90vh; }
    .donut-container { height: auto; }
    .bar-chart-placeholder { height: 200px; }
}
@media (max-width: 480px) {
    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }
    table th, table td { padding: 8px 10px; font-size: 12px; }
    .header-left h2 { font-size: 15px; }
    .btn-group { flex-wrap: wrap; }
}

/* ===== Animations ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page.active { animation: fadeIn 0.3s ease; }
.stat-card { animation: fadeIn 0.3s ease; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

/* ===== Refund Modal specifics ===== */
.amount-display { font-size: 24px; font-weight: 700; color: var(--text-primary); text-align: center; padding: 16px; }
.amount-display .currency { font-size: 14px; color: var(--text-secondary); }

/* ===== Device Status ===== */
.device-status { display: inline-flex; align-items: center; gap: 6px; }
.device-status .pulse { width: 8px; height: 8px; border-radius: 50%; }
.device-status .pulse.online { background: var(--success); animation: pulse 2s infinite; }
.device-status .pulse.offline { background: var(--text-muted); }
.device-status .pulse.error { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== Login Page ===== */
.login-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 500; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a1f36 0%, #1557b0 60%, #1a73e8 100%); padding: 20px; }
.login-box { background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 40px 36px; width: 400px; max-width: 100%; animation: fadeIn 0.4s ease; }
.login-logo { width: 56px; height: 56px; margin: 0 auto 16px; background: linear-gradient(135deg, #1a73e8, #34a853); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; font-weight: 700; }
.login-title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }
.login-error { min-height: 20px; font-size: 12.5px; color: var(--danger); margin-bottom: 8px; }
.login-btn { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.login-tip { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 16px; }

/* ===== ICP 备案（右下角悬挂） ===== */
.icp-footer { position: fixed; right: 16px; bottom: 12px; z-index: 10; margin: 0; padding: 4px 10px; border: none; background: rgba(255,255,255,0.75); border-radius: 6px; }
.icp-footer a { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.icp-footer a:hover { color: var(--text-secondary, #555); text-decoration: underline; }
.app-footer { padding: 10px 24px; text-align: right; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--bg-white); display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.app-footer a { color: var(--text-muted); text-decoration: none; }
.app-footer a:hover { color: var(--text-secondary, #555); text-decoration: underline; }
@media print { .app-footer { display: none !important; } }

/* ===== Print Styles ===== */
@media print {
    .sidebar, .top-header, .modal-overlay, .loading-overlay, .toast-container { display: none !important; }
    .main-content { margin-left: 0; }
    .page-content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ===== Scene Management ===== */
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.scene-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-white); transition: box-shadow 0.2s, transform 0.2s; }
.scene-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.scene-card.disabled { opacity: 0.55; }
.scene-head { display: flex; align-items: center; gap: 10px; }
.scene-icon { font-size: 24px; width: 44px; height: 44px; border-radius: 12px; background: #eef3fb; display: flex; align-items: center; justify-content: center; }
.scene-name { font-weight: 600; font-size: 14px; }
.scene-meta { font-size: 12px; color: var(--text-secondary); display: flex; justify-content: space-between; }
.scene-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.scene-toggle { font-size: 12px; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-white); cursor: pointer; color: var(--text-secondary); }
.scene-toggle.on { background: var(--success); color: #fff; border-color: var(--success); }

/* ===== Nutrition & Structure Bars ===== */
.nutri-row, .struct-row { margin-bottom: 14px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; color: var(--text-secondary); }
.bar-track { height: 10px; border-radius: 6px; background: #f1f3f7; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #1a73e8, #34a853); transition: width 0.6s ease; }
.bar-fill.protein { background: linear-gradient(90deg, #1a73e8, #4285f4); }
.bar-fill.carb { background: linear-gradient(90deg, #f9ab00, #f57c00); }
.bar-fill.fat { background: linear-gradient(90deg, #db4437, #e37400); }
.bar-fill.veg { background: linear-gradient(90deg, #0f9d58, #34a853); }
.consume-tip { font-size: 13px; color: var(--text-secondary); line-height: 1.6; background: #f1f3f7; border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 4px; }
.trend-svg { width: 100%; height: 160px; }
.badge-danger { background: var(--danger); color: #fff; }

/* ===== 校园码 ===== */
.campus-layout { display: grid; grid-template-columns: 1fr 1.15fr; gap: 16px; align-items: start; }
.campus-code-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; background: linear-gradient(135deg, #f3f7ff, #eefdf3); }
.campus-code-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.campus-logo { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #1a73e8, #34a853); color: #fff; font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.campus-code-name { font-size: 16px; font-weight: 600; }
.campus-code-sub { font-size: 12px; color: var(--text-secondary); }
.qr-box { width: 220px; height: 220px; margin: 14px auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.qr-grid { width: 100%; height: 100%; display: block; }
.qr-grid rect:not([fill="#fff"]) { fill: #1a1f36; }
.campus-code-tip { font-size: 12px; color: var(--text-secondary); text-align: center; line-height: 1.6; }

/* ===== 家长端小程序（手机预览） ===== */
.phone-mockup { width: 280px; background: #11151c; border-radius: 32px; padding: 12px; box-shadow: var(--shadow-lg); position: relative; }
.phone-notch { width: 120px; height: 18px; background: #000; border-radius: 0 0 14px 14px; margin: 0 auto 8px; }
.phone-screen { height: 460px; background: var(--bg-primary); border-radius: 22px; overflow-y: auto; padding: 14px; font-size: 13px; }
.phone-tabs { display: flex; margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 6px; }
.phone-tab { flex: 1; text-align: center; font-size: 11px; color: #a4a9c0; cursor: pointer; padding: 4px 0; border-radius: 8px; }
.phone-tab.active { color: #fff; background: rgba(255,255,255,0.08); }

/* ===== 消息通知中心 ===== */
.badge-default { background: var(--bg-primary); color: var(--text-secondary); border: 1px solid var(--border); }
.notify-wechat { color: #07c160; }
.notify-wework { color: #2f7de1; }
.notify-sms { color: #f0883e; }

/* ===== 商户管理（商户分级 + 消费策略） ===== */
.merchant-layout { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.merchant-tree { min-width: 280px; max-width: 360px; flex: 1; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; max-height: 560px; overflow-y: auto; }
.merchant-detail { flex: 2; min-width: 320px; }
.tree-node { padding: 6px 8px; font-size: 13px; border-radius: 6px; }
.tree-root { font-weight: 600; color: var(--text-primary); margin-top: 4px; }
.tree-l2 { color: var(--text-secondary); padding-left: 8px; }
.tree-leaf { color: var(--text-secondary); padding-left: 16px; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tree-leaf:hover { background: var(--primary-light); color: var(--primary); }
.tree-leaf.active { background: var(--primary); color: #fff; }
.form-row2 { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row2 .form-group { flex: 1; min-width: 120px; margin-bottom: 0; }
.qr-inline { width: 150px; height: 150px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: inline-block; }
.qr-inline svg { width: 100%; height: 100%; }
.qr-tip { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

/* ===== 商家助手（移动端收银） ===== */
.assistant-layout { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.assistant-side { flex: 1; min-width: 300px; max-width: 480px; }
.card-title { font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.feat-list { list-style: none; margin-top: 10px; }
.feat-list li { padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; color: var(--text-secondary); }
.ph-cash-amt { font-size: 30px; font-weight: 700; color: var(--primary); text-align: center; margin: 8px 0; }
.ph-child { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ph-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #1a73e8, #34a853); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.ph-child-info { flex: 1; }
.ph-name { font-weight: 600; }
.ph-sub { font-size: 11px; color: var(--text-secondary); }
.ph-balance { background: linear-gradient(135deg, #1a73e8, #34a853); color: #fff; border-radius: var(--radius-md); padding: 16px; text-align: center; margin-bottom: 14px; }
.ph-balance-label { font-size: 12px; opacity: 0.9; }
.ph-balance-value { font-size: 26px; font-weight: 700; }
.ph-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.ph-action { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 4px; text-align: center; font-size: 11px; }
.ph-block { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }
.ph-block-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; }
.ph-big { font-size: 24px; font-weight: 700; }
.ph-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ph-row:last-child { border-bottom: none; }
.ph-row-name { font-weight: 500; }
.ph-row-sub { font-size: 11px; color: var(--text-secondary); }
.ph-row-amt { font-weight: 600; }
.ph-empty { text-align: center; color: var(--text-muted); padding: 24px 0; }

/* ===== API 渠道对接 ===== */
.api-endpoint { background: #1a1f36; color: #e8eaed; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; margin: 10px 0 14px; font-family: monospace; overflow-x: auto; }

/* ===== 访客预约 / 统一身份 / 机具OTA / 经营分析 ===== */
.mini-bar { display: inline-block; vertical-align: middle; width: 90px; height: 8px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.mini-bar-fill { height: 100%; background: linear-gradient(90deg, #1a73e8, #34a853); border-radius: 6px; transition: width 0.4s ease; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid #f0f2f5; }
.rank-row:last-child { border-bottom: none; }
.rank-name { flex: 0 0 170px; font-weight: 600; color: var(--text-primary); }
.rank-bar-wrap { flex: 1; height: 10px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.rank-bar { height: 100%; background: linear-gradient(90deg, #1a73e8, #34a853); border-radius: 6px; transition: width 0.6s ease; }
.rank-val { flex: 0 0 120px; text-align: right; font-weight: 600; color: var(--text-primary); }
