/* ================================================================
   base.css —— 全局基础样式 + 星辉主题（默认基底）
   ================================================================ */

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

body {
    background: #04060f;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Orbitron', 'Courier New', monospace;
    overflow: hidden;
    color: #fff;
    transition: background-color 0.6s ease;
}

/* ========== Canvas 背景 ========== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== 时钟容器 ========== */
.clock-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 20px;
}

/* 日期 */
.date-display {
    font-size: 18px;
    letter-spacing: 4px;
    color: rgba(140, 180, 230, 0.6);
    text-shadow: 0 0 20px rgba(60, 120, 255, 0.15);
    font-weight: 300;
    background: rgba(4, 6, 15, 0.6);
    padding: 8px 28px;
    border-radius: 30px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: color .5s ease, background .5s ease, border-color .5s ease, text-shadow .5s ease;
}

/* ========== 时钟主体 ========== */
.clock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(4, 6, 15, 0.65);
    padding: 30px 40px;
    border-radius: 28px;
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9), inset 0 0 80px rgba(40, 80, 200, 0.04);
    flex-wrap: wrap;
    justify-content: center;
    transition: background .5s ease, border-color .5s ease, box-shadow .5s ease;
}

/* ========== 每个数字位 ========== */
.flip-unit {
    position: relative;
    width: 82px;
    height: 120px;
    perspective: 900px;
    flex-shrink: 0;
}

/* 3D 卡片容器 */
.flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 14px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}

/* 正面 & 背面 */
.flip-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0e1628, #060a18);
    border: 1px solid rgba(80, 150, 255, 0.10);
    box-shadow: inset 0 0 40px rgba(40, 80, 200, 0.04);
    overflow: hidden;
    transition: background .5s ease, border-color .5s ease, box-shadow .5s ease;
}

.flip-front { transform: rotateX(0deg); }

.flip-back {
    transform: rotateX(180deg);
    background: linear-gradient(145deg, #0a1222, #040810);
}

/* ===== 数字样式 ===== */
.digit {
    font-size: 92px;
    font-weight: 700;
    line-height: 1;
    font-family: 'Orbitron', 'Courier New', monospace;
    color: #7ab8ff;
    text-shadow:
        0 0 12px rgba(80, 160, 255, 0.45),
        0 0 30px rgba(60, 140, 255, 0.25),
        0 0 60px rgba(40, 100, 255, 0.10);
    transition: text-shadow 0.3s ease, color .5s ease;
}

/* 翻转过程中发光增强 */
.flip-card.flipping .digit {
    text-shadow:
        0 0 18px rgba(100, 190, 255, 0.7),
        0 0 50px rgba(80, 170, 255, 0.4),
        0 0 90px rgba(60, 140, 255, 0.2);
}

/* ========== 分割线 ========== */
.flip-unit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 6%;
    right: 6%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(100, 180, 255, 0.25), rgba(120, 200, 255, 0.5), rgba(100, 180, 255, 0.25), transparent);
    transform: translateY(-50%);
    z-index: 10;
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(60, 160, 255, 0.15);
    pointer-events: none;
    opacity: 0.6;
    transition: background .5s ease, box-shadow .5s ease;
}

.flip-unit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 6px;
    background: radial-gradient(ellipse at center, rgba(80, 160, 255, 0.10) 0%, transparent 70%);
    transform: translateY(-50%);
    z-index: 9;
    pointer-events: none;
    filter: blur(4px);
    opacity: 0.4;
}

/* ========== 冒号分隔符 ========== */
.colon {
    font-size: 64px;
    font-weight: 300;
    color: rgba(140, 190, 255, 0.5);
    text-shadow: 0 0 30px rgba(60, 140, 255, 0.15);
    padding: 0 4px;
    font-family: 'Orbitron', 'Courier New', monospace;
    animation: colonPulse 1.2s ease-in-out infinite alternate;
    line-height: 1;
    margin-top: -10px;
}

@keyframes colonPulse {
    0% {
        opacity: 0.3;
        text-shadow: 0 0 10px rgba(60, 140, 255, 0.10);
    }
    100% {
        opacity: 0.9;
        text-shadow: 0 0 40px rgba(80, 180, 255, 0.35);
    }
}

/* ========== 圆形悬浮按钮（全屏 / 设置） ========== */
.fullscreen-btn,
.settings-btn {
    position: fixed;
    z-index: 100;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(10, 18, 40, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(180, 210, 255, 0.7);
    cursor: pointer;
    transition: all 0.35s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    outline: none;
    font-family: 'Segoe UI', sans-serif;
}

.fullscreen-btn {
    bottom: 36px;
    right: 36px;
    font-size: 26px;
}

.settings-btn {
    bottom: 36px;
    left: 36px;
    font-size: 24px;
}

.fullscreen-btn:hover,
.settings-btn:hover {
    background: rgba(30, 60, 130, 0.6);
    border-color: rgba(100, 180, 255, 0.25);
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(60, 140, 255, 0.15);
    color: #fff;
}

.fullscreen-btn:active,
.settings-btn:active {
    transform: scale(0.92);
}

.settings-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.settings-btn.active svg {
    transform: rotate(180deg);
}

.fullscreen-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* ========== 设置面板 ========== */
.settings-panel {
    position: fixed;
    bottom: 108px;
    left: 36px;
    z-index: 100;
    width: 262px;
    padding: 18px 18px 14px;
    border-radius: 20px;
    background: rgba(8, 14, 30, 0.86);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(120, 170, 255, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: translateY(14px) scale(0.94);
    transform-origin: bottom left;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2),
                background .5s ease, border-color .5s ease, box-shadow .5s ease;
}

.settings-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.panel-title {
    font-size: 12px;
    letter-spacing: 6px;
    font-weight: 500;
    color: rgba(150, 190, 255, 0.55);
    margin-bottom: 14px;
    padding-left: 2px;
}

.panel-label {
    font-size: 11px;
    letter-spacing: 3px;
    color: rgba(140, 175, 230, 0.45);
    margin-bottom: 9px;
    padding-left: 2px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(200, 220, 255, 0.78);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 1.5px;
    outline: none;
    text-align: left;
}

.theme-option:last-child {
    margin-bottom: 0;
}

.theme-option:hover {
    background: rgba(80, 140, 255, 0.10);
    border-color: rgba(100, 180, 255, 0.30);
    color: #fff;
}

.theme-option.is-active {
    border-color: rgba(100, 180, 255, 0.55);
    background: rgba(60, 120, 255, 0.16);
    color: #fff;
    box-shadow: 0 0 22px rgba(70, 140, 255, 0.18);
}

.theme-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}

.swatch-geo {
    background: linear-gradient(135deg, #6b8cc7 0%, #8b7fd4 55%, #5fb8b8 100%);
    box-shadow: 0 0 12px rgba(107, 140, 199, 0.7), 0 0 22px rgba(139, 127, 212, 0.4);
}

.swatch-star {
    background: radial-gradient(circle at 32% 32%, #dcecff, #2b5fd9 60%, #0a1230);
    box-shadow: 0 0 12px rgba(90, 160, 255, 0.7);
}

.swatch-cyber {
    background: linear-gradient(135deg, #00f5ff 0%, #ff00aa 55%, #ffd600 100%);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.8), 0 0 22px rgba(255, 0, 170, 0.5);
}

.swatch-light {
    background: linear-gradient(135deg, #ffffff 0%, #a8cff2 55%, #5e9ede 100%);
    box-shadow: 0 0 12px rgba(120, 175, 235, 0.7);
}

.swatch-rain {
    background: linear-gradient(160deg, #4a6fa5 0%, #1a2438 55%, #070b16 100%);
    box-shadow: 0 0 12px rgba(110, 155, 215, 0.6);
}

.swatch-delta {
    background: linear-gradient(135deg, #f0b245 0%, #4a5a34 55%, #0b0e09 100%);
    box-shadow: 0 0 12px rgba(240, 178, 69, 0.6);
}

.swatch-night {
    background: linear-gradient(135deg, #dcecff 0%, #16233f 45%, #060a18 100%);
    box-shadow: 0 0 12px rgba(110, 175, 245, 0.65);
}

.swatch-hill {
    background: linear-gradient(180deg, #dfe9fa 0%, #283450 40%, #0a1120 100%);
    box-shadow: 0 0 12px rgba(150, 185, 240, 0.60);
}

.swatch-model {
    background: linear-gradient(180deg, #eef4fd 0%, #bcd4ee 55%, #7fa8d4 100%);
    box-shadow: 0 0 12px rgba(120, 160, 215, 0.60);
}

.swatch-modelnight {
    background: linear-gradient(180deg, #1a2740 0%, #0d1626 55%, #060a14 100%);
    box-shadow: 0 0 12px rgba(90, 130, 190, 0.60);
}

.swatch-cat {
    background:
        radial-gradient(circle at 30% 35%, rgba(230, 230, 235, 0.9) 0 12%, transparent 13%),
        radial-gradient(circle at 70% 65%, rgba(230, 230, 235, 0.7) 0 10%, transparent 11%),
        linear-gradient(180deg, #26262e 0%, #141419 100%);
    box-shadow: 0 0 12px rgba(210, 210, 220, 0.45);
}

.theme-name {
    flex: 1;
}

.theme-check {
    opacity: 0;
    color: #7ab8ff;
    font-size: 13px;
    transition: opacity 0.25s ease;
}

.theme-option.is-active .theme-check {
    opacity: 1;
}

/* ========== 全屏状态 ========== */
.clock-wrapper.is-fullscreen .clock {
    padding: 40px 60px;
    gap: 18px;
    border-radius: 32px;
}

.clock-wrapper.is-fullscreen .flip-unit {
    width: 110px;
    height: 160px;
}

.clock-wrapper.is-fullscreen .digit {
    font-size: 126px;
}

.clock-wrapper.is-fullscreen .colon {
    font-size: 80px;
    padding: 0 8px;
}

.clock-wrapper.is-fullscreen .date-display {
    font-size: 22px;
    padding: 10px 36px;
}

/* ========== 响应式 ========== */
@media (max-width: 720px) {
    .clock {
        padding: 20px 18px;
        gap: 6px;
        border-radius: 18px;
    }
    .flip-unit {
        width: 52px;
        height: 76px;
    }
    .digit {
        font-size: 58px;
    }
    .colon {
        font-size: 40px;
        padding: 0 2px;
    }
    .date-display {
        font-size: 13px;
        padding: 5px 16px;
        letter-spacing: 2px;
    }
    .fullscreen-btn,
    .settings-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
        bottom: 20px;
    }
    .fullscreen-btn {
        right: 20px;
    }
    .settings-btn {
        left: 20px;
    }
    .fullscreen-btn svg {
        width: 22px;
        height: 22px;
    }
    .settings-btn svg {
        width: 21px;
        height: 21px;
    }
    .settings-panel {
        left: 20px;
        bottom: 78px;
        width: 226px;
        padding: 14px;
    }
    .clock-wrapper.is-fullscreen .flip-unit {
        width: 70px;
        height: 100px;
    }
    .clock-wrapper.is-fullscreen .digit {
        font-size: 78px;
    }
    .clock-wrapper.is-fullscreen .colon {
        font-size: 52px;
    }
    .clock-wrapper.is-fullscreen .clock {
        padding: 24px 16px;
        gap: 8px;
    }
}

@media (max-width: 440px) {
    .flip-unit {
        width: 38px;
        height: 56px;
    }
    .digit {
        font-size: 42px;
    }
    .colon {
        font-size: 28px;
    }
    .clock {
        padding: 14px 10px;
        gap: 4px;
        border-radius: 14px;
    }
    .date-display {
        font-size: 11px;
        padding: 4px 12px;
    }
    .clock-wrapper.is-fullscreen .flip-unit {
        width: 50px;
        height: 72px;
    }
    .clock-wrapper.is-fullscreen .digit {
        font-size: 56px;
    }
    .clock-wrapper.is-fullscreen .colon {
        font-size: 36px;
    }
    .clock-wrapper.is-fullscreen .clock {
        padding: 16px 10px;
        gap: 4px;
    }
}

/* ========== 翻转状态重置 ========== */
.flip-card:not(.flipping) {
    transition: transform 0s;
}

/* ========== 加载闪屏 ========== */
.loading-shimmer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #04060f;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(140, 180, 230, 0.15);
    font-family: 'Orbitron', monospace;
    letter-spacing: 8px;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.loading-shimmer.hide {
    opacity: 0;
}
