/* ============================================
   base.css - 全局基础样式
   所有页面的重置、滚动条、全局覆盖等
   ============================================ */

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--app-bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    transition: var(--transition);
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== 全局背景层 ===== */
.global-bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    pointer-events: none;
}

/* ===== 全局覆盖 ===== */
.app-container {
    background: var(--app-bg);
}

.top-header {
    background: var(--header-bg) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color) !important;
}

.content-area {
    background: var(--app-bg);
}

.view-panel {
    background: transparent !important;
}

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

/* ===== 纸质纹理 ===== */
[data-theme="paper"] body {
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(180,160,140,0.03) 2px, rgba(180,160,140,0.03) 4px),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

[data-theme="paper"] .welcome-card,
[data-theme="paper"] .stat-card,
[data-theme="paper"] .heatmap-section,
[data-theme="paper"] .recent-section {
    background-image: linear-gradient(0deg, transparent 24px, rgba(180,160,140,0.06) 25px) !important;
    border-color: rgba(180,160,140,0.25) !important;
}

/* ===== 全局字体颜色跟随主题 ===== */
.stat-value,
.stat-number {
    color: var(--text-primary) !important;
}

.stat-label,
.stat-name {
    color: var(--text-secondary) !important;
}

h3, h4, .section-header h4 {
    color: var(--text-primary) !important;
}

h3 i, h4 i {
    color: var(--theme-primary) !important;
}
