/* ============================================================
   ECOS Design System
   ============================================================ */
:root {
    /* Brand Gradient (蓝紫渐变) */
    --c-primary: #6366f1;
    --c-primary-dark: #4f46e5;
    --c-primary-light: #818cf8;
    --c-purple: #8b5cf6;
    --c-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --c-grad-soft: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(139,92,246,0.14));
    --c-grad-bg: radial-gradient(1200px 600px at 82% -12%, rgba(139,92,246,0.12), transparent 60%),
                 radial-gradient(1000px 520px at -8% 8%, rgba(59,130,246,0.12), transparent 55%),
                 linear-gradient(180deg, #f6f7ff 0%, #eef1fb 100%);
    --c-success: #22c55e;
    --c-warning: #f59e0b;
    --c-danger: #ef4444;
    --c-info: #3b82f6;

    /* Sidebar (浅色玻璃拟态) */
    --c-sidebar-bg: rgba(255,255,255,0.72);
    --c-sidebar-hover: rgba(99,102,241,0.10);
    --c-sidebar-active: #6366f1;
    --c-sidebar-text: #64748b;
    --c-sidebar-text-active: #ffffff;
    --c-sidebar-border: rgba(99,102,241,0.12);

    /* Content (浅色大屏) */
    --c-bg: #eef1fb;
    --c-card: rgba(255,255,255,0.72);
    --c-card-solid: #ffffff;
    --c-text: #1e293b;
    --c-text-light: #64748b;
    --c-border: rgba(99,102,241,0.14);
    --c-border-dark: rgba(99,102,241,0.22);

    /* Dimensions */
    --sidebar-w: 232px;
    --header-h: 56px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --shadow: 0 4px 14px rgba(99,102,241,0.07);
    --shadow-md: 0 12px 32px rgba(99,102,241,0.10);
    --shadow-lg: 0 24px 70px rgba(30,41,59,0.18);
    --glass-blur: blur(14px) saturate(140%);
    --glass-border: 1px solid rgba(255,255,255,0.65);

    /* Typography */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 通用工具类 */
.glass { background: var(--c-card); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.grad-text { background: var(--c-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--c-bg-grad); background-attachment: fixed; color: var(--c-text); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--c-primary); text-decoration: none; }
code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1200px 600px at 82% -10%, rgba(139,92,246,0.20), transparent 60%),
                radial-gradient(1000px 520px at -8% 110%, rgba(59,130,246,0.18), transparent 55%),
                linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #eef6ff 100%);
    position: relative; overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99,102,241,0.12) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(168,85,247,0.10) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,-30px); } }

.login-box {
    position: relative; z-index: 1; background: rgba(255,255,255,0.78); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.7); border-radius: 22px; padding: 38px 34px;
    width: 380px; max-width: 92vw; box-shadow: 0 24px 60px rgba(99,102,241,0.18);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 38px; background: var(--c-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 6px; font-weight: 800; }
.login-logo p { color: #64748b; font-size: 13px; margin-top: 6px; }

.login-tabs { display: flex; gap: 4px; background: rgba(99,102,241,0.08); border-radius: 10px; padding: 4px; margin-bottom: 24px; }
.login-tab { flex: 1; text-align: center; padding: 9px; border-radius: 8px; cursor: pointer; color: #64748b; font-size: 13px; transition: all .2s; }
.login-tab.active { background: var(--c-grad); color: #fff; box-shadow: 0 6px 16px rgba(99,102,241,0.25); }

.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 12px; color: #64748b; margin-bottom: 5px; }
.login-field input { width: 100%; padding: 11px 14px; background: rgba(255,255,255,0.85); border: 1px solid rgba(99,102,241,0.18); border-radius: 10px; color: #1e293b; font-size: 14px; outline: none; transition: border .2s, box-shadow .2s; }
.login-field input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.14); }
.login-field input::placeholder { color: #94a3b8; }
.login-btn { width: 100%; padding: 12px; background: var(--c-grad); color: #fff; border: none; border-radius: 10px; font-size: 15px; cursor: pointer; font-weight: 600; transition: filter .2s, box-shadow .2s; box-shadow: 0 8px 22px rgba(99,102,241,0.28); }
.login-btn:hover { filter: brightness(1.05); box-shadow: 0 10px 26px rgba(99,102,241,0.34); }
.login-error { color: var(--c-danger); font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px; }
.login-footer { text-align: center; margin-top: 20px; font-size: 12px; color: #64748b; }
.login-download { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.download-link { color: var(--c-primary); text-decoration: none; font-size: 13px; font-weight: 600; }
.download-link:hover { text-decoration: underline; }
.download-tip { font-size: 11px; color: #64748b; }

/* ============================================================
   App Shell
   ============================================================ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar (浅色玻璃拟态) */
.sidebar { width: var(--sidebar-w); background: var(--c-sidebar-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-right: var(--glass-border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { height: var(--header-h); display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--c-sidebar-border); }
.sidebar-header .brand { font-size: 20px; font-weight: 800; background: var(--c-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 3px; }
.sidebar-header .ver { font-size: 10px; color: #64748b; margin-left: 8px; padding: 2px 6px; background: rgba(99,102,241,0.10); border-radius: 4px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-section-title { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; padding: 16px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--c-sidebar-text); font-size: 13px; transition: all .15s; margin-bottom: 4px; }
.nav-item:hover { background: var(--c-sidebar-hover); color: #4338ca; }
.nav-item.active { background: var(--c-grad); color: var(--c-sidebar-text-active); font-weight: 600; box-shadow: 0 6px 16px rgba(99,102,241,0.28); }
.nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.nav-item .badge { margin-left: auto; font-size: 10px; padding: 1px 7px; border-radius: 10px; background: var(--c-danger); color: #fff; }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--c-sidebar-border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--c-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px rgba(99,102,241,0.25); }
.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .info .name { font-size: 13px; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .info .role { font-size: 11px; color: #64748b; }
.sidebar-user .logout { color: #64748b; cursor: pointer; padding: 6px; border-radius: 4px; transition: all .15s; }
.sidebar-user .logout:hover { color: var(--c-danger); background: rgba(239,68,68,0.10); }

/* Main Area */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-header { height: var(--header-h); background: rgba(255,255,255,0.7); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: var(--glass-border); display: flex; align-items: center; padding: 0 22px; gap: 12px; position: sticky; top: 0; z-index: 50; }
.main-header .breadcrumb { font-size: 13px; color: var(--c-text-light); }
.main-header .breadcrumb span { color: var(--c-text); font-weight: 600; }
.main-header .header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.main-content { flex: 1; overflow-y: auto; padding: 22px 26px; }

/* ============================================================
   Components
   ============================================================ */

/* Cards */
.card { background: var(--c-card); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; margin-bottom: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--c-text); }

/* Stat Cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--c-card); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .stat-label { font-size: 12px; color: var(--c-text-light); margin-bottom: 6px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--c-text); letter-spacing: -0.5px; line-height: 1.15; }
.stat-card .stat-icon { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.stat-card.accent-indigo .stat-icon { background: #eef2ff; color: var(--c-primary); }
.stat-card.accent-green .stat-icon { background: #f0fdf4; color: var(--c-success); }
.stat-card.accent-amber .stat-icon { background: #fffbeb; color: var(--c-warning); }
.stat-card.accent-blue .stat-icon { background: #eff6ff; color: var(--c-info); }
.stat-card.accent-red .stat-icon { background: #fef2f2; color: var(--c-danger); }
.stat-card.accent-purple .stat-icon { background: #faf5ff; color: #a855f7; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.pdd-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th { background: rgba(99,102,241,0.08); padding: 10px 14px; text-align: left; font-weight: 600; color: #475569; border-bottom: 1px solid var(--c-border); white-space: nowrap; font-size: 12px; }
table.data-table td { padding: 10px 14px; border-bottom: 1px solid rgba(99,102,241,0.08); color: var(--c-text); }
table.data-table tr:hover td { background: rgba(99,102,241,0.04); }
table.data-table tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 11px; border-radius: 20px; font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge-success { background: rgba(22,163,74,0.14); color: #15803d; }
.badge-warning { background: rgba(217,119,6,0.14); color: #b45309; }
.badge-danger { background: rgba(220,38,38,0.14); color: #b91c1c; }
.badge-info { background: rgba(37,99,235,0.14); color: #1d4ed8; }
.badge-default { background: rgba(100,116,139,0.16); color: #475569; }
.badge-purple { background: rgba(147,51,234,0.14); color: #7e22ce; }

/* Toggle Switch */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #cbd5e1; border-radius: 22px; transition: .3s; }
.toggle .slider::before { position: absolute; content: ''; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
.toggle input:checked + .slider { background: var(--c-success); }
.toggle input:checked + .slider::before { transform: translateX(18px); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border: none; border-radius: 10px; font-size: 13px; cursor: pointer; font-weight: 500; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--c-grad); color: #fff; box-shadow: 0 6px 16px rgba(99,102,241,0.22); }
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(99,102,241,0.30); }
.btn-success { background: var(--c-success); color: #fff; }
.btn-success:hover { filter: brightness(1.05); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { filter: brightness(1.05); }
.btn-outline { background: rgba(255,255,255,0.6); border: 1px solid var(--c-border-dark); color: var(--c-text); }
.btn-outline:hover { background: rgba(99,102,241,0.08); border-color: var(--c-primary); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 11px 26px; font-size: 14px; border-radius: 12px; }

/* Platform Card */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.platform-card { background: var(--c-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); cursor: pointer; transition: all .2s; border: 2px solid transparent; position: relative; }
.platform-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.platform-card.disabled { opacity: .5; }
.disabled-row { opacity: .4; background: #f8fafc; }
.disabled-row td { color: #94a3b8; }
.platform-card .pl-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.platform-card .pl-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: #fff; }
.platform-card .pl-name { font-size: 15px; font-weight: 600; }
.platform-card .pl-code { font-size: 11px; color: var(--c-text-light); }
.platform-card .pl-stats { display: flex; gap: 16px; font-size: 12px; color: var(--c-text-light); }
.platform-card .pl-stats span strong { color: var(--c-text); font-size: 14px; }
.platform-card .pl-toggle { position: absolute; top: 16px; right: 16px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--c-text); margin-bottom: 6px; font-weight: 500; }
.form-group label .req { color: var(--c-danger); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 8px 12px; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    font-size: 13px; color: var(--c-text); outline: none; transition: border .2s; font-family: var(--font);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--c-primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
body.modal-open { overflow: hidden; }
.modal { background: rgba(255,255,255,0.92); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); border-radius: var(--radius-lg); padding: 26px; width: 800px; max-width: 95vw; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-box { background: rgba(255,255,255,0.92); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); border-radius: var(--radius-lg); padding: 26px; width: 800px; max-width: 95vw; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 17px; font-weight: 600; margin: 0; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--c-text-light); border-radius: 4px; font-size: 22px; }
.modal-close:hover { background: #f1f5f9; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-body .form-group { margin-bottom: 14px; }
.modal-body .form-group label { display: block; font-size: 13px; color: var(--c-text-light); margin-bottom: 4px; }
.modal-body .form-group input, .modal-body .form-group select { width: 100%; padding: 8px 12px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-size: 14px; box-sizing: border-box; }
.modal-body .form-group input:disabled { background: #f1f5f9; color: var(--c-text-light); }

/* Delete Confirm Modal */
.delete-modal { width: 480px; max-width: 90vw; }
.delete-modal .delete-icon { width: 48px; height: 48px; background: #fee2e2; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 24px; color: #dc2626; }
.delete-modal .delete-title { text-align: center; font-size: 18px; font-weight: 600; color: #1e293b; margin-bottom: 8px; }
.delete-modal .delete-subtitle { text-align: center; font-size: 13px; color: #64748b; margin-bottom: 20px; }
.delete-modal .delete-target { background: #f8fafc; border: 1px solid var(--c-border); border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; }
.delete-modal .delete-target .target-name { font-weight: 600; font-size: 15px; color: #1e293b; }
.delete-modal .delete-target .target-id { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.delete-modal .delete-warning { background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 14px; margin-bottom: 20px; font-size: 13px; color: #92400e; display: flex; align-items: flex-start; gap: 8px; }
.delete-modal .delete-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 20px; }
.delete-modal .delete-stat-item { background: #f8fafc; border-radius: 6px; padding: 8px 12px; text-align: center; }
.delete-modal .delete-stat-item .stat-num { font-size: 18px; font-weight: 700; color: #1e293b; }
.delete-modal .delete-stat-item .stat-label { font-size: 11px; color: #64748b; margin-top: 2px; }
.delete-modal .delete-actions { display: flex; gap: 8px; justify-content: flex-end; }
.delete-modal .delete-actions .btn-cancel { background: #f1f5f9; border: 1px solid var(--c-border); color: #475569; padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.delete-modal .delete-actions .btn-cancel:hover { background: #e2e8f0; }
.delete-modal .delete-actions .btn-confirm { background: #dc2626; border: none; color: #fff; padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.delete-modal .delete-actions .btn-confirm:hover { background: #b91c1c; }
.delete-modal .delete-actions .btn-confirm.danger-outline { background: #fff; border: 1px solid #dc2626; color: #dc2626; }
.delete-modal .delete-actions .btn-confirm.danger-outline:hover { background: #fef2f2; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 8px; font-size: 13px; color: #fff; box-shadow: var(--shadow-lg); animation: slideIn .3s ease; transition: opacity .3s ease, transform .3s ease; cursor: pointer; }
.toast.leaving { opacity: 0; transform: translateX(20px); }
.toast-success { background: var(--c-success); }
.toast-error { background: var(--c-danger); }
.toast-info { background: var(--c-info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--c-text-light); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: .3; }
.empty-state .title { font-size: 16px; margin-bottom: 8px; }

/* Filter Bar */
.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.filter-bar select, .filter-bar input { padding: 6px 12px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-size: 13px; }

/* Permission Matrix */
.perm-matrix { width: 100%; border-collapse: collapse; }
.perm-matrix th, .perm-matrix td { padding: 10px; text-align: center; border: 1px solid var(--c-border); font-size: 12px; }
.perm-matrix th { background: #f8fafc; }
.perm-matrix td:first-child { text-align: left; font-weight: 500; }
.perm-checkbox { width: 18px; height: 18px; cursor: pointer; }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--c-text-light); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--c-border); border-top-color: var(--c-primary); border-radius: 50%; animation: spin .6s linear infinite; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Section Title */
.section-title { font-size: 14px; font-weight: 600; color: var(--c-text); margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--c-border); }
.section-title:first-child { margin-top: 0; }

/* Data Isolation Badge */
.iso-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-family: monospace; }
.iso-brand { background: #eef2ff; color: var(--c-primary); }
.iso-platform { background: #f0fdf4; color: var(--c-success); }
.iso-store { background: #fffbeb; color: var(--c-warning); }

/* Responsive */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--c-border); background: #fff; border-radius: 8px; font-size: 18px; cursor: pointer; color: var(--c-text); flex-shrink: 0; }
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1100; }
@media (max-width: 768px) {
    .nav-toggle { display: inline-flex; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 1200;
        transform: translateX(-100%); transition: transform .25s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .nav-backdrop.show { display: block; }
    .main-header { padding: 0 14px; }
    .form-row { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   PDD 拼多多数据分析模块
   ============================================================ */
.pdd-module { display: flex; flex-direction: column; height: 100%; }
.pdd-tabs { display: flex; gap: 2px; background: #f1f5f9; padding: 4px; border-radius: 8px 8px 0 0; flex-wrap: wrap; }
.pdd-tab { padding: 8px 16px; font-size: 13px; color: #64748b; cursor: pointer; border-radius: 6px; transition: all .2s; white-space: nowrap; }
.pdd-tab:hover { background: #e2e8f0; color: #334155; }
.pdd-tab.active { background: #fff; color: #e74c3c; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pdd-tab-icon { margin-right: 4px; font-size: 12px; }
.pdd-content { flex: 1; overflow-y: auto; padding: 20px; background: #f8fafc; }

/* KPI Cards */
.pdd-kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 1200px) { .pdd-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .pdd-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.pdd-kpi-grid .stat-card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.pdd-kpi-grid .stat-label { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.pdd-kpi-grid .stat-value { font-size: 22px; font-weight: 700; color: #1e293b; }
.pdd-kpi-grid .stat-sub { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.accent-teal { border-left: 3px solid #14b8a6; }
.accent-orange { border-left: 3px solid #f97316; }

/* Chart */
.pdd-chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 768px) { .pdd-chart-row { grid-template-columns: 1fr; } }
.pdd-chart-card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.pdd-chart-box { width: 100%; height: 240px; }
.pdd-chart-box svg { width: 100%; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: #cbd5e1; font-size: 14px; }

/* Toolbar */
.pdd-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.pdd-month-select { display: flex; align-items: center; gap: 8px; }
.pdd-month-select label { font-size: 13px; color: #64748b; }
.pdd-month-select select { padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; background: #fff; }

/* Filter Bar */
.pdd-filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.pdd-input { padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; background: #fff; }
.pdd-select { padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; background: #fff; }
.pdd-btn { padding: 6px 16px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; cursor: pointer; background: #fff; color: #334155; transition: all .2s; }
.pdd-btn:hover { background: #f1f5f9; }
.pdd-btn-primary { background: #6366f1; color: #fff; border-color: #6366f1; }
.pdd-btn-primary:hover { background: #4f46e5; }
.pdd-btn-sm { padding: 3px 10px; border: 1px solid #e2e8f0; border-radius: 4px; font-size: 12px; cursor: pointer; background: #fff; color: #475569; }
.pdd-btn-sm:hover { background: #f1f5f9; }
.pdd-btn-sm.pdd-btn-primary { background: #6366f1; color: #fff; border-color: #6366f1; }
.pdd-btn-sm.pdd-btn-primary:hover { background: #4f46e5; }
.pdd-btn-danger { color: #ef4444; border-color: #fecaca; }
.pdd-btn-danger:hover { background: #fef2f2; }

/* Table */
.pdd-section { margin-bottom: 24px; }
.pdd-section-title { font-size: 16px; font-weight: 600; color: #1e293b; margin-bottom: 12px; padding: 8px 12px; background: #f1f5f9; border-radius: 6px; border-left: 4px solid #6366f1; }
.pdd-daily-table th { text-align: center; font-size: 12px; padding: 8px 6px; }
.pdd-daily-table td { text-align: center; font-size: 12px; padding: 6px; white-space: nowrap; }
.pdd-daily-table td:first-child { text-align: left; font-weight: 500; background: #fafafa; }
.pdd-empty-hint { padding: 24px; text-align: center; color: #6b7280; font-size: 13px; background: #f9fafb; border-radius: 8px; margin: 12px 0; }
.pdd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pdd-table th { background: #f8fafc; padding: 10px 12px; text-align: center; font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.pdd-table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; text-align: center; }
.pdd-table tbody tr:hover { background: #f8fafc; }
.pdd-table tfoot tr { background: #f8fafc; font-weight: 600; }
.td-num { text-align: right; font-family: 'Courier New', monospace; font-size: 12px; }
.td-mono { font-family: 'Courier New', monospace; font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-product { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-bold { font-weight: 600; }
.td-empty { text-align: center; padding: 40px 20px; color: #cbd5e1; }

/* Pagination */
.pdd-pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.pdd-pagination .page-info { font-size: 12px; color: #64748b; }

/* Form */
.pdd-form { padding: 8px; }
.pdd-form .form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.pdd-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.pdd-form .form-row { display: contents; }
.pdd-form .form-field { display: flex; flex-direction: column; min-width: 0; }
.pdd-form .pdd-form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-top: 8px; }
.pdd-form input, .pdd-form select, .pdd-form .pdd-input { width: 100%; box-sizing: border-box; }
.pdd-form .form-field label { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.pdd-form-actions { text-align: right; margin-top: 16px; }

/* Import */
.pdd-import { }
.pdd-import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pdd-import-card { display: flex; gap: 12px; padding: 16px; background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; cursor: pointer; transition: all .2s; }
.pdd-import-card:hover { border-color: #6366f1; box-shadow: 0 4px 12px rgba(99,102,241,.1); }
.pdd-import-card.selected { border-color: #6366f1; background: #eef2ff; }
.import-card-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.import-card-body { flex: 1; }
.import-card-title { font-size: 14px; font-weight: 600; color: #1e293b; margin-bottom: 2px; }
.import-card-file { font-size: 12px; color: #6366f1; margin-bottom: 4px; }
.import-card-desc { font-size: 11px; color: #94a3b8; line-height: 1.4; }

.pdd-upload-area { margin-bottom: 20px; }
.pdd-upload-zone { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: all .2s; }
.pdd-upload-zone:hover, .pdd-upload-zone.drag-over { border-color: #6366f1; background: #f5f3ff; }
.upload-icon { font-size: 36px; color: #6366f1; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: #334155; margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: #94a3b8; }

.pdd-parse-result { margin-top: 16px; }
.parse-result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.parse-file { font-size: 14px; font-weight: 600; }
.parse-count { font-size: 13px; color: #16a34a; }
.pdd-preview-table { font-size: 12px; }
.pdd-import-actions { text-align: center; margin-top: 16px; }
.pdd-error { padding: 16px; background: #fef2f2; color: #dc2626; border-radius: 8px; font-size: 13px; text-align: center; }
.pdd-success { padding: 16px; background: #f0fdf4; color: #16a34a; border-radius: 8px; font-size: 14px; text-align: center; }

/* PDD 净利润横幅 */
.pdd-profit-banner { display: flex; align-items: stretch; border-radius: 16px; overflow: hidden; margin-bottom: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.pdd-profit-banner.profit-positive { background: linear-gradient(135deg, #059669, #047857); }
.pdd-profit-banner.profit-negative { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.profit-banner-main { flex: 1; padding: 24px 28px; color: #fff; }
.profit-banner-label { font-size: 13px; opacity: 0.85; margin-bottom: 6px; font-weight: 500; }
.profit-banner-value { font-size: 36px; font-weight: 800; line-height: 1.2; letter-spacing: -1px; }
.profit-banner-sub { font-size: 12px; opacity: 0.8; margin-top: 8px; }
.profit-banner-formula { padding: 20px 24px; background: rgba(0,0,0,0.25); min-width: 280px; display: flex; flex-direction: column; justify-content: center; }
.formula-title { font-size: 11px; color: rgba(255,255,255,0.85); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.formula-text { font-size: 12px; color: rgba(255,255,255,0.95); line-height: 1.6; margin-bottom: 8px; }
.formula-excluded { font-size: 11px; color: rgba(255,255,255,0.75); padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.2); }

/* PDD ROI投产推演表 */
.pdd-roi-page { display: flex; flex-direction: column; gap: 20px; }
.pdd-roi-card { border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.pdd-roi-form { padding: 16px 20px; }
.roi-form-row { display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; align-items: flex-end; }
.roi-form-field { flex: 1; min-width: 140px; }
.roi-form-field label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; font-weight: 500; }
.roi-form-field input { width: 100%; }
.pdd-roi-results { display: flex; flex-wrap: wrap; gap: 1px; background: #e5e7eb; padding: 1px; border-radius: 0 0 12px 12px; }
.roi-result-item { flex: 1; min-width: 120px; background: #fff; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.roi-result-item.highlight { background: #f9fafb; }
.roi-label { font-size: 11px; color: #9ca3af; font-weight: 500; }
.roi-value { font-size: 18px; font-weight: 700; color: #1f2937; }

/* PDD 信息提示横幅 */
.pdd-info-banner { padding: 10px 16px; background: #eff6ff; color: #3b82f6; border-radius: 8px; font-size: 13px; margin-bottom: 16px; border: 1px solid #bfdbfe; }

/* v3.9.15: 未匹配SKU横幅 */
.pdd-unmatched-banner {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #fef3c7; border: 1px solid #f59e0b;
    border-radius: 8px; margin-bottom: 12px;
}
.pdd-unmatched-banner button { white-space: nowrap; }

/* v3.9.15: 待添加SKU面板 */
.pdd-pending-sku-panel {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    margin-bottom: 20px; overflow: hidden;
}
.pending-sku-header {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.pending-sku-list {
    padding: 12px 16px; display: flex; flex-direction: column; gap: 12px;
}
.pending-sku-card {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px; border: 1px solid #e5e7eb; border-radius: 8px;
    background: #fff; transition: opacity 0.3s;
}
.pending-sku-card.done { opacity: 0.4; pointer-events: none; }
.pending-sku-card.done .pending-sku-name { text-decoration: line-through; color: #9ca3af; }
.pending-sku-name {
    font-weight: 600; font-size: 14px; color: #1f2937; min-width: 160px; flex: 1;
}
.pending-sku-form {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.pending-sku-form input, .pending-sku-form select {
    width: 80px; font-size: 12px; padding: 4px 6px;
}
.pending-sku-item {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px;
    background: #fff;
}
.pending-sku-item span { font-weight: 600; color: #1f2937; flex: 1; min-width: 160px; }

/* 通用工厂未匹配横幅（含明细列表时改为纵向堆叠） */
.pdd-unmatched-banner.is-stacked { flex-direction: column; align-items: stretch; justify-content: flex-start; }

/* ==================== SKU策划定价 ==================== */
.sku-plan-module { display: flex; flex-direction: column; gap: 12px; }

.sku-plan-link-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 8px; font-size: 13px;
    background: #f9fafb; border: 1px solid #e5e7eb; color: #6b7280;
}
.sku-plan-link-bar .link-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #d1d5db; display: inline-block;
}
.sku-plan-link-bar .link-dot.linked { background: #10b981; }
.sku-plan-link-bar b { color: #1f2937; }

.sku-plan-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid #e5e7eb; }
.sku-plan-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 1800px; }
.sku-plan-table thead th {
    background: #f3f4f6; padding: 8px 6px; text-align: center;
    font-weight: 600; color: #374151; white-space: nowrap;
    border-bottom: 2px solid #d1d5db; position: sticky; top: 0; z-index: 1;
}
.sku-plan-table thead th.col-calc { background: #fef3c7; color: #92400e; }
.sku-plan-table thead th.col-input { background: #dbeafe; color: #1e40af; }
.sku-plan-table tbody td {
    padding: 4px 4px; border-bottom: 1px solid #f3f4f6; text-align: center;
    vertical-align: middle;
}
.sku-plan-table tbody tr:hover { background: #f9fafb; }
.sku-plan-table tbody td.col-calc {
    background: #fffbeb; font-weight: 600; color: #92400e;
    font-family: 'Courier New', monospace;
}
.sku-plan-table tbody td.col-input { background: #eff6ff; }
.sku-plan-table tbody td.col-action { white-space: nowrap; }

.sku-plan-table input[type="number"],
.sku-plan-table input[type="text"] {
    width: 100%; padding: 4px 6px; border: 1px solid #d1d5db;
    border-radius: 4px; font-size: 12px; text-align: center;
    transition: border-color 0.15s;
}
.sku-plan-table input:focus {
    border-color: #3b82f6; outline: none;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.sku-plan-table .text-red { color: #dc2626; }
.sku-plan-table .text-green { color: #059669; }

.link-badge {
    display: inline-block; padding: 1px 6px; border-radius: 4px;
    font-size: 10px; font-weight: 600;
    background: #f3f4f6; color: #9ca3af;
}
.link-badge.linked { background: #d1fae5; color: #065f46; }

.btn-icon {
    border: none; background: none; cursor: pointer;
    color: #ef4444; font-size: 14px; padding: 2px 4px;
    border-radius: 4px; transition: background 0.15s;
}
.btn-icon:hover { background: #fee2e2; }

.btn-upload {
    display: inline-flex; align-items: center; cursor: pointer;
    padding: 6px 14px; border-radius: 6px; font-size: 13px;
    background: #6366f1; color: #fff; border: none;
}
.btn-upload:hover { background: #4f46e5; }

.sku-plan-help {
    padding: 16px 20px; background: #f9fafb; border-radius: 8px;
    border: 1px solid #e5e7eb; font-size: 13px;
}
.sku-plan-help h4 { margin: 0 0 8px 0; font-size: 14px; color: #1f2937; }
.sku-plan-help ul { margin: 0; padding-left: 20px; color: #6b7280; line-height: 1.8; }
.sku-plan-help b { color: #1f2937; }

/* ==================== 月度经营报表 ==================== */
.monthly-report-page { padding: 0; }
.report-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.report-controls { display: flex; align-items: center; gap: 8px; }
.report-controls label { font-size: 13px; color: #6b7280; }

.report-table-wrap {
    overflow-x: auto; border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}
.monthly-report-table {
    width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap;
}
.monthly-report-table thead th {
    background: #6366f1; color: #fff; padding: 8px 10px;
    font-weight: 600; position: sticky; top: 0; z-index: 2;
}
.monthly-report-table thead th:first-child { border-radius: 8px 0 0 0; }
.monthly-report-table thead th:last-child { border-radius: 0 8px 0 0; background: #16a34a; }
.monthly-report-table tbody td {
    padding: 6px 10px; border-bottom: 1px solid #f3f4f6;
}
.monthly-report-table .metric-label {
    font-weight: 500; color: #374151; white-space: nowrap;
    background: #f9fafb; text-align: left;
}
.monthly-report-table .group-row td {
    background: #eef2ff; font-weight: 600; color: #4f46e5;
    padding: 6px 10px; font-size: 12px;
}
.monthly-report-table .year-total {
    font-weight: 700; background: #f0fdf4; color: #166534;
}
.monthly-report-table tr:hover td { background: #f5f3ff; }
.monthly-report-table tr.group-row:hover td { background: #eef2ff; }
.monthly-edit-input:focus {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

/* ==================== 财务报表概览 ==================== */
.financial-report-page { padding: 0; }

/* ========== 运营日历 ========== */
.calendar-page { padding: 16px; }
.cal-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cal-stat-card { background: #fff; border-radius: 8px; padding: 12px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.cal-stat-label { font-size: 12px; color: #888; margin-bottom: 4px; }
.cal-stat-val { font-size: 20px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
@media (max-width: 1100px) { .cal-grid { grid-template-columns: 1fr; } }
.cal-gantt-panel { background: #fff; border-radius: 8px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.cal-header-row { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; padding-bottom: 6px; border-bottom: 1px solid #eee; margin-bottom: 6px; }
.cal-header-cell { font-size: 12px; color: #888; font-weight: 500; }
.cal-week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 2px; }
.cal-cell { min-height: 80px; border: 1px solid #f0f0f0; border-radius: 4px; padding: 4px; font-size: 11px; cursor: default; }
.cal-cell:hover { background: #fafafa; }
.cal-cell-empty { border: 1px dashed #f0f0f0; background: #fafafa; }
.cal-cell-date { font-size: 12px; font-weight: 500; color: #333; margin-bottom: 2px; }
.cal-today { background: #eff6ff; border-color: #3b82f6; }
.cal-today .cal-cell-date { color: #3b82f6; }
.cal-today-mark { font-size: 9px; color: #3b82f6; margin-left: 3px; }
.cal-event { padding: 2px 4px; margin: 1px 0; border-radius: 3px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event-more { font-size: 10px; color: #888; text-align: center; padding: 2px 0; }
.cal-list-panel { background: #fff; border-radius: 8px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); max-height: 600px; overflow-y: auto; }
.cal-task-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cal-task-table th { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eee; color: #888; font-weight: 500; font-size: 11px; white-space: nowrap; }
.cal-task-table td { padding: 8px 6px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.cal-task-title { font-weight: 500; color: #333; }
.cal-badge { padding: 2px 8px; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.cal-empty { text-align: center; padding: 32px 0; color: #888; font-size: 13px; }
@media (max-width: 1100px) { .cal-gantt-panel { overflow-x: auto; } }
.fin-kpi-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 20px;
}
.fin-kpi-card {
    padding: 16px 20px; border-radius: 12px;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid #6366f1;
}
.fin-kpi-card.accent-green { border-left-color: #16a34a; }
.fin-kpi-card.accent-blue { border-left-color: #3b82f6; }
.fin-kpi-card.accent-purple { border-left-color: #8b5cf6; }
.fin-kpi-card.accent-red { border-left-color: #dc2626; }
.fin-kpi-label { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.fin-kpi-value { font-size: 24px; font-weight: 700; color: #1f2937; }
.fin-kpi-sub { font-size: 11px; color: #9ca3af; margin-top: 4px; }

.fin-body-grid {
    display: grid; grid-template-columns: 1fr 380px;
    gap: 16px; align-items: flex-start;
}
.fin-panel {
    background: #fff; border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb; overflow: hidden;
}
.fin-panel-title {
    margin: 0; padding: 12px 20px;
    font-size: 14px; font-weight: 600; color: #1f2937;
    background: #f9fafb; border-bottom: 1px solid #e5e7eb;
}
.fin-stmt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fin-stmt-table td { padding: 5px 16px; border-bottom: 1px solid #f9fafb; }
.fin-stmt-table tr.group-row td {
    background: #f3f4f6; font-weight: 600; color: #374151;
    font-size: 12px; padding: 6px 16px;
}
.fin-stmt-table tr.stmt-total td {
    font-weight: 700; border-top: 2px solid #e5e7eb;
    border-bottom: 2px solid #e5e7eb; background: #f9fafb;
}
.fin-stmt-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.fin-side { display: flex; flex-direction: column; gap: 16px; }

.fin-ratio-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px; padding: 12px 16px;
}
.fin-ratio-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; background: #f9fafb; border-radius: 6px;
}
.fin-ratio-label { font-size: 12px; color: #6b7280; }
.fin-ratio-value { font-size: 14px; font-weight: 600; color: #1f2937; }

.fin-trend-chart { padding: 12px 16px; }
.fin-trend-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0; border-bottom: 1px solid #f9fafb;
}
.fin-trend-label { font-size: 12px; color: #6b7280; width: 40px; flex-shrink: 0; }
.fin-trend-bars { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fin-trend-bar-item {
    display: flex; align-items: center; gap: 6px; font-size: 11px;
}
.fin-trend-bar-label { width: 30px; color: #9ca3af; flex-shrink: 0; }
.fin-bar-track {
    flex: 1; height: 14px; background: #f3f4f6;
    border-radius: 3px; overflow: hidden;
}
.fin-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.fin-trend-bar-val { width: 70px; text-align: right; color: #6b7280; flex-shrink: 0; }

.fin-expense-breakdown { padding: 12px 16px; }
.fin-exp-item { margin-bottom: 8px; }
.fin-exp-header {
    font-size: 12px; color: #374151; margin-bottom: 3px;
    display: flex; justify-content: space-between;
}
.fin-exp-bar-track {
    height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden;
}
.fin-exp-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }

@media (max-width: 1200px) {
    .fin-body-grid { grid-template-columns: 1fr; }
    .fin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Batch Import Center (v3.8.3)
   ============================================================ */
.batch-import-table th { white-space: nowrap; }
.batch-import-table td { vertical-align: middle; }
.batch-import-table select.form-control,
.batch-import-table input.form-control { 
    width: 100%; padding: 5px 8px; font-size: 13px; 
    border: 1px solid var(--c-border); border-radius: 4px;
}
.batch-import-table select.form-control:focus,
.batch-import-table input.form-control:focus { 
    border-color: var(--c-primary); outline: none;
}

/* ===== Batch Import Center (v3.8.3) ===== */
.form-control {
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 4px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}
.form-control:focus {
    border-color: var(--c-primary, #6366f1);
    outline: none;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}
#batch-rows tr[data-status="success"] {
    background: rgba(34,197,94,0.05);
}
#batch-rows tr[data-status="error"] {
    background: rgba(239,68,68,0.05);
}
#batch-rows tr[data-status="pending"] {
    background: #fff;
}
/* 保留按钮禁用态（批量导入等场景使用）；其余 .btn-* 由上方全局组件区统一提供，避免重复定义 */
.btn-success:disabled { opacity: .5; cursor: not-allowed; }


/* ===== All-store monthly business KPI dashboard ===== */
.monthly-kpi-page { padding:4px 0; }
.monthly-kpi-page .kpi-section { margin-top:20px; }
.monthly-kpi-page .kpi-section-title { font-size:15px; font-weight:600; color:#374151; margin:0 0 10px; padding-left:10px; border-left:3px solid #16a34a; }
.monthly-kpi-page .stat-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:12px; }
.monthly-kpi-page .stat-card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:14px 16px; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.monthly-kpi-page .stat-label { font-size:12px; color:#6b7280; }
.monthly-kpi-page .stat-value { font-size:24px; font-weight:700; margin:6px 0 2px; }
.monthly-kpi-page .stat-sub { font-size:11px; color:#9ca3af; }
.monthly-kpi-page .kpi-table { width:100%; border-collapse:collapse; margin-top:10px; background:#fff; border-radius:10px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.monthly-kpi-page .kpi-table th, .monthly-kpi-page .kpi-table td { padding:10px 12px; border-bottom:1px solid #f1f5f9; font-size:13px; }
.monthly-kpi-page .kpi-table th { background:#f8fafc; color:#64748b; font-weight:600; text-align:left; }
.monthly-kpi-page .kpi-table tbody tr:hover { background:#f9fafb; }
.monthly-kpi-page .expense-bars { margin-top:6px; }
.monthly-kpi-page .expense-bar-row { display:flex; align-items:center; gap:10px; padding:5px 0; }
.monthly-kpi-page .eb-label { width:90px; font-size:12px; color:#475569; text-align:right; }
.monthly-kpi-page .eb-track { flex:1; height:14px; background:#f1f5f9; border-radius:7px; overflow:hidden; }
.monthly-kpi-page .eb-fill { height:100%; background:linear-gradient(90deg,#34d399,#059669); border-radius:7px; }
.monthly-kpi-page .eb-val { width:110px; text-align:right; font-size:12px; color:#334155; }

/* ============================================================
   v5.0.18 — 体验升级：主题化 / 视图过渡 / 命令面板 / 统一表格
   ============================================================ */

/* ---- 主题化：平台品牌色平滑跟随（切换平台时主色渐变） ---- */
:root { --theme-transition: .25s; }
.brand, .sidebar-header .brand, .nav-item, .btn, a, .stat-card, .stat-icon,
.login-btn, .login-tab, .cmdk-item.active, .pdd-section-title, .pdd-btn-primary, .pdd-tab.active {
  transition: background-color var(--theme-transition) ease, color var(--theme-transition) ease, border-color var(--theme-transition) ease;
}

/* ---- 视图过渡：壳只建一次，route 变化仅内容区淡入 ---- */
.main-content { flex: 1; min-height: 0; overflow-y: auto; }
@keyframes viewEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.main-content.view-enter { animation: viewEnter .22s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- ⌘K 全局命令面板 ---- */
.cmdk-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 1500; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; animation: fadeIn .15s ease; }
.cmdk { width: min(640px, 92vw); background: var(--c-card); border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.32); overflow: hidden; animation: viewEnter .2s ease; }
.cmdk-input { width: 100%; border: none; outline: none; padding: 16px 18px; font-size: 16px; border-bottom: 1px solid var(--c-border); background: transparent; color: var(--c-text); }
.cmdk-input::placeholder { color: var(--c-text-light); }
.cmdk-list { max-height: 52vh; overflow: auto; padding: 6px; }
.cmdk-group { font-size: 11px; color: var(--c-text-light); padding: 10px 12px 4px; text-transform: uppercase; letter-spacing: .5px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--c-text); font-size: 14px; }
.cmdk-item .ico { width: 20px; text-align: center; opacity: .65; }
.cmdk-item .sub { margin-left: auto; font-size: 12px; color: var(--c-text-light); }
.cmdk-item.active, .cmdk-item:hover { background: var(--c-primary); color: #fff; }
.cmdk-item.active .sub, .cmdk-item:hover .sub { color: rgba(255,255,255,.82); }
.cmdk-empty { padding: 28px; text-align: center; color: var(--c-text-light); font-size: 13px; }
.cmdk-hint { padding: 8px 14px; font-size: 11px; color: var(--c-text-light); border-top: 1px solid var(--c-border); display: flex; gap: 16px; flex-wrap: wrap; }
.cmdk-hint kbd { background: #f1f5f9; border: 1px solid var(--c-border); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-family: var(--font); }

/* ---- 统一表格引擎：排序 / 固定列 / 手机卡片化 / 表头吸顶 ---- */
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--c-primary); }
.data-table th .sort-ind { opacity: .35; margin-left: 4px; font-size: 10px; }
.data-table th.sorted-asc .sort-ind, .data-table th.sorted-desc .sort-ind { opacity: 1; color: var(--c-primary); }
.data-table thead th { position: sticky; top: 0; }
.data-table td.col-sticky, .data-table th.col-sticky { position: sticky; left: 0; background: var(--c-card); z-index: 2; }
.table-scroll { max-height: 68vh; overflow: auto; border: 1px solid var(--c-border); border-radius: var(--radius); }
@media (max-width: 768px) {
  .table-scroll { max-height: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tr { margin-bottom: 12px; border: 1px solid var(--c-border); border-radius: 10px; padding: 4px 10px; background: var(--c-card); box-shadow: var(--shadow); }
  .data-table td { border: none; border-bottom: 1px solid var(--c-border); padding: 8px 4px; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
  .data-table td:last-child { border-bottom: none; }
  .data-table td::before { content: attr(data-label); color: var(--c-text-light); font-size: 12px; font-weight: 600; text-align: left; flex-shrink: 0; }
  .data-table td.col-sticky { position: static; background: transparent; }
}

/* ---- PDD / 通用模块强调色跟随主题（进拼多多时整体偏红） ---- */
.pdd-btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.pdd-btn-primary:hover { background: var(--c-primary-dark); }
.pdd-tab.active { color: var(--c-primary); }
.pdd-section-title { border-left-color: var(--c-primary); }
.pdd-import-card:hover, .pdd-import-card.selected { border-color: var(--c-primary); }
.pdd-upload-zone:hover, .pdd-upload-zone.drag-over { border-color: var(--c-primary); }
.import-card-title { color: var(--c-primary); }

/* ============================================================
   v5.0.18 — 字体与数字可读性优化（平台数据中心 / 全局）
   ============================================================ */
/* 正文行高放开，长段落/卡片内文字更透气 */
body { line-height: 1.55; }

/* 所有金额与数量使用「等宽数字」，对齐不再跳动（经营系统核心优化点） */
.stat-card .stat-value, .pdd-kpi-grid .stat-value,
.data-table td, .data-table th, .td-num,
.pdd-cost-inline td, .pdd-table td, .profit-banner-value, .profit-banner-sub,
.pdd-kpi-grid .stat-sub, .stat-sub, .cmdk-item .sub {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* KPI 大数字收紧字距，更显专业、紧凑 */
.stat-card .stat-value, .pdd-kpi-grid .stat-value, .profit-banner-value {
  letter-spacing: -.4px;
}

/* 成本表 / 数值列统一右对齐（与金额阅读习惯一致） */
.td-num { text-align: right; }
.pdd-cost-inline td.td-num, .pdd-table td.td-num { text-align: right; }

/* 表头弱化、数值强化：表格数字层级更清晰 */
.data-table th { color: #94a3b8; font-weight: 600; }
.data-table td { color: #334155; }

/* 平台数据中心标题层级微调：tab/卡片标题更清晰 */
.pdd-tab { font-weight: 500; }
.pdd-tab.active { font-weight: 700; }
.card-title { letter-spacing: .2px; }

/* 已授权平台卡片可点击反馈 */
.platform-card { cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s; }
.platform-card:hover { transform: translateY(-2px); border-color: var(--c-primary); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.platform-card.disabled { cursor: not-allowed; opacity: .6; transform: none; box-shadow: none; border-color: transparent; }

/* ============================================================
   整站换肤统一样式覆盖（浅色玻璃拟态 / 蓝紫渐变大屏风）
   ============================================================ */
.pdd-content { background: transparent; }
.pdd-tabs { background: rgba(99,102,241,0.08); }
.pdd-kpi-grid .stat-card,
.pdd-chart-card,
.pdd-import-card,
.cal-stat-card,
.cal-gantt-panel,
.cal-list-panel,
.fin-panel,
.pending-sku-card,
.pending-sku-item,
.sku-plan-table-wrap,
.report-table-wrap {
  background: var(--c-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pdd-kpi-grid .stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.monthly-kpi-page .stat-card,
.monthly-kpi-page .kpi-table { background: var(--c-card); border: var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.monthly-kpi-page .kpi-table th { background: rgba(99,102,241,0.08); }
.cmkd, .cmdk { background: var(--c-card); }

/* ============================================================
   v5.0.27 — 全局文字间距 / 排版规范（对齐高标准的中文后台排版）
   原则：行高留白 ≥ 字号层级；标签与正文之间必须有呼吸空隙；
   数字用等宽数字；中文小字号加 0.2~0.4px 字距提升可读性
   ============================================================ */

/* ---- 1. 全局基准：正文字距、行高 ---- */
body { line-height: 1.6; letter-spacing: .1px; }
h1, h2, h3, h4 { letter-spacing: .2px; }

/* ---- 2. 表格：单元格行高与内边距（松紧标准：≥12px 垂直呼吸） ---- */
table.data-table th { padding: 11px 16px; letter-spacing: .3px; }
table.data-table td { padding: 12px 16px; line-height: 1.6; }
.pdd-table th { padding: 11px 14px; letter-spacing: .3px; }
.pdd-table td { padding: 10px 14px; line-height: 1.6; }

/* 等宽编码列：加宽避免长编码(KIT-SP-xxx+SP-xxx)过早截断，字距归零保证编码紧凑可读 */
.td-mono { max-width: 300px; letter-spacing: 0; line-height: 1.5; }

/* ---- 3. 徽标 / 标签：字距与内边距，多枚徽标并排时自动留隙 ---- */
.badge { padding: 3px 12px; letter-spacing: .2px; }
.badge + .badge { margin-left: 6px; }

/* 表格单元格内的行内小标签（组合/赠品/锁定/低库存/复制等）：横向留隙 */
td span[data-copy] { margin-left: 6px !important; white-space: nowrap; }
td .cell-tag { margin-left: 6px; }

/* ---- 4. 按钮：字距统一，主操作更清晰 ---- */
.btn { letter-spacing: .3px; font-weight: 500; }
.btn-sm { letter-spacing: .2px; }

/* ---- 5. 表单：label 与控件的呼吸感 ---- */
.form-group label { letter-spacing: .2px; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { line-height: 1.5; }
.form-input { line-height: 1.5; }

/* ---- 6. 弹窗：标题与正文层级、正文行距 ---- */
.modal-header h3, .modal-title { letter-spacing: .3px; }
.modal { line-height: 1.6; }
.modal .form-group { margin-bottom: 16px; }

/* ---- 7. KPI / 统计数字：大数字紧字距、小标签松字距 ---- */
.stat-card .stat-label, .stat-sub { letter-spacing: .3px; }
.stat-card .stat-value { line-height: 1.2; }

/* ---- 8. Toast / 提示文字 ---- */
.toast { letter-spacing: .2px; line-height: 1.5; }

/* ---- 9. 侧边栏 / 面包屑 ---- */
.nav-item { letter-spacing: .2px; }
.main-header .breadcrumb { letter-spacing: .2px; }
.card-title { letter-spacing: .3px; }

/* ---- 10. 移动端同步：单元格转为行式布局时保持呼吸 ---- */
@media (max-width: 768px) {
  .data-table td { padding: 10px 6px; gap: 12px; line-height: 1.55; }
}

