/* =========================================
   [网页基底样式] webbase.css
   负责定义配色、深浅模式变量和基础布局
   ========================================= */

:root {
    /* === 默认浅色模式变量 (Light Mode Variables) === */
    --primary-color: #2563eb;       /* 主色调：蓝色 */
    --bg-color: transparent;        /* 背景透明，让动效透出来 */
    --card-bg: rgba(255, 255, 255, 0.85); /* 卡片背景：半透明白色 */
    --card-border: rgba(226, 232, 240, 0.8);
    --text-main: #0f172a;           /* 主要文字颜色：深黑蓝 */
    --text-sub: #64748b;            /* 次要文字颜色：灰色 */
    --border-color: #e2e8f0;
    --btn-hover: #f1f5f9;
    --backdrop-blur: 10px;          /* 毛玻璃模糊程度 */
}

/* === 深色模式变量 (Dark Mode Overrides) === */
body.dark-mode {
    --primary-color: #60a5fa;       /* 深色模式下的主色调：浅蓝色 */
    --card-bg: rgba(30, 41, 59, 0.7); /* 深色卡片背景 */
    --card-border: rgba(51, 65, 85, 0.8);
    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    --border-color: #334155;
    --btn-hover: rgba(255, 255, 255, 0.1);
}

/* === 基础重置 === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    color: var(--text-main);
    padding: 20px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: color 0.3s ease;
}

/* === Canvas 背景层样式 (必须) === */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #f5f7fa; 
    transition: background-color 0.5s ease;
}

body.dark-mode #bg-canvas {
    background-color: #0f1115;
}

/* === 通用容器 (Container) === */
.container {
    max-width: 800px; /* 稍微放宽一点，适配更多内容 */
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* === 头部 (Header) === */
header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* === 主题切换按钮 (Theme Toggle) === */
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(var(--backdrop-blur));
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--btn-hover);
    transform: scale(1.05);
}

/* === 页脚 (Footer) === */
footer {
    padding-top: 20px;
    margin-top: auto;
    border-top: 1px dashed var(--border-color);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-sub);
    font-family: 'SF Mono', 'Roboto Mono', 'Menlo', monospace;
    text-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted var(--text-sub);
    transition: color 0.2s;
}

footer a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}