/* ==========================================================================
1. 变量模块 (Variables)
========================================================================== */
:root {
    --primary-color: #4052b5;
    --text-primary: #1d1d1f;
    --text-regular: #444446;

    --bg-color: transparent;
    --bg-gradient: linear-gradient(135deg, rgba(253, 251, 251, 0.4) 0%, rgba(235, 237, 238, 0.4) 100%);

    --glass-bg: rgba(255, 255, 255, 0.40);
    --glass-bg-strong: rgba(255, 255, 255, 0.50);
    --glass-btn-bg: rgba(255, 255, 255, 0.35);
    --glass-border: 1px solid rgba(255, 255, 255, 0.40);
    --glass-shadow: 0 10px 26px rgba(15, 18, 32, 0.08);
    --glass-blur: 8px; /* 降低容器毛玻璃模糊程度 */
    --glass-blur-soft: 4px; /* 降低按钮等小组件的模糊程度 */

    --max-width: 800px;
    --radius-lg: 24px;
    --radius-pill: 40px;
}
/* 暗黑模式变量 */
html.dark {
    --bg-color: transparent;
    --bg-gradient: linear-gradient(135deg, rgba(22, 24, 33, 0.4) 0%, rgba(11, 13, 18, 0.4) 100%);
    --text-primary: #ffffff;
    --text-regular: #ebebee;
    --glass-bg: rgba(23, 26, 34, 0.45);
    --glass-bg-strong: rgba(19, 22, 30, 0.55);
    --glass-btn-bg: rgba(255, 255, 255, 0.08);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
2. 基础模块 (Base Reset & Transitions)
========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.bg-wrapper {
    position: fixed;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: -50px;
    z-index: -1;
    background-image: url('../bg-image');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.9;
    transition: opacity 0.5s ease;
}

html.dark .bg-wrapper {
    opacity: 0.4;
}

html,
body {
    min-height: 100vh;
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: "Avenir Next", "SF Pro Display", "PingFang SC", sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s cubic-bezier(0.22, 1, 0.36, 1), color 0.4s ease;
}

body {
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
3. 布局与主题切换按钮模块 (Layout & Theme Toggle)
========================================================================== */
.page-container {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.header-title {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.theme-toggle-wrap {
    position: absolute;
    top: 16px;
    right: 20px;
}

.btn-circle {
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    user-select: none;
}

/* 修复图标显示冲突：提升权重并严格控制 display */
.btn-circle .icon-sun,
.btn-circle .icon-moon {
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 默认状态：亮色模式 */
.btn-circle .icon-sun {
    display: none;
}

.btn-circle .icon-moon {
    display: inline-block;
}

/* 暗黑模式状态 */
html.dark .btn-circle .icon-sun {
    display: inline-block;
}

html.dark .btn-circle .icon-moon {
    display: none;
}

/* 点击动画反馈 */
.btn-circle:active .icon-sun,
.btn-circle:active .icon-moon {
    transform: scale(0.75) rotate(-25deg);
}

/* ==========================================================================
4. 组件模块 (Components)
========================================================================== */
.glass-panel {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 24px 30px;
    transition: transform 0.3s ease, background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
}

.hitokoto-panel {
    text-align: center;
    margin-top: auto;
    margin-bottom: 0;
    align-self: center;
    width: 100%;
    max-width: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hitokoto-text {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 8px;
    line-height: 1.6;
    font-weight: 300;
}

.hitokoto-from {
    font-size: 0.9rem;
    opacity: 0.6;
}

.live-time-panel {
    margin-bottom: 2rem;
    text-align: center;
    padding: 1.5rem 3rem;
    align-self: center;
}

.live-time-text {
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    font-family: monospace;
}

.live-date-text {
    font-size: 0.95rem;
    opacity: 0.7;
    margin-top: 5px;
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    font-weight: normal;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
    padding-bottom: 0.8rem;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.grid-btn-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 24px;
    border-radius: var(--radius-pill);
    background: var(--glass-btn-bg);
    backdrop-filter: blur(var(--glass-blur-soft));
    border: var(--glass-border);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    touch-action: manipulation;
}

.glass-btn-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.btn-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.glass-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
}

html.dark .glass-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
}

.glass-table caption {
    font-size: 18px;
    font-weight: 800;
    text-align: left;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.glass-table td {
    background: rgba(255, 255, 255, 0.3);
    padding: 16px 20px;
    text-align: left;
    transition: background 0.3s;
}

html.dark .glass-table td {
    background: rgba(255, 255, 255, 0.05);
}

.glass-table tr:hover td {
    background: rgba(255, 255, 255, 0.5);
}

html.dark .glass-table tr:hover td {
    background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
5. 底部模块 (Footer)
========================================================================== */
.glass-footer {
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-regular);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(var(--glass-blur-soft));
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

html.dark .glass-footer {
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-footer a {
    color: var(--text-regular);
    text-decoration: none;
    transition: color 0.3s;
}

.glass-footer a:hover {
    color: var(--primary-color);
}

.glass-footer p {
    margin: 4px 0;
}