/* 基础配色系统 */
:root {
    /* 主题色 */
    --brand-primary: #ff9500;  /* 温暖的橙色，代表早晨5:30的阳光 */
    
    /* 浅色模式默认值 */
    --bg-primary: #f5f5f7;     /* 页面背景 */
    --bg-secondary: #ffffff;    /* 卡片背景 */
    --bg-tertiary: #f5f5f7;    /* 热度标签背景 */
    
    --text-primary: #1d1d1f;   /* 主要文字 */
    --text-secondary: #666666; /* 次要文字 */
    --text-tertiary: #999999;  /* 提示文字 */
    
    --border-color: rgba(0,0,0,0.1);
    --shadow-color: rgba(0,0,0,0.05);
    
    /* 交互状态 */
    --hover-bg: rgba(0,0,0,0.02);
    --active-bg: rgba(0,0,0,0.05);
    
    /* 字体系统 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* 字体大小 */
    --font-xs: 0.75rem;    /* 12px */
    --font-sm: 0.875rem;   /* 14px */
    --font-base: 1rem;     /* 16px */
    --font-lg: 1.125rem;   /* 18px */
    --font-xl: 1.25rem;    /* 20px */
    --font-2xl: 1.5rem;    /* 24px */
    --font-3xl: 2rem;      /* 32px */
    
    /* 字重 */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* 行高 */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    
    /* 字间距 */
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --brand-primary: #ff9f0a;  /* 深色模式下略微调亮 */
        
        --bg-primary: #1d1d1f;
        --bg-secondary: #2c2c2e;
        --bg-tertiary: #3a3a3c;
        
        --text-primary: #f5f5f7;
        --text-secondary: #a1a1a6;
        --text-tertiary: #666668;
        
        --border-color: rgba(255,255,255,0.1);
        --shadow-color: rgba(0,0,0,0.2);
        
        --hover-bg: rgba(255,255,255,0.05);
        --active-bg: rgba(255,255,255,0.1);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

h1 {
    font-size: var(--font-3xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--spacing-md);
    letter-spacing: var(--tracking-wide);
    line-height: var(--leading-tight);
}

.update-time {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: var(--font-normal);
    letter-spacing: var(--tracking-normal);
}

.news-item {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: transform 0.2s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.news-item:hover {
    transform: translateY(-2px);
}

.news-title {
    font-size: var(--font-base);
    line-height: var(--leading-normal);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.news-hot {
    font-size: var(--font-xs);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    white-space: nowrap;
    background: var(--bg-tertiary);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    letter-spacing: var(--tracking-wide);
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-secondary);
    font-size: var(--font-sm);
    letter-spacing: var(--tracking-wide);
}

.loading-spinner {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading-spinner p {
    color: var(--text-secondary);
    margin-top: 1rem;
    font-size: var(--font-sm);
    font-weight: var(--font-medium);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--text-tertiary);
    border-top: 3px solid var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.news-container {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.news-container.visible {
    opacity: 1;
}

@media (max-width: 640px) {
    .container {
        padding: 0.8rem;
    }

    .news-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.6rem 0.8rem;
        margin-bottom: 0.5rem;
    }

    .news-hot {
        align-self: flex-start;
        font-size: var(--font-xs);
        padding: 0.15rem 0.5rem;
        margin-top: 0.2rem;
        background: var(--bg-tertiary);
    }

    .news-title {
        font-size: var(--font-sm);
        line-height: 1.4;
    }

    h1 {
        font-size: 2rem;
    }

    :root {
        /* 移动端稍微调小字体比例 */
        --font-3xl: 1.75rem;  /* 28px */
        --font-2xl: 1.375rem; /* 22px */
        --font-xl: 1.125rem;  /* 18px */
    }

    header {
        margin-bottom: 1.5rem;
    }
} 

/* 主题切换按钮样式 */
.theme-toggle {
    position: absolute;  /* 绝对定位 */
    right: 0;           /* 靠右对齐 */
    top: 0;             /* 顶部对齐 */
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
}

.theme-toggle-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* 深色模式图标控制 */
.theme-toggle .sun {
    display: none;
}

.theme-toggle .moon {
    display: block;
}

/* 深色模式下切换图标显示 */
[data-theme="dark"] .theme-toggle .sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon {
    display: none;
}

/* 修改深色模式判断 */
[data-theme="dark"] {
    --brand-primary: #ff9f0a;
    --bg-primary: #1d1d1f;
    --bg-secondary: #2c2c2e;
    --bg-tertiary: #3a3a3c;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #666668;
    --border-color: rgba(255,255,255,0.1);
    --shadow-color: rgba(0,0,0,0.2);
    --hover-bg: rgba(255,255,255,0.05);
    --active-bg: rgba(255,255,255,0.1);
}

/* Logo样式 */
.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.clock-logo {
    color: var(--text-primary);
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
}

/* 添加简单的动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.logo:hover .clock-logo {
    animation: pulse 1.5s ease infinite;
}

/* 调整标题样式 */
.logo h1 {
    margin: 0;  /* 移除之前的margin */
}

/* 调整header布局 */
header {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .clock-logo {
        width: 40px;
        height: 40px;
    }
}

/* 移动端适配 */
@media (max-width: 640px) {
    .theme-toggle {
        padding: 0.3rem;  /* 移动端减小内边距 */
    }
}

.datetime {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin-top: 0.3rem;
}

/* 删除这部分，让时间使用和日期一样的字体 */
/* .datetime .time {
    font-family: var(--font-family);
    color: var(--text-primary);
} */
  