/* ============================================
   团络统计 TongJi Analytics - 核心样式
   适配 Zibll 子比主题
   色调：浅蓝色简约高级企业感
   Version: 1.0.0
   Author: 团络网 www.tuanluowang.com
   ============================================ */

.svg-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
}

:root {
    --tj-primary: #4A90E2;
    --tj-primary-dark: #357ABD;
    --tj-primary-light: #E8F2FE;
    --tj-primary-bg: #F5F9FF;
    --tj-secondary: #6CB7F5;
    --tj-accent: #4FACFE;
    --tj-success: #27ae60;
    --tj-success-light: #e8f8f0;
    --tj-warning: #f39c12;
    --tj-warning-light: #fff8e6;
    --tj-danger: #e74c3c;
    --tj-danger-light: #fef0f0;
    --tj-info: #3498db;
    --tj-text: #1e293b;
    --tj-text-2: #475569;
    --tj-text-3: #64748b;
    --tj-text-4: #94a3b8;
    --tj-border: #e2e8f0;
    --tj-border-light: #f1f5f9;
    --tj-bg: #f8fafc;
    --tj-white: #ffffff;
    --tj-shadow: 0 4px 12px rgba(74, 144, 226, 0.08);
    --tj-shadow-hover: 0 8px 24px rgba(74, 144, 226, 0.15);
    --tj-radius-sm: 6px;
    --tj-radius: 10px;
    --tj-radius-lg: 14px;
}

/* ---------- Main Tabs ---------- */
.tongji-main-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 8px;
    background: var(--tj-white);
    border-radius: var(--tj-radius);
    border: 1px solid var(--tj-border);
    box-shadow: var(--tj-shadow);
}
.tongji-main-tab {
    flex: 1;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: var(--tj-radius-sm);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--tj-text-2);
    background: var(--tj-bg);
    border: 1px solid transparent;
    transition: all 0.25s ease;
}
.tongji-main-tab:hover {
    color: var(--tj-primary);
    background: var(--tj-primary-light);
    transform: translateY(-1px);
}
.tongji-main-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--tj-primary) 0%, var(--tj-accent) 100%);
    border-color: var(--tj-primary);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
}
.tongji-main-tab i {
    font-size: 16px;
}

/* ---------- Dashboard ---------- */
.tongji-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--tj-text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.tongji-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--tj-primary) 0%, var(--tj-accent) 100%);
    border-radius: var(--tj-radius-lg);
    box-shadow: var(--tj-shadow);
    color: #fff;
    flex-wrap: wrap;
    gap: 15px;
}

.tongji-dashboard-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
}

.tongji-site-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.tongji-site-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tj-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
    vertical-align: middle;
}

.tj-status-pending { background: #fff3cd; color: #856404; }
.tj-status-approved { background: #d4edda; color: #155724; }
.tj-status-rejected { background: #f8d7da; color: #721c24; }

.tongji-dashboard-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tongji-day-selector {
    display: inline-flex;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 4px;
    gap: 2px;
}

.tj-day-btn {
    padding: 6px 16px;
    border-radius: 6px;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-block;
}

.tj-day-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
    text-decoration: none;
}

.tj-day-btn.active {
    background: #fff;
    color: var(--tj-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ---------- 统计卡片 ---------- */
.tongji-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.tongji-stat-card {
    background: var(--tj-white);
    border-radius: var(--tj-radius-lg);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--tj-shadow);
    border: 1px solid var(--tj-border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tongji-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.stat-pv::before { background: var(--tj-primary); }
.stat-uv::before { background: var(--tj-success); }
.stat-ip::before { background: var(--tj-warning); }
.stat-online::before { background: var(--tj-danger); }

.tongji-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--tj-shadow-hover);
}

.tongji-stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    background: var(--tj-primary-bg);
}

.stat-pv .stat-icon { background: var(--tj-primary-light); }
.stat-uv .stat-icon { background: var(--tj-success-light); }
.stat-ip .stat-icon { background: var(--tj-warning-light); }
.stat-online .stat-icon { background: var(--tj-danger-light); font-size: 20px; color: var(--tj-danger); }

.stat-icon.pulse {
    animation: tj-pulse 1.5s infinite;
}

@keyframes tj-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

.stat-content { flex: 1; min-width: 0; }

.stat-label {
    font-size: 13px;
    color: var(--tj-text-3);
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--tj-text);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.stat-pv .stat-value { color: var(--tj-primary); }
.stat-uv .stat-value { color: var(--tj-success); }
.stat-ip .stat-value { color: var(--tj-warning); }
.stat-online .stat-value { color: var(--tj-danger); }

.stat-sub {
    font-size: 12px;
    color: var(--tj-text-4);
}

.stat-sub strong {
    color: var(--tj-text-2);
    font-weight: 600;
}

.tj-trend {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.tj-trend.up {
    background: var(--tj-success-light);
    color: var(--tj-success);
}

.tj-trend.down {
    background: var(--tj-danger-light);
    color: var(--tj-danger);
}

/* ---------- 图表卡片 ---------- */
.tongji-chart-card {
    background: var(--tj-white);
    border-radius: var(--tj-radius-lg);
    box-shadow: var(--tj-shadow);
    border: 1px solid var(--tj-border-light);
    margin-bottom: 20px;
    overflow: hidden;
}

.tongji-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--tj-border-light);
    background: var(--tj-bg);
}

.tongji-chart-header h3 {
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--tj-text) !important;
    line-height: 1.4 !important;
}

.tongji-chart-legend {
    display: flex;
    gap: 18px;
    font-size: 12px;
    color: var(--tj-text-3);
}

.tongji-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tj-legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.tongji-chart-body {
    padding: 22px 24px;
}

.tongji-refresh-btn {
    font-size: 12px;
    color: var(--tj-primary);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.tongji-refresh-btn:hover {
    color: var(--tj-primary-dark);
}

/* ---------- 网格布局 ---------- */
.tongji-row {
    display: grid;
    gap: 20px;
    margin-bottom: 0;
}

.tongji-col-8 { grid-column: span 8; }
.tongji-col-6 { grid-column: span 6; }
.tongji-col-4 { grid-column: span 4; }

@media (min-width: 993px) {
    .tongji-row { grid-template-columns: repeat(12, 1fr); }
}
@media (max-width: 992px) {
    .tongji-col-8, .tongji-col-6, .tongji-col-4 { grid-column: span 1; }
}

/* ---------- 数据表格 ---------- */
.tongji-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tongji-data-table thead th {
    padding: 12px 14px;
    text-align: left;
    background: var(--tj-bg);
    font-weight: 600;
    color: var(--tj-text-2);
    border-bottom: 2px solid var(--tj-border);
    white-space: nowrap;
}

.tongji-data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--tj-border-light);
    color: var(--tj-text-2);
    vertical-align: middle;
}

.tongji-data-table tbody tr:hover {
    background: var(--tj-primary-bg);
}

.tongji-data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---------- 趋势图 ---------- */
.tongji-trend-chart {
    width: 100%;
    min-height: 260px;
    position: relative;
}

.tj-trend-grid {
    display: flex;
    flex-direction: column;
    height: 260px;
    padding: 10px 0 30px;
    position: relative;
}

.tj-trend-y-axis {
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 30px;
    width: 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 11px;
    color: var(--tj-text-4);
    padding-right: 8px;
    text-align: right;
}

.tj-trend-main {
    flex: 1;
    margin-left: 55px;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 0 4px;
    border-left: 1px solid var(--tj-border-light);
    border-bottom: 1px solid var(--tj-border-light);
}

.tj-trend-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    height: 100%;
    position: relative;
    min-width: 0;
}

.tj-trend-bar-pv {
    background: linear-gradient(180deg, var(--tj-primary) 0%, var(--tj-secondary) 100%);
    border-radius: 3px 3px 0 0;
    transition: all 0.3s ease;
    min-height: 2px;
    position: relative;
    cursor: pointer;
}

.tj-trend-bar-uv {
    background: linear-gradient(180deg, var(--tj-success) 0%, #58d68d 100%);
    border-radius: 3px 3px 0 0;
    transition: all 0.3s ease;
    min-height: 2px;
    position: relative;
    cursor: pointer;
    opacity: 0.85;
}

.tj-trend-col:hover .tj-trend-bar-pv,
.tj-trend-col:hover .tj-trend-bar-uv {
    filter: brightness(1.1);
}

.tj-trend-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--tj-text);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    line-height: 1.7;
}

.tj-trend-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--tj-text);
}

.tj-trend-col:hover .tj-trend-tooltip {
    opacity: 1;
}

.tj-trend-x-axis {
    position: absolute;
    left: 55px;
    right: 0;
    bottom: 5px;
    display: flex;
    gap: 2px;
    padding: 0 4px;
}

.tj-trend-x-label {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--tj-text-4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 小时分布图 ---------- */
.tongji-hourly-chart {
    width: 100%;
    min-height: 180px;
    position: relative;
}

.tj-hourly-grid {
    display: flex;
    align-items: flex-end;
    height: 160px;
    gap: 1px;
    padding-bottom: 25px;
    position: relative;
    border-bottom: 1px solid var(--tj-border-light);
}

.tj-hourly-col {
    flex: 1;
    display: flex;
    justify-content: center;
    height: 100%;
    position: relative;
    min-width: 0;
}

.tj-hourly-bar {
    width: 75%;
    align-self: flex-end;
    background: linear-gradient(180deg, var(--tj-secondary) 0%, var(--tj-primary) 100%);
    border-radius: 2px 2px 0 0;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 1px;
    position: relative;
}

.tj-hourly-bar:hover {
    filter: brightness(1.15);
}

.tj-hourly-tip {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--tj-text);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tj-hourly-col:hover .tj-hourly-tip { opacity: 1; }

.tj-hourly-x {
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    display: flex;
    gap: 1px;
}

.tj-hourly-x span {
    flex: 1;
    text-align: center;
    font-size: 10px;
    color: var(--tj-text-4);
}

/* ---------- 占比饼图 ---------- */
.tj-pie-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tj-pie-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
    margin-bottom: 18px;
    box-shadow: inset 0 0 0 4px var(--tj-white), 0 4px 16px rgba(0,0,0,0.06);
}

.tj-pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: var(--tj-white);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tj-pie-center .pc-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--tj-primary);
}

.tj-pie-center .pc-txt {
    font-size: 11px;
    color: var(--tj-text-4);
}

.tj-pie-legend {
    width: 100%;
}

.tj-pie-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px dashed var(--tj-border-light);
    font-size: 13px;
}

.tj-pie-legend-item:last-child {
    border-bottom: none;
}

.tj-pli-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.tj-pli-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.tj-pli-name {
    color: var(--tj-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tj-pli-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.tj-pli-val {
    font-weight: 600;
    color: var(--tj-text);
    font-size: 13px;
}

.tj-pli-pct {
    color: var(--tj-text-4);
    font-size: 12px;
    min-width: 40px;
    text-align: right;
}

/* ---------- 条形图 ---------- */
.tj-bar-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tj-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tj-bar-label {
    width: 90px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--tj-text-2);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tj-bar-track {
    flex: 1;
    height: 26px;
    background: var(--tj-bg);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.tj-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--tj-primary) 0%, var(--tj-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 40px;
}

.tj-bar-val {
    width: 70px;
    text-align: right;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--tj-text-2);
}

/* ---------- 页面排行进度条 ---------- */
.tj-page-pct {
    height: 6px;
    background: var(--tj-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.tj-page-pct-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tj-primary), var(--tj-accent));
    border-radius: 3px;
    transition: width 0.8s ease;
}

.tj-page-url {
    font-size: 11px;
    color: var(--tj-text-4);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.tj-page-title-cell {
    max-width: 450px;
}

.tj-page-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: var(--tj-border-light);
    color: var(--tj-text-3);
}

.tj-page-rank.top1 { background: linear-gradient(135deg, #f6d365, #fda085); color: #fff; }
.tj-page-rank.top2 { background: linear-gradient(135deg, #c3cfe2, #a6c0fe); color: #fff; }
.tj-page-rank.top3 { background: linear-gradient(135deg, #f6b37e, #e8a87c); color: #fff; }

/* ---------- 空状态 ---------- */
.tongji-empty-state {
    background: var(--tj-white);
    border-radius: var(--tj-radius-lg);
    padding: 60px 30px;
    text-align: center;
    border: 1px dashed var(--tj-border);
}

.tongji-empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.tongji-empty-text {
    font-size: 14px;
    color: var(--tj-text-3);
    line-height: 1.8;
}

.tongji-empty-text a {
    color: var(--tj-primary);
}

/* ---------- 代码展示 ---------- */
.tongji-code-card {
    background: var(--tj-white);
    border-radius: var(--tj-radius-lg);
    padding: 24px;
    box-shadow: var(--tj-shadow);
    border: 1px solid var(--tj-border-light);
    margin-bottom: 20px;
}

.tongji-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--tj-border-light);
    flex-wrap: wrap;
    gap: 10px;
}

.tongji-code-site {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    flex-wrap: wrap;
}

.tongji-code-domain {
    color: var(--tj-text-4);
    font-size: 13px;
    font-weight: normal;
}

.tongji-copy-btn {
    padding: 8px 18px;
    background: var(--tj-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

.tongji-copy-btn:hover:not(:disabled) {
    background: var(--tj-primary-dark);
    transform: translateY(-1px);
}

.tongji-copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tongji-code-site-key {
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--tj-text-2);
}

.tongji-code-site-key code {
    background: var(--tj-primary-light);
    color: var(--tj-primary-dark);
    padding: 3px 10px;
    border-radius: 4px;
    font-family: 'SF Mono', Consolas, Monaco, monospace;
    font-size: 12px;
    font-weight: 600;
}

.tongji-code-tip {
    background: var(--tj-primary-bg);
    border-left: 3px solid var(--tj-primary);
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: var(--tj-text-2);
    margin-bottom: 12px;
}

.tongji-code-tip code,
.tongji-code-alt code {
    background: rgba(74, 144, 226, 0.1);
    color: var(--tj-primary-dark);
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 12px;
}

.tongji-code-pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 18px 20px;
    border-radius: 10px;
    font-family: 'SF Mono', Consolas, Monaco, 'Courier New', monospace;
    font-size: 12.5px;
    line-height: 1.65;
    overflow-x: auto;
    cursor: text;
    user-select: all;
    margin: 0 0 14px;
    max-height: 220px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

.tongji-code-alt {
    background: var(--tj-bg);
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--tj-text-2);
}

.tongji-code-alt strong {
    display: block;
    margin-bottom: 6px;
    color: var(--tj-text);
    font-size: 13px;
}

.tongji-code-alt ul {
    margin: 0;
    padding-left: 18px;
    line-height: 2;
}

.tongji-waiting {
    background: var(--tj-warning-light);
    border: 1px dashed #f1c40f;
    border-radius: 10px;
    padding: 26px;
    text-align: center;
}

.tongji-waiting-icon {
    font-size: 40px;
    margin-bottom: 12px;
    animation: bounce-slow 2s ease-in-out infinite;
}

@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.tongji-waiting-text {
    font-size: 13.5px;
    color: #7d6608;
    line-height: 1.8;
}

/* ---------- 站点管理 ---------- */
.tongji-sites-manager {
    font-family: inherit;
}

.tongji-sites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.tongji-sites-header h3 {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: var(--tj-text) !important;
}

.tongji-count-badge {
    display: inline-block;
    background: var(--tj-primary-light);
    color: var(--tj-primary-dark);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.tongji-btn-primary {
    padding: 9px 20px;
    background: linear-gradient(135deg, var(--tj-primary) 0%, var(--tj-accent) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.2);
}

.tongji-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.3);
}

.tongji-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tj-btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    text-decoration: none;
    border: 1px solid var(--tj-border);
    background: var(--tj-white);
    color: var(--tj-text-2);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

.tj-btn:hover {
    border-color: var(--tj-primary);
    color: var(--tj-primary);
}

.tj-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff !important;
    border-color: rgba(37, 99, 235, 0.3);
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.tj-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: rgba(29, 78, 216, 0.5);
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.tj-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff !important;
    border-color: rgba(220, 38, 38, 0.3);
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
}

.tj-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff !important;
    border-color: rgba(185, 28, 28, 0.5);
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.35);
    transform: translateY(-1px);
}

.tj-btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff !important;
    border-color: rgba(5, 150, 105, 0.3);
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.2);
}

.tj-btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff !important;
    border-color: rgba(4, 120, 87, 0.5);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.tongji-sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.tongji-site-card {
    background: var(--tj-white);
    border-radius: var(--tj-radius-lg);
    border: 1px solid var(--tj-border-light);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--tj-shadow);
    display: flex;
    flex-direction: column;
}

.tongji-site-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--tj-shadow-hover);
    border-color: var(--tj-secondary);
}

.tongji-site-card-header {
    padding: 18px 20px 16px;
    background: linear-gradient(135deg, var(--tj-primary-bg) 0%, #fff 100%);
    border-bottom: 1px solid var(--tj-border-light);
}

.tongji-site-card-title h4 {
    margin: 10px 0 4px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--tj-text) !important;
    line-height: 1.3 !important;
}

.tongji-site-domain {
    font-size: 12.5px;
    color: var(--tj-primary);
    text-decoration: none;
    word-break: break-all;
}

.tongji-site-domain:hover {
    text-decoration: underline;
}

.tongji-site-card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 14px 10px;
    text-align: center;
    gap: 4px;
    background: var(--tj-bg);
    border-bottom: 1px solid var(--tj-border-light);
}

.tstat {
    padding: 6px 4px;
}

.tstat-num {
    font-size: 16px;
    font-weight: 700;
    color: var(--tj-primary);
    line-height: 1.2;
}

.tstat-lbl {
    font-size: 11px;
    color: var(--tj-text-4);
    margin-top: 3px;
}

.tongji-site-card-footer {
    padding: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.tj-edit-site-btn,
.tj-reset-key-btn {
    padding: 6px 10px;
}

.tongji-site-reject-tip {
    padding: 10px 14px;
    background: var(--tj-danger-light);
    color: #c0392b;
    font-size: 12px;
    border-top: 1px solid #f5c6cb;
}

/* ---------- Modal ---------- */
.tongji-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.tongji-modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.tongji-modal-content {
    position: relative;
    width: 92%;
    max-width: 480px;
    background: #fff;
    border-radius: var(--tj-radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.tongji-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--tj-border-light);
    background: linear-gradient(135deg, var(--tj-primary-bg), #fff);
}

.tongji-modal-header h3 {
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: var(--tj-text) !important;
}

.tongji-modal-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--tj-text-4);
    transition: all 0.2s;
    font-size: 14px;
}

.tongji-modal-close:hover {
    background: var(--tj-danger-light);
    color: var(--tj-danger);
}

.tongji-modal-body {
    padding: 20px 22px;
    max-height: 65vh;
    overflow-y: auto;
}

.tj-form-row {
    margin-bottom: 16px;
}

.tj-form-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tj-text-2);
}

.tj-form-row input[type="text"],
.tj-form-row input[type="url"],
.tj-form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--tj-border);
    border-radius: 8px;
    font-size: 13.5px;
    transition: all 0.25s;
    background: #fff;
    color: var(--tj-text);
    box-sizing: border-box;
    font-family: inherit;
}

.tj-form-row input:focus,
.tj-form-row textarea:focus {
    outline: none;
    border-color: var(--tj-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}

.tongji-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--tj-border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--tj-bg);
}

/* ---------- 用户中心 Tab ---------- */
.tongji-user-header {
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--tj-primary) 0%, #3a82c9 50%, var(--tj-accent) 100%);
    border-radius: var(--tj-radius-lg);
    color: #fff;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.tongji-user-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 70%);
    border-radius: 50%;
}

.tongji-user-title {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.tongji-logo {
    font-size: 36px;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.15));
}

.tongji-user-title h2 {
    font-size: 22px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #fff !important;
    letter-spacing: 0.5px;
}

.tongji-subtitle {
    font-size: 13px;
    opacity: 0.85;
    margin-left: 4px;
}

.tongji-tab-bar {
    display: flex;
    gap: 8px;
    padding: 0;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tj-tab {
    flex-shrink: 0;
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--tj-text-3);
    text-decoration: none;
    cursor: pointer;
    background: var(--tj-bg);
    border: 1px solid var(--tj-border-light);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tj-tab:hover {
    color: var(--tj-primary);
    background: var(--tj-primary-bg);
}

.tj-tab.active {
    background: #fff;
    color: var(--tj-primary);
    border-color: var(--tj-border-light);
    border-bottom-color: var(--tj-primary);
    font-weight: 600;
    box-shadow: 0 -2px 8px rgba(74, 144, 226, 0.08);
}

.tongji-tab-content {
    min-height: 300px;
}

/* ---------- IP防护 ---------- */
.tongji-ban-manager { }

.tongji-ban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.tongji-ban-header h3 {
    font-size: 17px !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

.tongji-ban-header select {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--tj-border);
    background: #fff;
    font-size: 13px;
    min-width: 200px;
    cursor: pointer;
}

.tongji-protect-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.pi-card {
    background: linear-gradient(135deg, #fff9e6, #fffdf5);
    border: 1px solid #ffe08a;
    border-radius: var(--tj-radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.pi-icon {
    font-size: 30px;
    flex-shrink: 0;
}

.pi-title {
    font-weight: 600;
    color: #8a6d00;
    margin-bottom: 3px;
}

.pi-desc {
    font-size: 12.5px;
    color: #a68806;
    line-height: 1.5;
}

.tongji-ban-add-card {
    background: var(--tj-white);
    border-radius: var(--tj-radius-lg);
    padding: 20px 22px;
    box-shadow: var(--tj-shadow);
    border: 1px solid var(--tj-border-light);
    margin-bottom: 18px;
}

.tongji-ban-add-card h4 {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 0 14px !important;
}

.tj-ban-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tj-ban-form input {
    flex: 1;
    min-width: 140px;
    padding: 9px 14px;
    border: 1.5px solid var(--tj-border);
    border-radius: 8px;
    font-size: 13px;
    transition: border 0.2s;
}

.tj-ban-form input:focus {
    outline: none;
    border-color: var(--tj-primary);
}

/* ---------- 后台管理列表 ---------- */
.tj-sites-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.tj-sites-table th,
.tj-sites-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eef0f4;
    font-size: 13px;
}

.tj-sites-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #4a5568;
}

.tj-sites-table tr:hover {
    background: #f8fafc;
}

.tj-pagination {
    margin-top: 15px;
    text-align: right;
}

.tj-pagination a,
.tj-pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin-left: 4px;
    background: #f1f5f9;
    border-radius: 4px;
    text-decoration: none;
    color: #4a5568;
    font-size: 13px;
}

.tj-pagination a:hover {
    background: #4A90E2;
    color: #fff;
}

.tj-pagination .current {
    background: #4A90E2;
    color: #fff;
}

/* ---------- 控制台新增样式 ---------- */
.tongji-no-data-tip {
    background: linear-gradient(135deg, #eef4ff, #fff 60%);
    border: 1px solid #d5e4ff;
    color: #2a5ca0;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 16px;
}
.tongji-no-data-tip.tongji-warn {
    background: linear-gradient(135deg, #fff5e6, #fff 60%);
    border-color: #ffe0a8;
    color: #8a6200;
}
.tongji-no-data-tip i {
    margin-right: 5px;
}

.tj-empty-row td {
    padding: 0 !important;
    border-bottom: none;
}
.tj-empty-box {
    text-align: center;
    padding: 30px 10px;
}
.tj-empty-ico {
    font-size: 38px;
    margin-bottom: 8px;
    opacity: .6;
}
.tj-empty-text {
    font-size: 13px;
    color: #94a3b8;
}

.tj-more-link {
    color: #4A90E2;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}
.tj-more-link:hover { color: #2a7ac9; text-decoration: underline; }

.tj-legend-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 10px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}
.tj-legend-check input { cursor: pointer; }

.tj-trend-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.tj-trend-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tj-toolbar-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}
.tj-range-group {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}
.tj-range-btn {
    padding: 6px 14px;
    font-size: 12.5px;
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}
.tj-range-btn:hover { color: #4A90E2; }
.tj-range-btn.active {
    background: #fff;
    color: #4A90E2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-weight: 600;
}

.tj-subtabs-mini {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    padding: 6px;
    background: #f8fafc;
    border-radius: 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
}
.tj-subtab-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    color: #64748b;
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 500;
}
.tj-subtab-mini:hover { background: #fff; color: #4A90E2; }
.tj-subtab-mini.active {
    background: #fff;
    color: #4A90E2;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(74, 144, 226, 0.12);
}
.tj-subtab-mini .ticon {
    font-size: 15px;
    line-height: 1;
}

/* 6个统计卡（对应图五） */
.tj-stats-mini {
    grid-template-columns: repeat(6, 1fr) !important;
    margin-bottom: 20px;
    gap: 14px !important;
}
.tj-mini-card {
    padding: 16px 18px !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    flex-direction: row !important;
}
.tj-mini-card .stat-content { flex: 1; min-width: 0; }
.tj-mini-card .stat-label {
    font-size: 12.5px;
    color: #94a3b8;
    margin-bottom: 4px;
}
.tj-mini-card .stat-value {
    font-size: 23px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.15;
}
.stat-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.stat-icon-box::after {
    content: '';
    position: absolute;
    right: -12px;
    top: -12px;
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}
.stat-icon-box span {
    position: relative;
    z-index: 1;
}
.ib-pv    { background: linear-gradient(135deg, #667eea, #764ba2); }
.ib-uv    { background: linear-gradient(135deg, #11998e, #38ef7d); }
.ib-ip    { background: linear-gradient(135deg, #2193b0, #6dd5ed); }
.ib-tpv   { background: linear-gradient(135deg, #f093fb, #f5576c); }
.ib-tuv   { background: linear-gradient(135deg, #fa709a, #fee140); }
.ib-tip   { background: linear-gradient(135deg, #4facfe, #00f2fe); }

@media (max-width: 1100px) {
    .tj-stats-mini { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 540px) {
    .tj-stats-mini { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ============================================
   左侧菜单 + 右侧内容 新布局样式
   ============================================ */

.tj-app-layout {
    display: flex;
    gap: 0;
    background: var(--tj-bg);
    min-height: 600px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,0.04);
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ----- 左侧边栏 ----- */
.tj-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #eef0f4;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.tj-sidebar-brand {
    padding: 0 20px 18px;
    border-bottom: 1px solid #f1f3f7;
    margin-bottom: 16px;
}
.tj-sidebar-brand h3 {
    margin: 0 0 4px 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tj-sidebar-brand p {
    margin: 0 !important;
    font-size: 12px;
    color: #94a3b8;
}

.tj-sidebar-group {
    margin-bottom: 20px;
}
.tj-sidebar-group-title {
    padding: 0 20px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tj-sidebar-menu {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.tj-sidebar-menu li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    list-style-type: none !important;
}
.tj-sidebar-menu li::before,
.tj-sidebar-menu::before {
    display: none !important;
    content: none !important;
}

.tj-uc-menu,
.tj-uc-menu * {
    list-style: none !important;
    padding: 0;
    margin: 0;
}
.tj-uc-menu .tj-uc-menu-item::before {
    display: none !important;
    content: none !important;
}
.tj-uc-menu .tj-uc-menu-title::before {
    display: none !important;
    content: none !important;
}
.tj-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 2px 8px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border: 1px solid transparent;
}
.tj-menu-item i,
.tj-menu-item .tj-mi-icon {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.tj-menu-item:hover {
    background: #f1f5f9;
    color: #4A90E2;
    text-decoration: none;
}
.tj-menu-item.active {
    background: linear-gradient(135deg, #EEF2FF, #E8F2FE);
    color: #4A90E2;
    font-weight: 600;
    border-color: #E0E7FF;
}

.tj-sidebar-footer {
    margin-top: auto;
    padding: 16px 20px 0;
    border-top: 1px solid #f1f3f7;
}
.tj-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 10px;
}
.tj-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4A90E2, #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.tj-user-info {
    min-width: 0;
    flex: 1;
}
.tj-user-info .uname {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tj-user-info .urole {
    font-size: 11px;
    color: #94a3b8;
}
.tj-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    width: 100%;
}
.tj-logout-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    text-decoration: none;
}

/* ----- 右侧内容区 ----- */
.tj-main-content {
    flex: 1;
    min-width: 0;
    background: #f8fafc;
    padding: 20px 24px;
    overflow-x: hidden;
}

.tj-page-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef0f4;
}
.tj-page-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 0 0 6px 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tj-page-breadcrumb {
    font-size: 12.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.tj-page-breadcrumb .sep {
    color: #cbd5e1;
}

/* ----- 统计卡片（新样式） ----- */
.tj-stat-card-v2 {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #f1f3f7;
    position: relative;
    overflow: hidden;
    transition: all 0.25s;
}
.tj-stat-card-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.tj-stat-card-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
}
.tj-stat-card-v2.tj-sc-pv::before     { background: linear-gradient(90deg, #667eea, #764ba2); }
.tj-stat-card-v2.tj-sc-uv::before     { background: linear-gradient(90deg, #11998e, #38ef7d); }
.tj-stat-card-v2.tj-sc-ip::before     { background: linear-gradient(90deg, #2193b0, #6dd5ed); }
.tj-stat-card-v2.tj-sc-online::before { background: linear-gradient(90deg, #f093fb, #f5576c); }
.tj-stat-card-v2.tj-sc-tpv::before    { background: linear-gradient(90deg, #fa709a, #fee140); }
.tj-stat-card-v2.tj-sc-tuv::before    { background: linear-gradient(90deg, #4facfe, #00f2fe); }

.tj-sc-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    background: #f1f5f9;
}
.tj-stat-card-v2.tj-sc-pv .tj-sc-icon     { background: #EEF2FF; color: #667eea; }
.tj-stat-card-v2.tj-sc-uv .tj-sc-icon     { background: #ECFDF5; color: #11998e; }
.tj-stat-card-v2.tj-sc-ip .tj-sc-icon     { background: #E0F7FF; color: #2193b0; }
.tj-stat-card-v2.tj-sc-online .tj-sc-icon { background: #FDF2F8; color: #f5576c; }
.tj-stat-card-v2.tj-sc-tpv .tj-sc-icon    { background: #FFF7ED; color: #fa709a; }
.tj-stat-card-v2.tj-sc-tuv .tj-sc-icon    { background: #ECFEFF; color: #4facfe; }

.tj-sc-content { flex: 1; min-width: 0; }
.tj-sc-label {
    font-size: 12.5px;
    color: #94a3b8;
    margin-bottom: 4px;
    font-weight: 500;
}
.tj-sc-value {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.15;
    letter-spacing: -0.5px;
}
.tj-stat-card-v2.tj-sc-pv .tj-sc-value     { color: #667eea; }
.tj-stat-card-v2.tj-sc-uv .tj-sc-value     { color: #11998e; }
.tj-stat-card-v2.tj-sc-ip .tj-sc-value     { color: #2193b0; }
.tj-stat-card-v2.tj-sc-online .tj-sc-value { color: #f5576c; }
.tj-stat-card-v2.tj-sc-tpv .tj-sc-value    { color: #f59e0b; }
.tj-stat-card-v2.tj-sc-tuv .tj-sc-value    { color: #06b6d4; }

.tj-sc-sub {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.tj-sc-sub .tj-compare {
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 11px;
}
.tj-compare.up { background: #ECFDF5; color: #059669; }
.tj-compare.down { background: #FEF2F2; color: #DC2626; }

/* ----- 图表卡片（新样式） ----- */
.tj-chart-card-v2 {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #f1f3f7;
    overflow: hidden;
}
.tj-chart-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f7;
    flex-wrap: wrap;
    gap: 10px;
}
.tj-chart-header-v2 h3 {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tj-chart-header-v2 h3::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background: #6366f1;
    border-radius: 50%;
}
.tj-chart-body-v2 {
    padding: 18px 20px;
}

.tj-more-link-v2 {
    font-size: 12.5px;
    color: #6366f1;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tj-more-link-v2:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* ----- 数据面板顶部 ----- */
.tj-top-tabs {
    display: none;
}

/* ----- 隐藏旧的头部元素 ----- */
.tj-app-layout .tongji-dashboard-header {
    display: flex !important;
    justify-content: flex-end;
    padding: 0 0 14px 0;
    margin-bottom: 12px;
    background: none !important;
    border-bottom: 1px dashed #e2e8f0;
}
.tj-app-layout .tongji-dashboard-title { display: none !important; }
.tj-app-layout .tongji-dashboard-controls { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tj-app-layout .tongji-main-tabs { display: none !important; }
.tj-app-layout .tongji-subtabs { display: none !important; }

/* ----- 新的日期选择器 ----- */
.tj-date-range-group {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}
.tj-date-range-btn {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}
.tj-date-range-btn:hover { color: #4A90E2; text-decoration: none; }
.tj-date-range-btn.active {
    background: #fff;
    color: #4A90E2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-weight: 600;
}

/* ----- 控制台统计卡片grid ----- */
.tj-dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
@media (max-width: 1200px) {
    .tj-dashboard-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .tj-dashboard-stats-grid { grid-template-columns: 1fr; }
}

/* ----- 分析页6个统计卡 ----- */
.tj-analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.tj-analytics-stats-grid .tj-stat-card-v2 {
    padding: 14px 16px;
    gap: 12px;
}
.tj-analytics-stats-grid .tj-sc-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 10px;
}
.tj-analytics-stats-grid .tj-sc-value {
    font-size: 22px;
}
@media (max-width: 1200px) {
    .tj-analytics-stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .tj-analytics-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ----- 小标签页 ----- */
.tj-mini-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    padding: 5px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
}
.tj-mini-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    color: #64748b;
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 500;
}
.tj-mini-tab:hover { background: #fff; color: #4A90E2; text-decoration: none; }
.tj-mini-tab.active {
    background: #fff;
    color: #4A90E2;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(74,144,226,0.12);
}

/* ----- 响应式左侧菜单 ----- */
.tj-mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2, #6366f1);
    color: #fff;
    font-size: 24px;
    border: none;
    z-index: 99;
    box-shadow: 0 4px 20px rgba(74,144,226,0.4);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.tj-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 98;
}
.tj-sidebar-overlay.show { display: block; }

@media (max-width: 900px) {
    .tj-app-layout {
        flex-direction: column;
        border-radius: 12px;
    }
    .tj-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        z-index: 99;
        width: 240px;
        transition: left 0.3s ease;
        border-radius: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.08);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tj-sidebar.show { left: 0; }
    .tj-sidebar-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.45);
        z-index: 98;
    }
    .tj-main-content {
        padding: 16px;
        min-width: 0;
    }
    .tj-mobile-menu-btn {
        display: flex;
    }
    .tj-analytics-stats-grid,
    .tj-dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tongji-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .tongji-stat-card { padding: 14px 12px !important; }
    .stat-icon { font-size: 22px !important; }
    .stat-value { font-size: 22px !important; }
    .tongji-chart-card,
    .tongji-data-card,
    .tj-chart-card-v2,
    .chart-card {
        padding: 14px 10px !important;
    }
    .tj-chart-body-v2 { padding: 14px 10px !important; }
    .chart-title {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .tj-page-actions,
    .tj-chart-header-v2 {
        flex-wrap: wrap;
    }
    .tj-range-group,
    .tj-date-range-group {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tj-trend-grid,
    .tongji-trend-grid,
    .tj-hourly-grid {
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    .tj-trend-main,
    .tongji-trend-main {
        min-width: 500px;
    }
    .tj-pie-main {
        flex-direction: column !important;
        gap: 16px;
    }
    .tj-pie-chart {
        max-width: 200px !important;
        min-height: 180px !important;
        width: 180px !important;
        height: 180px !important;
    }
    .tongji-table-wrapper,
    .chart-card > div {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        -webkit-transform: translateZ(0);
        margin: 0 -10px;
        padding: 0 10px;
    }
    .tongji-data-table,
    .tongji-table,
    .tj-sites-table {
        min-width: 560px;
        font-size: 13px;
    }
    .tongji-data-table th,
    .tongji-data-table td,
    .tongji-table th,
    .tongji-table td,
    .tj-sites-table th,
    .tj-sites-table td {
        padding: 10px 8px !important;
        white-space: nowrap;
    }
    .tj-realtime-scroll {
        max-height: 360px !important;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
    .tongji-sites-grid {
        grid-template-columns: 1fr;
    }
    .tongji-site-card-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .tj-bar-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    .tj-bar-label {
        width: auto;
        min-width: 60px;
    }
    .tj-bar-val {
        width: auto;
        min-width: 50px;
    }
}
@media (max-width: 480px) {
    .tj-analytics-stats-grid { grid-template-columns: 1fr 1fr; }
    .tj-dashboard-stats-grid { grid-template-columns: 1fr; }
    .tongji-stats-grid { grid-template-columns: 1fr 1fr !important; }
    .tj-main-content { padding: 12px; }
    .tj-page-title { font-size: 17px !important; }
    .tongji-mini-tabs,
    .tj-mini-tabs,
    .tj-subtabs-mini {
        flex-wrap: wrap;
        gap: 6px;
    }
    .tj-mini-tab,
    .tj-subtab-mini,
    .tj-mini-tab {
        padding: 8px 10px !important;
        font-size: 13px;
        flex: 1;
        justify-content: center;
        min-width: calc(33% - 6px);
    }
    .tj-summary-subgrid {
        grid-template-columns: 1fr !important;
    }
}

.tongji-code-alt ul,
.tongji-code-alt li,
.tongji-code-alt ul::before,
.tongji-code-alt li::before {
    list-style: none !important;
    list-style-type: none !important;
}
.tongji-code-alt ul {
    padding-left: 0 !important;
    position: relative;
}
.tongji-code-alt li {
    position: relative;
    padding-left: 16px;
    padding-bottom: 4px;
}
.tongji-code-alt li::before {
    content: "•" !important;
    display: inline-block !important;
    position: absolute;
    left: 2px;
    top: 0;
    color: #94a3b8;
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.tj-empty-row td {
    padding: 0 !important;
    border: none !important;
}
.tj-empty-box {
    padding: 40px 16px;
    text-align: center;
}
.tj-empty-ico {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.6;
}
.tj-empty-text {
    color: #94a3b8;
    font-size: 13px;
}

.tj-page-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
}
.tj-page-rank.top1 { background: linear-gradient(135deg,#FFD700,#FFA500); color: #fff; }
.tj-page-rank.top2 { background: linear-gradient(135deg,#C0C0C0,#909090); color: #fff; }
.tj-page-rank.top3 { background: linear-gradient(135deg,#CD7F32,#A0522D); color: #fff; }

.tj-mini-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.6;
}
.tj-mini-tag.tag-s { background: #dbeafe; color: #2563eb; }
.tj-mini-tag.tag-p { background: #fce7f3; color: #db2777; }
.tj-mini-tag.tag-b { background: #e0f2fe; color: #0284c7; }

.code-panel { transition: opacity 0.2s; }

@media (max-width: 1400px) {
    .tj-platform-stats-panel > div[style*="grid-template-columns:repeat(7"] {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}
@media (max-width: 900px) {
    .tj-platform-stats-panel { padding: 16px !important; }
    .tj-platform-stats-panel > div:first-child { flex-direction: column; align-items: flex-start !important; gap: 6px !important; }
    .tj-platform-stats-panel > div[style*="grid-template-columns:repeat(7"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}
@media (max-width: 480px) {
    .tj-platform-stats-panel > div[style*="grid-template-columns:repeat(7"] {
        grid-template-columns: 1fr 1fr !important;
    }
    .tj-platform-stats-panel > div:last-child > div { padding: 10px 12px !important; }
    .tj-platform-stats-panel > div:last-child > div > div:nth-child(2) { font-size: 18px !important; }
}