
:root {

    --primary: #1a2332;
    --primary-light: #243447;
    --primary-dark: #0f1923;
    --primary-deeper: #0a1219;
    --accent: #d4a853;
    --accent-light: #e8c476;
    --accent-dark: #b8913d;
    --accent-glow: rgba(212, 168, 83, 0.35);

    /* Functional colors */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.12);

    /* Neutral colors - refined grays */
    --bg-body: #f0f2f7;
    --bg-card: #ffffff;
    --bg-card-hover: #fafbfd;
    --bg-sidebar: #f7f8fb;
    --bg-elevated: #ffffff;
    --text-primary: #334155;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    --divider: #e2e8f0;

    /* Ball colors - rich gradients */
    --ball-red: #dc2626;
    --ball-red-light: #f87171;
    --ball-red-dark: #b91c1c;
    --ball-blue: #2563eb;
    --ball-blue-light: #60a5fa;
    --ball-blue-dark: #1d4ed8;
    --ball-green: #16a34a;
    --ball-green-light: #4ade80;
    --ball-green-dark: #15803d;

    /* Shadows - layered with subtle color tints */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-card-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 4px 10px rgba(212, 168, 83, 0.06);
    --shadow-accent: 0 4px 14px rgba(212, 168, 83, 0.25);
    --shadow-navbar: 0 2px 12px rgba(15, 25, 35, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);

    /* Border radius - elegant, professional */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: blur(12px);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(212, 168, 83, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(26, 35, 50, 0.03) 0%, transparent 50%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* ============================================
   Card Component - Premium with depth
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(212, 168, 83, 0.2);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    padding: 12px 16px;
    border-bottom: none;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    background: linear-gradient(135deg, #8b6914, var(--accent), #e8c36a);
}

.card-header i {
    color: #fff;
    font-size: 14px;
}

.card-body {
    padding: 16px;
}

/* ============================================
   Ball Styles - Gradient + Inner Shadow + Glow
   ============================================ */
.ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
    position: relative;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-fast);
}

.ball::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 4px;
    right: 4px;
    height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    border-radius: 50% 50% 40% 40%;
    pointer-events: none;
}

.ball-red {
    background: linear-gradient(145deg, var(--ball-red-light), var(--ball-red), var(--ball-red-dark));
    box-shadow:
        0 2px 8px rgba(220, 38, 38, 0.35),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.ball-blue {
    background: linear-gradient(145deg, var(--ball-blue-light), var(--ball-blue), var(--ball-blue-dark));
    box-shadow:
        0 2px 8px rgba(37, 99, 235, 0.35),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.ball-green {
    background: linear-gradient(145deg, var(--ball-green-light), var(--ball-green), var(--ball-green-dark));
    box-shadow:
        0 2px 8px rgba(22, 163, 74, 0.35),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.ball-special {
    box-shadow:
        0 0 0 2px var(--accent),
        0 0 12px rgba(212, 168, 83, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    animation: ball-glow 2s ease-in-out infinite;
}

@keyframes ball-glow {
    0%, 100% { box-shadow: 0 0 0 2px var(--accent), 0 0 12px rgba(212, 168, 83, 0.3), inset 0 -2px 4px rgba(0,0,0,0.15), inset 0 1px 2px rgba(255,255,255,0.2); }
    50% { box-shadow: 0 0 0 3px var(--accent-light), 0 0 20px rgba(212, 168, 83, 0.5), inset 0 -2px 4px rgba(0,0,0,0.15), inset 0 1px 2px rgba(255,255,255,0.2); }
}

.ball-pk10 {
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ball-ssc {
    background: linear-gradient(145deg, #22d3ee, #0891b2, #0e7490);
    box-shadow:
        0 2px 8px rgba(8, 145, 178, 0.35),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.ball-other {
    background: linear-gradient(145deg, #60a5fa, #3b82f6, #2563eb);
    box-shadow:
        0 2px 8px rgba(59, 130, 246, 0.35),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.ball-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.ball-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.ball-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 1px 2px rgba(212, 168, 83, 0.2);
}

.zodiac {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

/* ============================================
   Button Styles - Gradient backgrounds
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-light), var(--accent), var(--accent-dark));
    color: #fff;
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.3);
}

.btn-primary:hover {
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(212, 168, 83, 0.04);
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.1);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: var(--radius-xs);
}

/* ============================================
   Tags - Polished with subtle gradient
   ============================================ */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.tag-accent {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.08), rgba(212, 168, 83, 0.15));
    color: var(--accent-dark);
    border-color: rgba(212, 168, 83, 0.15);
}

.tag-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(59, 130, 246, 0.12));
    color: var(--info);
    border-color: rgba(59, 130, 246, 0.12);
}

.tag-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(16, 185, 129, 0.12));
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.12);
}

.tag-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), rgba(239, 68, 68, 0.12));
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.12);
}

/* ============================================
   Tab Bar
   ============================================ */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--divider);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
}

.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all var(--transition-fast);
    font-weight: 500;
    position: relative;
}

.tab-item:hover {
    color: var(--text-primary);
    background: rgba(212, 168, 83, 0.03);
}

.tab-item.active {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
    font-weight: 700;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb .separator {
    color: var(--text-muted);
    font-size: 10px;
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   Loading & Empty States
   ============================================ */
.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--text-muted);
    font-size: 13px;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    /* Font Awesome 给图标固定了 1.25em 宽度，display:block 后不会被父级 text-align 居中，需要自己 auto 居中 */
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.25;
    background: linear-gradient(135deg, var(--text-muted), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Drawing Animation
   ============================================ */
.drawing {
    color: var(--danger);
    font-weight: 700;
    animation: drawing-pulse 1.2s ease-in-out infinite;
}

@keyframes drawing-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ============================================
   Star Rating
   ============================================ */
.star-rating {
    color: var(--accent);
    font-size: 11px;
    letter-spacing: 1px;
    filter: drop-shadow(0 1px 2px rgba(212, 168, 83, 0.3));
}

/* ============================================
   Scrollbar - Refined
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c0c4cc, #a0a4ac);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #909399, #787c84);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* Fade-in animation for page loads */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.35s ease-out;
}
