/* 加拿大28 - 黑金科技风主题 */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --gold: #d4af37;
    --gold-light: #f0d060;
    --gold-dark: #a08520;
    --text-primary: #e8e8ec;
    --text-secondary: #9999aa;
    --text-muted: #666680;
    --border: #2a2a3a;
    --accent-red: #e74c3c;
    --accent-blue: #3498db;
    --accent-green: #2ecc71;
    --accent-orange: #f39c12;
    --radius: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
    background: linear-gradient(180deg, #151520 0%, var(--bg-secondary) 100%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.logo a {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
}

.main-nav { display: flex; gap: 4px; }

.main-nav a {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.main-nav a:hover, .main-nav a.active {
    color: var(--gold);
    background: rgba(212,175,55,0.1);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gold);
    margin: 5px 0;
    transition: var(--transition);
}

/* Main */
.site-main { padding: 20px 0 40px; min-height: calc(100vh - 160px); }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2, .card h2, .card h3 {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 600;
}

.more-link { font-size: 0.85rem; color: var(--text-secondary); }
.more-link:hover { color: var(--gold); }

/* Current Draw */
.current-draw { text-align: center; }

.draw-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.draw-period { color: var(--text-secondary); font-size: 0.95rem; }
.draw-period strong { color: var(--gold-light); font-size: 1.2rem; }

.balls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(212,175,55,0.3);
}

.balls-lg .ball { width: 52px; height: 52px; font-size: 1.3rem; }

.result-ball {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    box-shadow: 0 2px 8px rgba(231,76,60,0.4);
}

.plus, .equals { color: var(--text-muted); font-size: 1.2rem; font-weight: 300; }

.draw-tags { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    background: rgba(212,175,55,0.15);
    color: var(--gold);
    border: 1px solid rgba(212,175,55,0.3);
}

.tag-big { background: rgba(231,76,60,0.15); color: #e74c3c; border-color: rgba(231,76,60,0.3); }
.tag-small { background: rgba(52,152,219,0.15); color: #3498db; border-color: rgba(52,152,219,0.3); }
.tag-odd { background: rgba(243,156,18,0.15); color: #f39c12; border-color: rgba(243,156,18,0.3); }
.tag-even { background: rgba(46,204,113,0.15); color: #2ecc71; border-color: rgba(46,204,113,0.3); }
.tag-extreme { background: rgba(155,89,182,0.15); color: #9b59b6; border-color: rgba(155,89,182,0.3); }

.tag-sm { padding: 2px 8px; font-size: 0.75rem; }

.draw-time { color: var(--text-muted); font-size: 0.85rem; }

/* Countdown */
.countdown-box {
    margin-top: 20px;
    padding: 16px;
    background: rgba(212,175,55,0.05);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: var(--radius);
}

.countdown-label { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 8px; }
.countdown-label span { color: var(--gold-light); font-weight: 600; }

.countdown-timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}

/* Tables */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    background: rgba(212,175,55,0.08);
    color: var(--gold);
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tbody tr:hover { background: var(--bg-card-hover); }

.data-table .nums { font-family: 'Courier New', monospace; color: var(--gold-light); }
.result-num { color: #e74c3c; font-weight: 700; }
.time-col { color: var(--text-muted); white-space: nowrap; }
.no-data { text-align: center; color: var(--text-muted); padding: 30px !important; }

/* Ads */
.ad-banner, .ad-global-top, .ad-footer { margin-bottom: 16px; text-align: center; }
.ad-banner img, .ad-global-top img, .ad-footer img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.ad-global-top { margin-bottom: 0; }

/* Stats */
.stat-summary { color: var(--text-muted); font-size: 0.85rem; }

.stat-grid { display: grid; gap: 12px; }
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }

.stat-item { display: flex; align-items: center; gap: 12px; }
.stat-label { width: 30px; font-weight: 600; text-align: center; }
.stat-bar-wrap { flex: 1; height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.stat-bar { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.stat-value { width: 100px; text-align: right; font-size: 0.8rem; color: var(--text-secondary); }

.stat-box {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-box-label { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 4px; }
.stat-box-value { font-size: 1.5rem; font-weight: 700; color: var(--gold); }
.stat-box-pct { font-size: 0.8rem; color: var(--text-muted); }

.highlight { color: #e74c3c; font-weight: 600; }

/* Trend Matrix */
.trend-matrix-wrap { overflow-x: auto; }
.trend-matrix { border-collapse: collapse; font-size: 0.7rem; }
.trend-matrix th, .trend-matrix td {
    width: 22px; height: 22px;
    text-align: center;
    border: 1px solid var(--border);
    padding: 0;
}
.trend-matrix th { background: rgba(212,175,55,0.08); color: var(--gold); font-size: 0.65rem; }
.trend-matrix .period-col { width: 50px; color: var(--text-muted); font-size: 0.65rem; }
.trend-matrix .hit { background: #e74c3c; color: #fff; font-weight: 700; border-radius: 2px; }

.chart-wrap { padding: 10px 0; }
.chart-wrap canvas { width: 100% !important; }

/* Detail */
.detail-card { max-width: 700px; margin: 0 auto; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: var(--text-muted); }

.page-heading {
    color: var(--gold);
    font-size: 1.2rem;
    font-weight: 600;
}

.detail-header { text-align: center; margin-bottom: 24px; }
.detail-header h1 { color: var(--gold); font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.detail-subtitle { color: var(--text-secondary); font-size: 1rem; margin-bottom: 6px; }
.detail-result { margin-bottom: 24px; }

.seo-content {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.seo-content h2 {
    color: var(--gold);
    font-size: 1rem;
    font-weight: 600;
    margin: 16px 0 10px;
}

.seo-content h2:first-child { margin-top: 0; }

.seo-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 10px;
}

.seo-content a { color: var(--gold); text-decoration: underline; }
.seo-content strong { color: var(--text-primary); }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.detail-label { color: var(--text-muted); font-size: 0.85rem; }
.detail-value { font-weight: 600; }
.detail-value small { color: var(--text-muted); font-weight: 400; }

.detail-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* Play page */
.play-content { line-height: 1.8; color: var(--text-primary); }
.play-content h3 { color: var(--gold); margin: 20px 0 10px; font-size: 1rem; }
.play-content p { margin-bottom: 10px; color: var(--text-secondary); }
.play-item { padding-left: 12px; border-left: 3px solid var(--gold-dark); }

.card-inner { margin-top: 24px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 12px; }
.rule-box { padding: 14px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.rule-box h4 { color: var(--gold); margin-bottom: 6px; font-size: 0.9rem; }
.rule-box p { font-size: 0.85rem; color: var(--text-secondary); }
.rule-box strong { color: var(--gold-light); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.page-btn {
    padding: 6px 14px;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    transition: all var(--transition);
}
.page-btn:hover, .page-btn.active { background: rgba(212,175,55,0.15); color: var(--gold); border-color: var(--gold-dark); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.btn-primary { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #1a1a1a; }
.btn-primary:hover { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: #1a1a1a; }
.btn-secondary { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--gold-dark); color: var(--gold); }
.btn-block { display: block; width: 100%; }

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* CS Float */
.cs-float {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #0088cc, #00aaff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,136,204,0.4);
    z-index: 99;
    transition: transform var(--transition);
}
.cs-float:hover { transform: scale(1.1); color: #fff; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 0.85rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--gold-dark);
}

.hint { color: var(--text-muted); font-size: 0.8rem; margin-top: 4px; display: block; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: rgba(231,76,60,0.15); color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); }
.alert-success { background: rgba(46,204,113,0.15); color: #2ecc71; border: 1px solid rgba(46,204,113,0.3); }

.period-filter { display: flex; align-items: center; gap: 8px; }
.period-filter select {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
}

/* Admin */
.admin-body { background: var(--bg-primary); }

.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-brand {
    padding: 0 20px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.admin-sidebar nav a {
    display: block;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
    color: var(--gold);
    background: rgba(212,175,55,0.08);
}

.admin-main { flex: 1; padding: 24px; overflow-x: auto; }
.admin-main h2 { color: var(--gold); margin-bottom: 20px; }

.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.admin-stat-card .stat-num { font-size: 1.8rem; font-weight: 700; color: var(--gold); }
.admin-stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

.admin-form { max-width: 600px; }
.code-block {
    display: block;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--gold-light);
    word-break: break-all;
    margin: 10px 0;
}

.ad-preview, .ad-thumb { max-width: 200px; max-height: 80px; border-radius: 4px; margin-top: 8px; }
.ad-thumb { max-width: 120px; max-height: 50px; }
.action-col a { margin-right: 8px; font-size: 0.85rem; }

/* Login */
.admin-login-page, .install-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1520 50%, #0a0a0f 100%);
}

.login-box, .install-box {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.login-box h1, .install-box h1 {
    text-align: center;
    color: var(--gold);
    margin-bottom: 24px;
    font-size: 1.3rem;
}

.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-code {
    display: inline-block;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--gold-dark);
    border-radius: var(--radius);
    color: var(--gold);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 6px;
    user-select: none;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle { display: block; }

    .main-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 10px;
        border-bottom: 1px solid var(--border);
    }

    .main-nav.open { display: flex; }

    .ball { width: 38px; height: 38px; font-size: 1rem; }
    .countdown-timer { font-size: 1.5rem; }

    .stat-grid-3, .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .admin-stats { grid-template-columns: 1fr; }

    .data-table { font-size: 0.78rem; }
    .data-table th, .data-table td { padding: 8px 4px; }
}

@media (max-width: 480px) {
    .stat-grid-3, .stat-grid-4 { grid-template-columns: 1fr; }
    .detail-nav { flex-direction: column; }
}
