/* ============================================================
   🕐 水浒时辰 · 欢迎弹窗（蓝色主题）
   ============================================================ */

/* ---------- 弹窗遮罩 ---------- */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 40, 60, 0.65);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: welcomeFadeIn 0.35s ease;
}
.welcome-overlay.show { display: flex; }
@keyframes welcomeFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- 弹窗主体（淡蓝渐变） ---------- */
.welcome-modal {
    background: linear-gradient(160deg, #f0f8fc 0%, #e0eef6 50%, #d0e4f0 100%);
    border-radius: 28px;
    width: 100%;
    max-width: 400px;
    max-height: 94vh;
    overflow-y: auto;
    padding: 22px 18px 24px;
    position: relative;
    box-shadow:
            0 20px 60px rgba(20, 50, 80, 0.35),
            inset 0 0 0 1.5px rgba(106, 175, 207, 0.55),
            inset 0 0 0 9px rgba(240, 248, 252, 0.7),
            inset 0 0 0 11px rgba(74, 138, 170, 0.4);
    animation: welcomeSlideUp 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes welcomeSlideUp {
    from { transform: translateY(40px) scale(0.94); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}
.welcome-modal::-webkit-scrollbar { width: 4px; }
.welcome-modal::-webkit-scrollbar-thumb {
    background: rgba(106, 175, 207, 0.4);
    border-radius: 4px;
}

/* ---------- 关闭按钮 ---------- */
.welcome-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(106, 175, 207, 0.5);
    border-radius: 50%;
    background: rgba(240, 248, 252, 0.9);
    color: #4a8aaa;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    font-family: inherit;
    z-index: 10;
    padding: 0;
    line-height: 1;
}
.welcome-close:hover {
    background: #4a8aaa;
    color: #fff;
    transform: rotate(90deg);
}

/* ---------- 欢迎词 ---------- */
.welcome-greeting {
    text-align: center;
    padding: 6px 24px 14px;
    position: relative;
}
.welcome-greeting .greet-title {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #2a5a7a;
    letter-spacing: 6px;
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}
.welcome-greeting .greet-line {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.82rem;
    color: #4a7a8a;
    letter-spacing: 2px;
    line-height: 1.8;
    opacity: 0.9;
}
.welcome-greeting .greet-deco {
    display: inline-block;
    color: #6aafcf;
    font-size: 0.7rem;
    letter-spacing: 4px;
    margin: 4px 0;
}

/* ============================================================
   时钟
   ============================================================ */
.clock-wrap {
    --clock-size: 280px;
    --clock-radius: calc(var(--clock-size) / 2);
    --slot-radius: calc(var(--clock-radius) * 0.80);
    --slot-size: 44px;

    position: relative;
    width: var(--clock-size);
    height: var(--clock-size);
    margin: 6px auto 16px;
    border-radius: 50%;

    /* 默认淡蓝，JS 会按当前时辰覆盖 */
    background: radial-gradient(circle at 50% 45%, #f0f8fc 0%, #d0e4f0 70%, #b0d0e0 100%);

    box-shadow:
            inset 0 0 0 2px rgba(74, 138, 170, 0.7),
            inset 0 0 0 8px rgba(240, 248, 252, 0.75),
            inset 0 0 0 10px rgba(74, 138, 170, 0.5),
            inset 0 0 30px rgba(74, 138, 170, 0.15),
            0 6px 24px rgba(74, 138, 170, 0.18);
    transition: background 1.6s ease, box-shadow 1.6s ease;
}

.clock-wrap::before {
    content: '';
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 55%, rgba(74, 138, 170, 0.08) 100%);
    pointer-events: none;
}

/* ---------- 12 时辰槽位 ---------- */
.clock-slot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--slot-size);
    height: var(--slot-size);
    margin-left: calc(var(--slot-size) / -2);
    margin-top: calc(var(--slot-size) / -2);
    transform:
            rotate(calc(var(--i) * 30deg))
            translate(0, calc(var(--slot-radius) * -1))
            rotate(calc(var(--i) * -30deg));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.clock-slot .slot-avatar {
    width: var(--slot-size);
    height: var(--slot-size);
    border-radius: 50%;
    overflow: hidden;
    background: rgba(240, 248, 252, 0.95);
    box-shadow:
            0 0 0 2px #4a8aaa,
            0 0 0 4px rgba(240, 248, 252, 0.9),
            0 0 0 5px rgba(106, 175, 207, 0.55),
            0 2px 6px rgba(74, 138, 170, 0.25);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.clock-slot:hover .slot-avatar {
    transform: scale(1.08);
}
.clock-slot .slot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.clock-slot .slot-avatar .fallback {
    font-size: 1.4rem;
    color: #4a8aaa;
    opacity: 0.6;
}

.clock-slot .slot-label {
    position: absolute;
    top: 50%;
    left: 50%;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #2a5a7a;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 1px 2px rgba(240, 248, 252, 0.9);
    transform: translate(-50%, -50%)
    translateY(calc(var(--slot-size) / 2 + 12px));
    z-index: 4;
}

/* ---------- 整点报时 ---------- */
.clock-slot.chime .slot-avatar {
    animation: slotChime 2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
            0 0 0 2px #d4a860,
            0 0 0 6px rgba(212, 168, 96, 0.45),
            0 0 0 12px rgba(212, 168, 96, 0.2),
            0 0 20px 6px rgba(212, 168, 96, 0.5);
}
@keyframes slotChime {
    0%   { transform: scale(1); }
    15%  { transform: scale(1.35); }
    30%  { transform: scale(1.25); }
    45%  { transform: scale(1.35); }
    60%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ============================================================
   指针 · SVG 武器（蓝色调）
   ============================================================ */
.clock-hand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: 50% 100%;
    transform: translate(-50%, -100%) rotate(0deg);
    pointer-events: none;
    z-index: 6;
    filter: drop-shadow(0 2px 3px rgba(40, 80, 110, 0.35));
    will-change: transform;
}
.clock-hand svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.clock-hand.hour-hand {
    width: 18px;
    height: 82px;
    transition: transform 0.5s cubic-bezier(0.4, 2.2, 0.6, 1);
}
.clock-hand.minute-hand {
    width: 16px;
    height: 116px;
    transition: transform 0.5s cubic-bezier(0.4, 2.2, 0.6, 1);
    z-index: 7;
}
.clock-hand.second-hand {
    width: 12px;
    height: 138px;
    transition: transform 0.15s cubic-bezier(0.4, 2.4, 0.6, 1);
    z-index: 8;
    filter: drop-shadow(0 0 5px rgba(143, 196, 220, 0.7));
}

/* ---------- 中心印章 ---------- */
.clock-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #8fc4dc 0%, #4a8aaa 100%);
    box-shadow:
            0 0 0 3px rgba(240, 248, 252, 0.9),
            0 0 0 4.5px rgba(74, 138, 170, 0.6),
            0 2px 10px rgba(74, 138, 170, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #f0f8fc;
    z-index: 10;
    user-select: none;
}

/* ============================================================
   电子时间 + 宜忌
   ============================================================ */
.clock-digital {
    text-align: center;
    margin-bottom: 16px;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 800;
    color: #2a5a7a;
    letter-spacing: 4px;
    text-shadow: 0 1px 2px rgba(240, 248, 252, 0.9);
}
.clock-digital .clock-date {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: #6a9aaa;
    letter-spacing: 3px;
    margin-top: 4px;
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
}

/* ---------- 宜忌 ---------- */
.fortune-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}
.fortune-box {
    background: rgba(240, 248, 252, 0.85);
    border-radius: 14px;
    padding: 10px 10px 12px;
    border: 1px solid rgba(106, 175, 207, 0.3);
    position: relative;
    overflow: hidden;
}
.fortune-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
}
.fortune-box.yi::before { background: linear-gradient(90deg, #4a8aaa, #6aafcf, #4a8aaa); }
.fortune-box.ji::before { background: linear-gradient(90deg, #c0392b, #e07060, #c0392b); }

.fortune-box .fb-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(106, 175, 207, 0.3);
}
.fortune-box .fb-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.fortune-box.yi .fb-icon { background: #4a8aaa; }
.fortune-box.ji .fb-icon { background: #c0392b; }
.fortune-box .fb-title {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #2a5a7a;
    letter-spacing: 3px;
}
.fortune-box .fb-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.fortune-box .fb-item {
    font-family: 'STKaiti', 'KaiTi', '楷体', serif;
    font-size: 0.85rem;
    color: #2a4a5a;
    padding: 3px 8px;
    background: rgba(106, 175, 207, 0.08);
    border-radius: 8px;
    letter-spacing: 2px;
    border-left: 2px solid transparent;
}
.fortune-box.yi .fb-item { border-left-color: rgba(74, 138, 170, 0.7); }
.fortune-box.ji .fb-item {
    border-left-color: rgba(192, 57, 43, 0.7);
    background: rgba(192, 57, 43, 0.05);
}

/* ---------- 底部按钮 ---------- */
.welcome-actions {
    text-align: center;
    margin-top: 18px;
}
.welcome-btn {
    display: inline-block;
    padding: 10px 44px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(135deg, #6aafcf, #4a8aaa);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 4px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 6px 20px rgba(74, 138, 170, 0.35);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.welcome-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 28px rgba(74, 138, 170, 0.5);
}
.welcome-btn:active {
    transform: scale(0.97);
}

/* ============================================================
   右下角悬浮按钮
   ============================================================ */
.welcome-fab {
    position: fixed;
    bottom: 70px;
    right: 16px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(106, 175, 207, 0.5);
    background: linear-gradient(135deg, #f0f8fc, #d0e4f0);
    color: #4a8aaa;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74, 138, 170, 0.25);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.welcome-fab:hover {
    transform: translateY(-3px) scale(1.08) rotate(-8deg);
    box-shadow: 0 8px 24px rgba(74, 138, 170, 0.4);
    border-color: #6aafcf;
}
.welcome-fab:active {
    transform: scale(0.92);
}
.welcome-fab::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(106, 175, 207, 0.35);
    animation: fabPulse 2.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes fabPulse {
    0%, 100% { transform: scale(1);   opacity: 0.5; }
    50%      { transform: scale(1.2); opacity: 0; }
}

/* 深色模式 */
body.dark-mode .welcome-fab {
    background: linear-gradient(135deg, #2a4a5a, #1a3a4a);
    color: #8fc4dc;
    border-color: rgba(106, 175, 207, 0.4);
}

/* 深色模式下的弹窗（整体不变，只微调） */
body.dark-mode .welcome-modal {
    background: linear-gradient(160deg, #e8f2f8 0%, #d8e8f2 50%, #c8dcea 100%);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 420px) {
    .welcome-modal {
        padding: 20px 14px 22px;
        border-radius: 24px;
        max-width: 94vw;
    }
    .clock-wrap {
        --clock-size: 248px;
        --slot-size: 38px;
    }
    .clock-hand.hour-hand   { width: 15px; height: 72px; }
    .clock-hand.minute-hand { width: 13px; height: 102px; }
    .clock-hand.second-hand { width: 10px; height: 122px; }
    .clock-slot .slot-label {
        font-size: 0.78rem;
        transform: translate(-50%, -50%)
        translateY(calc(var(--slot-size) / 2 + 10px));
    }
    .clock-center { width: 30px; height: 30px; font-size: 0.9rem; }
    .clock-digital { font-size: 1.25rem; }
    .welcome-greeting .greet-title { font-size: 1.15rem; letter-spacing: 4px; }
    .welcome-greeting .greet-line { font-size: 0.75rem; }
    .fortune-box .fb-item { font-size: 0.75rem; }
    .welcome-fab {
        width: 42px;
        height: 42px;
        font-size: 1.15rem;
        bottom: 66px;
        right: 12px;
    }
}

@media (max-height: 780px) {
    .clock-wrap {
        --clock-size: 240px;
        --slot-size: 38px;
    }
    .clock-hand.hour-hand   { height: 70px; }
    .clock-hand.minute-hand { height: 98px; }
    .clock-hand.second-hand { height: 118px; }
}