/* =========================================================
   PC28 DATA
   全站主样式
   ========================================================= */

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e5e7eb;

    --text: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;

    --success: #16a34a;
    --success-soft: #f0fdf4;

    --warning: #d97706;
    --warning-soft: #fffbeb;

    --danger: #dc2626;
    --danger-soft: #fef2f2;

    --purple: #7c3aed;
    --purple-soft: #f5f3ff;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.07);

    --container: 1200px;

    --transition: 0.2s ease;
}

/* =========================================================
   Reset
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;

    background: var(--bg);
    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "PingFang SC",
        "Hiragino Sans GB",
        "Microsoft YaHei",
        Arial,
        sans-serif;

    font-size: 14px;
    line-height: 1.6;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

img {
    max-width: 100%;
    display: block;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* =========================================================
   App
   ========================================================= */

#app {
    min-height: 100vh;
}

/* =========================================================
   顶部导航
   ========================================================= */

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 100;

    height: 64px;

    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.navbar-inner {
    width: min(
        calc(100% - 32px),
        var(--container)
    );

    height: 100%;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 38px;
    height: 38px;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary);
    color: #ffffff;

    font-size: 15px;
    font-weight: 800;

    box-shadow:
        0 4px 10px rgba(37, 99, 235, 0.22);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.brand-text small {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: 10px;
}

/* Desktop Navigation */

.desktop-nav {
    height: 100%;

    display: flex;
    align-items: center;
    gap: 4px;
}

.desktop-nav a {
    position: relative;

    height: 100%;
    min-width: 70px;

    padding: 0 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-secondary);

    font-size: 14px;
    font-weight: 500;

    transition: var(--transition);
}

.desktop-nav a:hover {
    color: var(--primary);
}

.desktop-nav a.active {
    color: var(--primary);
    font-weight: 700;
}

.desktop-nav a.active::after {
    content: "";

    position: absolute;
    bottom: 0;
    left: 50%;

    width: 24px;
    height: 3px;

    transform: translateX(-50%);

    border-radius: 999px;

    background: var(--primary);
}

/* =========================================================
   主内容
   ========================================================= */

.main-content {
    width: min(
        calc(100% - 32px),
        var(--container)
    );

    margin: 0 auto;

    padding: 28px 0 60px;
}

/* =========================================================
   页面标题
   ========================================================= */

.page-header {
    margin-bottom: 22px;
}

.page-title {
    margin: 0;

    font-size: 26px;
    line-height: 1.3;
    font-weight: 800;

    letter-spacing: -0.3px;
}

.page-subtitle {
    margin: 7px 0 0;

    color: var(--text-secondary);

    font-size: 13px;
}

/* =========================================================
   卡片
   ========================================================= */

.card {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);
}

.card + .card {
    margin-top: 16px;
}

.card-header {
    padding: 18px 20px;

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    margin: 0;

    font-size: 16px;
    font-weight: 700;
}

.card-subtitle {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: 12px;
}

.card-body {
    padding: 20px;
}

/* =========================================================
   最新开奖
   ========================================================= */

.latest-card {
    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f8fbff 100%
        );
}

.latest-card .card-body {
    padding: 24px;
}

.latest-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.latest-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.latest-issue {
    margin-top: 4px;

    font-size: 20px;
    font-weight: 800;
}

.latest-time {
    margin-top: 4px;

    color: var(--text-muted);
    font-size: 12px;
}

.latest-numbers {
    margin-top: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;
}

.number-ball {
    width: 54px;
    height: 54px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-soft);
    color: var(--primary);

    border: 1px solid #dbeafe;

    font-size: 20px;
    font-weight: 800;
}

.latest-sum {
    margin-top: 18px;

    text-align: center;

    font-size: 30px;
    font-weight: 800;
}

.latest-sum span {
    margin-left: 6px;

    color: var(--text-muted);

    font-size: 12px;
    font-weight: 400;
}

/* =========================================================
   标签
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 26px;

    padding: 0 9px;

    border-radius: 999px;

    background: var(--surface-soft);
    color: var(--text-secondary);

    border: 1px solid var(--border);

    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: #dbeafe;
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: #bbf7d0;
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: #fde68a;
}

.badge-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #fecaca;
}

.badge-purple {
    background: var(--purple-soft);
    color: var(--purple);
    border-color: #ddd6fe;
}

/* =========================================================
   统计网格
   ========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;
}

.stat-card {
    padding: 18px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);
}

.stat-label {
    color: var(--text-secondary);

    font-size: 12px;
}

.stat-value {
    margin-top: 7px;

    font-size: 24px;
    line-height: 1.2;

    font-weight: 800;
}

.stat-extra {
    margin-top: 6px;

    color: var(--text-muted);

    font-size: 11px;
}

/* =========================================================
   分析结论
   ========================================================= */

.analysis-summary {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}

.analysis-item {
    padding: 16px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface-soft);
}

.analysis-item-label {
    color: var(--text-secondary);

    font-size: 12px;
}

.analysis-item-value {
    margin-top: 6px;

    display: flex;
    align-items: baseline;
    gap: 8px;

    font-size: 20px;
    font-weight: 800;
}

.analysis-item-percent {
    color: var(--primary);

    font-size: 12px;
    font-weight: 700;
}

/* =========================================================
   概率条
   ========================================================= */

.probability {
    margin-top: 10px;
}

.probability-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;

    font-size: 12px;
}

.probability-label {
    color: var(--text-secondary);
}

.probability-value {
    font-weight: 700;
}

.probability-track {
    height: 7px;

    margin-top: 6px;

    overflow: hidden;

    border-radius: 999px;

    background: #eef2f7;
}

.probability-fill {
    height: 100%;

    border-radius: inherit;

    background: var(--primary);

    transition:
        width 0.5s ease;
}

/* =========================================================
   图表
   ========================================================= */

.chart-card {
    overflow: hidden;
}

.chart-container {
    position: relative;

    width: 100%;
    min-height: 280px;
}

.chart-container canvas {
    width: 100% !important;
    max-width: 100%;
}

/* =========================================================
   数据表格
   ========================================================= */

.table-wrap {
    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;

    border-collapse: collapse;

    min-width: 680px;
}

.data-table th {
    padding: 13px 14px;

    background: var(--surface-soft);

    color: var(--text-secondary);

    border-bottom: 1px solid var(--border);

    font-size: 12px;
    font-weight: 600;

    text-align: left;

    white-space: nowrap;
}

.data-table td {
    padding: 14px;

    border-bottom: 1px solid var(--border);

    font-size: 13px;

    white-space: nowrap;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: #fafcff;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

/* =========================================================
   数字展示
   ========================================================= */

.draw-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.draw-number {
    width: 28px;
    height: 28px;

    border-radius: 50%;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 12px;
    font-weight: 700;
}

/* =========================================================
   筛选器
   ========================================================= */

.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    color: var(--text-secondary);

    font-size: 12px;
    white-space: nowrap;
}

.form-control {
    height: 38px;

    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--surface);
    color: var(--text);

    outline: none;

    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.10);
}

/* =========================================================
   按钮
   ========================================================= */

.btn {
    min-height: 38px;

    padding: 0 15px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border-radius: var(--radius-sm);

    cursor: pointer;

    font-size: 13px;
    font-weight: 600;

    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--surface);

    color: var(--text);

    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-soft);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

/* =========================================================
   Tabs
   ========================================================= */

.tabs {
    display: flex;
    align-items: center;
    gap: 4px;

    margin-bottom: 18px;

    padding: 4px;

    background: #eef2f7;

    border-radius: var(--radius);
}

.tab {
    flex: 1;

    min-height: 38px;

    padding: 0 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    color: var(--text-secondary);

    cursor: pointer;

    font-size: 13px;
    font-weight: 600;

    transition: var(--transition);
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: var(--surface);
    color: var(--primary);

    box-shadow: var(--shadow-sm);
}

/* =========================================================
   数据标签横向滚动
   ========================================================= */

.data-chips {
    display: flex;
    gap: 8px;

    margin-bottom: 18px;

    overflow-x: auto;

    padding-bottom: 4px;

    scrollbar-width: none;
}

.data-chips::-webkit-scrollbar {
    display: none;
}

.data-chip {
    flex: 0 0 auto;

    padding: 7px 13px;

    border: 1px solid var(--border);

    border-radius: 999px;

    background: var(--surface);

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition: var(--transition);
}

.data-chip:hover,
.data-chip.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: #bfdbfe;
}

/* =========================================================
   回测
   ========================================================= */

.backtest-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}

.backtest-item {
    padding: 18px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);
}

.backtest-label {
    color: var(--text-secondary);

    font-size: 12px;
}

.backtest-value {
    margin-top: 7px;

    font-size: 24px;
    font-weight: 800;
}

.backtest-description {
    margin-top: 5px;

    color: var(--text-muted);

    font-size: 11px;
}

/* =========================================================
   空状态
   ========================================================= */

.empty-state {
    padding: 60px 20px;

    text-align: center;

    color: var(--text-muted);
}

.empty-icon {
    width: 54px;
    height: 54px;

    margin: 0 auto 14px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eef2f7;

    font-size: 22px;
}

.empty-title {
    color: var(--text);

    font-size: 15px;
    font-weight: 700;
}

.empty-description {
    margin-top: 5px;

    font-size: 12px;
}

/* =========================================================
   Alert
   ========================================================= */

.alert {
    padding: 12px 14px;

    border-radius: var(--radius-sm);

    font-size: 13px;
}

.alert-info {
    background: var(--primary-soft);
    color: #1d4ed8;
}

.alert-success {
    background: var(--success-soft);
    color: #15803d;
}

.alert-warning {
    background: var(--warning-soft);
    color: #b45309;
}

.alert-danger {
    background: var(--danger-soft);
    color: #b91c1c;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
    border-top: 1px solid var(--border);

    background: var(--surface);
}

.footer-inner {
    width: min(
        calc(100% - 32px),
        var(--container)
    );

    margin: 0 auto;

    padding: 28px 0 34px;

    text-align: center;
}

.footer-brand {
    font-size: 14px;
    font-weight: 800;
}

.footer-desc {
    margin-top: 4px;

    color: var(--text-secondary);

    font-size: 12px;
}

.footer-meta {
    margin-top: 5px;

    color: var(--text-muted);

    font-size: 11px;
}

.footer-disclaimer {
    max-width: 650px;

    margin: 12px auto 0;

    color: var(--text-muted);

    font-size: 11px;
}

/* =========================================================
   Sidebar
   ========================================================= */

.sidebar {
    display: none;
}

/* =========================================================
   移动菜单按钮
   ========================================================= */

.mobile-menu-button {
    display: none;

    width: 40px;
    height: 40px;

    padding: 8px;

    background: transparent;

    cursor: pointer;
}

.mobile-menu-button span {
    display: block;

    width: 22px;
    height: 2px;

    margin: 5px auto;

    border-radius: 999px;

    background: var(--text);
}

.mobile-menu {
    display: none;
}

.bottom-nav {
    display: none;
}

/* =========================================================
   Dark Mode
   ========================================================= */

[data-theme="dark"] {
    --bg: #0b1120;
    --surface: #111827;
    --surface-soft: #172033;
    --border: #263247;

    --text: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --primary-soft: #172554;

    --success: #4ade80;
    --success-soft: #052e16;

    --warning: #fbbf24;
    --warning-soft: #451a03;

    --danger: #f87171;
    --danger-soft: #450a0a;

    --purple: #a78bfa;
    --purple-soft: #2e1065;

    --shadow-sm:
        0 1px 3px rgba(0, 0, 0, 0.25);

    --shadow:
        0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .top-navbar {
    background: rgba(17, 24, 39, 0.96);
}

[data-theme="dark"] .latest-card {
    background:
        linear-gradient(
            135deg,
            #111827 0%,
            #172033 100%
        );
}

[data-theme="dark"] .desktop-nav a.active {
    color: var(--primary);
}

[data-theme="dark"] .tab {
    background: #1a2435;
}

[data-theme="dark"] .tab.active {
    background: var(--surface);
}

[data-theme="dark"] .probability-track {
    background: #263247;
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: #151f31;
}

/* =========================================================
   Utility
   ========================================================= */

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.fw-600 {
    font-weight: 600 !important;
}

.fw-700 {
    font-weight: 700 !important;
}

.fw-800 {
    font-weight: 800 !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: 8px !important;
}

.mt-2 {
    margin-top: 16px !important;
}

.mt-3 {
    margin-top: 24px !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 8px !important;
}

.mb-2 {
    margin-bottom: 16px !important;
}

.mb-3 {
    margin-bottom: 24px !important;
}

.hidden {
    display: none !important;
}