* {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
            background: #eef2f7;
            color: #1f2937;
        }

        .layout {
            display: grid;
            grid-template-columns: 220px minmax(0, 1fr);
            min-height: 100vh;
        }

        .sidebar {
            padding: 28px 18px;
            background: #17202b;
            border-right: 1px solid rgba(255, 255, 255, 0.08);
            box-shadow: 10px 0 24px rgba(15, 23, 42, 0.12);
        }

        .nav-btn {
            display: flex;
            align-items: center;
            width: 100%;
            min-height: 46px;
            margin-bottom: 10px;
            border: 1px solid transparent;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.04);
            color: #cbd5e1;
            font-size: 15px;
            font-weight: 700;
            line-height: 20px;
            text-align: left;
            padding: 0 14px;
            cursor: pointer;
            transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
        }

        .nav-btn.active,
        .nav-btn:hover {
            background: #2563eb;
            border-color: rgba(255, 255, 255, 0.14);
            color: #fff;
        }

        .main {
            min-width: 0;
            padding: 30px;
            background: #eef2f7;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .title {
            color: #111827;
            font-size: 28px;
            font-weight: 700;
        }

        .desc {
            margin-top: 6px;
            font-size: 14px;
            color: #6b7280;
        }

        .right {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .last-time,
        .section-note {
            font-size: 13px;
            color: #6b7280;
        }

        .btn,
        .quick-btn {
            border: none;
            border-radius: 8px;
            background: #2563eb;
            color: #fff;
            padding: 10px 18px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 700;
            box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
            transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
        }

        .btn:hover,
        .quick-btn:hover {
            background: #1d4ed8;
            box-shadow: 0 12px 22px rgba(37, 99, 235, 0.24);
        }

        .quick-btn {
            background: #f1f5f9;
            color: #374151;
            box-shadow: none;
        }

        .quick-btn.active {
            background: #2563eb;
            color: #fff;
            box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
        }

        .panel {
            display: none;
        }

        .panel.active {
            display: block;
        }

        .summary {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
            margin-bottom: 24px;
        }

        .card,
        .table-wrap,
        .trend-panel {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 14px;
            box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
        }

        .card {
            padding: 20px;
        }

        .card-name {
            color: #6b7280;
            font-size: 14px;
            margin-bottom: 10px;
        }

        .card-value {
            font-size: 30px;
            font-weight: 700;
            color: #111827;
        }

        .section-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 8px 0 12px;
        }

        .section-title {
            color: #111827;
            font-size: 20px;
            font-weight: 700;
        }

        .table-wrap {
            overflow: hidden;
            margin-bottom: 24px;
        }

        .trend-panel {
            position: relative;
            padding: 18px;
        }

        .trend-loading-mask {
            position: absolute;
            inset: 0;
            z-index: 20;
            display: none;
            align-items: center;
            justify-content: center;
            border-radius: 14px;
            background: rgba(248, 250, 252, 0.78);
            backdrop-filter: blur(2px);
        }

        .trend-panel.loading .trend-loading-mask {
            display: flex;
        }

        .loading-box {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 16px;
            border: 1px solid #dbeafe;
            border-radius: 12px;
            background: #fff;
            color: #2563eb;
            font-size: 14px;
            font-weight: 800;
            box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
        }

        .loading-spinner {
            width: 16px;
            height: 16px;
            border: 2px solid #bfdbfe;
            border-top-color: #2563eb;
            border-radius: 999px;
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        .filter-row {
            display: flex;
            flex-wrap: wrap;
            align-items: end;
            gap: 12px;
            margin-bottom: 20px;
            padding: 14px;
            border-radius: 12px;
            background: #f8fafc;
            border: 1px solid #edf2f7;
        }

        .quick-range {
            display: flex;
            gap: 8px;
        }

        .field {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .field label {
            font-size: 14px;
            color: #6b7280;
        }

        .field input {
            min-width: 220px;
            border: 1px solid #d7dce3;
            border-radius: 8px;
            padding: 9px 10px;
            background: #fff;
            color: #1f2937;
            font-size: 14px;
        }

        .field input:focus {
            outline: none;
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
        }

        .trend-chart {
            width: 100%;
            min-height: 300px;
            overflow-x: auto;
            border-radius: 12px;
            background: #f8fafc;
            border: 1px solid #edf2f7;
        }

        .daily-grid {
            display: grid;
            grid-auto-flow: column;
            grid-auto-columns: minmax(320px, 1fr);
            gap: 14px;
            min-width: 100%;
            padding: 14px;
        }

        .day-card {
            min-width: 0;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            background: #fff;
            box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
        }

        .day-card-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 14px 10px;
            border-bottom: 1px solid #edf2f7;
        }

        .day-date {
            color: #111827;
            font-size: 16px;
            font-weight: 800;
        }

        .day-total {
            color: #64748b;
            font-size: 13px;
            font-weight: 700;
        }

        .day-list {
            display: grid;
            gap: 10px;
            padding: 12px 14px 14px;
        }

        .day-row {
            display: grid;
            grid-template-columns: minmax(100px, 1fr) minmax(90px, 42%) 58px;
            align-items: center;
            gap: 8px;
            min-height: 24px;
        }

        .day-platform {
            color: #334155;
            font-size: 13px;
            font-weight: 700;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .day-bar {
            height: 9px;
            border-radius: 999px;
            background: #eef2f7;
            overflow: hidden;
        }

        .day-bar-inner {
            height: 100%;
            min-width: 3px;
            border-radius: 999px;
        }

        .day-count {
            color: #111827;
            font-size: 13px;
            font-weight: 700;
            text-align: right;
        }

        .chart-empty {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 220px;
            color: #6b7280;
            font-size: 14px;
        }

        .trend-summary {
            margin-top: 16px;
            padding: 16px;
            border: 1px solid #edf2f7;
            border-radius: 12px;
            background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        }

        .trend-summary-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .trend-summary-title-main {
            color: #111827;
            font-size: 16px;
            font-weight: 800;
        }

        .trend-summary-actions {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .trend-summary-range {
            color: #64748b;
            font-size: 13px;
            font-weight: 700;
        }

        .trend-switch {
            display: inline-grid;
            grid-template-columns: 1fr 1fr;
            gap: 2px;
            padding: 3px;
            border: 1px solid #d7dce3;
            border-radius: 10px;
            background: #f1f5f9;
        }

        .trend-switch-btn {
            border: none;
            border-radius: 7px;
            background: transparent;
            color: #64748b;
            padding: 6px 11px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 800;
        }

        .trend-switch-btn.active {
            background: #2563eb;
            color: #fff;
            box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
        }

        .trend-summary svg {
            display: block;
            width: 100%;
            height: 220px;
        }

        .trend-label {
            fill: #64748b;
            font-size: 12px;
            font-weight: 700;
        }

        .trend-total-label {
            fill: #2563eb;
            font-size: 12px;
            font-weight: 800;
        }

        .trend-hover-hit {
            cursor: crosshair;
        }

        .trend-tooltip {
            position: fixed;
            z-index: 30;
            display: none;
            min-width: 260px;
            max-width: 360px;
            max-height: 420px;
            overflow-y: auto;
            padding: 10px 12px;
            border: 1px solid rgba(148, 163, 184, 0.28);
            border-radius: 10px;
            background: rgba(15, 23, 42, 0.94);
            color: #fff;
            box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24);
            pointer-events: none;
        }

        .trend-tooltip-title {
            margin-bottom: 8px;
            font-size: 14px;
            font-weight: 800;
        }

        .trend-tooltip-total {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            color: #cbd5e1;
            font-size: 12px;
        }

        .trend-tooltip-total strong {
            color: #fff;
            font-size: 13px;
        }

        .trend-tooltip-list {
            display: grid;
            gap: 4px;
            padding-top: 6px;
            border-top: 1px solid rgba(148, 163, 184, 0.22);
        }

        .trend-tooltip-row {
            display: grid;
            grid-template-columns: 10px minmax(0, 1fr) auto;
            align-items: center;
            gap: 8px;
            color: #e5e7eb;
            font-size: 12px;
            line-height: 22px;
        }

        .trend-tooltip-dot {
            width: 9px;
            height: 9px;
            border-radius: 999px;
        }

        .trend-tooltip-name {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .trend-tooltip-count {
            color: #fff;
            font-weight: 800;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        thead {
            background: #f8fafc;
        }

        th, td {
            padding: 15px 18px;
            border-bottom: 1px solid #edf0f5;
            text-align: left;
            font-size: 14px;
        }

        th {
            font-weight: 600;
            color: #64748b;
        }

        tbody tr:hover {
            background: #f8fafc;
        }

        .platform,
        .num {
            font-weight: 700;
        }

        .num-ok {
            color: #16a34a;
        }

        .num-warn {
            color: #f59e0b;
        }

        .num-danger {
            color: #dc2626;
        }

        .status {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 600;
        }

        .status-ok {
            background: #dcfce7;
            color: #166534;
        }

        .status-warn {
            background: #fef3c7;
            color: #92400e;
        }

        .status-danger {
            background: #fee2e2;
            color: #991b1b;
        }

        .error {
            display: none;
            margin-top: 16px;
            padding: 12px 14px;
            border-radius: 8px;
            background: #fee2e2;
            color: #991b1b;
            font-size: 14px;
        }

        @media (max-width: 900px) {
            .layout {
                grid-template-columns: 1fr;
            }

            .sidebar {
                display: flex;
                gap: 10px;
                padding: 14px;
                box-shadow: none;
            }

            .nav-btn {
                justify-content: center;
                margin-bottom: 0;
            }

            .summary {
                grid-template-columns: repeat(2, 1fr);
            }

            .header {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
            }
        }

        @media (max-width: 600px) {
            .main {
                padding: 14px;
            }

            .summary {
                grid-template-columns: 1fr;
            }

            th, td {
                padding: 10px;
                font-size: 13px;
            }

            .field,
            .field input,
            .filter-row .btn,
            .quick-range {
                width: 100%;
            }

            .quick-btn {
                flex: 1;
            }
        }
