.flip-clock-integration {
    --fc-bg: var(--bg-card, #ffffff);
    --fc-text: var(--text-main, #333333);
    --fc-date: var(--text-muted, #666666);
    --fc-card-bg: var(--bg-themed, #e0e0e0);
    --fc-card-grad-top: linear-gradient(to bottom, var(--bg-card, #ffffff) 0%, var(--bg-themed, #eeeeee) 100%);
    --fc-card-grad-btm: linear-gradient(to top, var(--bg-card, #ffffff) 0%, var(--bg-themed, #eeeeee) 100%);

    --fc-divider: var(--text-main, #333333);
    --fc-highlight: rgba(255, 255, 255, 0.1);
    --fc-shadow: rgba(0, 0, 0, 0.15);
    --fc-flap-shadow: rgba(0, 0, 0, 0.8);
    --fc-btn-bg: var(--bg-themed, rgba(0, 0, 0, 0.05));
    --fc-btn-border: var(--border-main, rgba(0, 0, 0, 0.1));
    --fc-btn-hover: var(--border-main, rgba(0, 0, 0, 0.1));
    --fc-btn-icon: var(--text-main, #333333);
}

[data-theme="dark"] .flip-clock-integration,
[data-theme="night"] .flip-clock-integration,
[data-theme="deep-blue"] .flip-clock-integration {
    --fc-text: #d4d4d4;
    --fc-card-bg: #2d2d2d;
    --fc-card-grad-top: linear-gradient(to bottom, #333333 0%, #222222 100%);
    --fc-card-grad-btm: linear-gradient(to top, #333333 0%, #222222 100%);
    --fc-highlight: rgba(255, 255, 255, 0.05);
    --fc-shadow: rgba(0, 0, 0, 0.5);
    --fc-flap-shadow: black;
}

[data-theme="high-contrast"] .flip-clock-integration {
    --fc-bg: #000;
    --fc-text: #fff;
    --fc-date: #fff;
    --fc-card-bg: #000;
    --fc-card-grad-top: linear-gradient(to bottom, #000, #000);
    --fc-card-grad-btm: linear-gradient(to top, #000, #000);
    --fc-divider: #fff;
    --fc-btn-bg: #000;
    --fc-btn-border: #fff;
    --fc-btn-icon: #fff;
    border: 2px solid #fff;
}

.flip-clock-integration {
    position: relative;
    background-color: var(--fc-bg);
    color: var(--fc-text);
    border-radius: 15px;
    padding: 30px;
    margin: 20px auto;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flip-clock-integration.fc-small {
    padding: 10px;
    margin: 5px auto;
    border-radius: 8px;
    background-color: transparent;
    /* Seamless integration in cards */
    --fc-font-size: 2rem;
    box-shadow: none;
    /* Remove shadow if present in default */
}

.flip-clock-integration:fullscreen {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background-color: var(--fc-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.flip-clock-integration:-webkit-full-screen {
    width: 100%;
    height: 100%;
    background-color: var(--fc-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.fc-date-display {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 24px;
    color: var(--fc-date);
    margin-bottom: 30px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.flip-clock-integration.fc-small .fc-date-display {
    font-size: 0.8rem;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
    text-transform: none;
    /* User requested "Fri, 12. Dec 2025" which is mixed case */
    font-weight: 500;
}

.flip-clock-integration:fullscreen .fc-date-display {
    font-size: 3vw;
    margin-bottom: 4vh;
}

.fc-wrapper {
    display: flex;
    gap: 0.15em;
    font-size: var(--fc-font-size, 10vw);
    perspective: 1000px;
}

/* Cap font size for ultra-wide screens to prevent overflow */
@media (min-width: 1400px) {
    .fc-wrapper {
        font-size: 140px; /* Cap size */
    }
}

/* Responsive adjustments for column-constrained clocks (e.g. in city.html) */
.flip-clock-integration.fc-responsive {
    --fc-font-size: 10vw; /* Keep default 10vw for mobile, fits with padding */
    padding-bottom: 45px; /* Add extra space at bottom for controls to avoid overlap */
}

.flip-clock-integration.fc-responsive .fc-controls {
    bottom: 5px;
    right: 10px;
    gap: 5px;
}

.flip-clock-integration.fc-responsive .fc-btn {
    width: 28px;
    height: 28px;
}

.flip-clock-integration.fc-responsive .fc-btn svg {
    width: 14px;
    height: 14px;
}

@media (min-width: 768px) {
    .flip-clock-integration.fc-responsive {
        --fc-font-size: 3.5vw; /* Fit half-width column safely */
    }
}

@media (min-width: 1400px) {
    /* Override the global cap for responsive clocks in side columns */
    .flip-clock-integration.fc-responsive .fc-wrapper {
        font-size: 60px; /* Cap size for side columns */
    }
}
.flip-clock-integration:fullscreen .fc-wrapper {
    font-size: 10vw;
    max-width: none;
}

/* AM/PM Indicator */
.fc-ampm {
    font-size: var(--fc-font-size, 10vw);
    /* Match clock size roughly or smaller */
    line-height: 1;
    font-weight: 300;
    margin-left: 0.2em;
    color: var(--fc-text);
    opacity: 0;
    /* Hidden by default */
    transform: scale(0);
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-end;
    font-size: 0.4em;
    /* Relative to wrapper font-size */
    padding-bottom: 0.1em;
}

.fc-ampm.visible {
    opacity: 1;
    transform: scale(1);
}

.fc-controls {
    position: absolute;
    bottom: 5px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

.flip-clock-integration.fc-small .fc-controls {
    display: none;
    /* Hide controls for small clocks */
}

.flip-clock-integration:hover .fc-controls {
    opacity: 1;
}

.flip-clock-integration.fc-small .fc-wrapper {
    font-size: 2rem;
}

.flip-clock-integration.fc-small .fc-ampm {
    font-size: 0.8rem;
}

.fc-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--fc-btn-border);
    background-color: var(--fc-btn-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

.fc-btn:hover {
    transform: scale(1.1);
    background-color: var(--fc-btn-hover);
}

.fc-btn svg {
    width: 14px;
    height: 14px;
    fill: var(--fc-btn-icon);
    /* 这里直接引用变量 */
    transition: fill 0.3s;
}

/* Title inside the clock container */
.flip-clock-integration h4 {
    color: var(--fc-text);
    transition: font-size 0.3s, color 0.3s;
    text-align: center;
    width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
}
.flip-clock-integration:fullscreen h4 {
    font-size: clamp(1.25rem, 6vw, 2rem);
    margin-bottom: 3vh;
}
@media (max-width: 767px) and (orientation: portrait) {
    .flip-clock-integration:fullscreen h4 {
        font-size: 1.5rem;
    }
}
.flip-clock-integration:fullscreen h4 img {
    height: 1em !important; /* Use em to scale with the 3rem font-size defined in flip-clock.css */
    width: auto;
    border-radius: 0.1em;
}

/* --- 翻页卡片核心 (保持不变) --- */
.fc-group {
    display: flex;
    gap: 0.08em;
    position: relative;
    perspective: 600px;
}

.fc-divider {
    font-size: 0.6em;
    color: var(--fc-divider);
    margin: 0 0.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    padding-bottom: 0.2em;
}

.fc-card {
    position: relative;
    width: 0.75em;
    height: 1.2em;
    background-color: var(--fc-card-bg);
    border-radius: 0.1em;
    font-size: 1em;
    line-height: 1.2em;
    color: var(--fc-text);
    text-align: center;
    font-weight: bold;
    box-shadow: 0 4px 10px var(--fc-shadow);
    transform-style: preserve-3d;
    transition: color 0.3s, background-color 0.3s;
}

.fc-top,
.fc-btm,
.fc-next-top,
.fc-next-btm {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    overflow: hidden;
    background-color: var(--fc-card-bg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.fc-top,
.fc-next-top {
    top: 0;
    border-radius: 0.1em 0.1em 0 0;
    background: var(--fc-card-grad-top);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transform-origin: bottom;
}

.fc-btm,
.fc-next-btm {
    bottom: 0;
    border-radius: 0 0 0.1em 0.1em;
    background: var(--fc-card-grad-btm);
    border-top: 1px solid var(--fc-highlight);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transform-origin: top;
}

.fc-num-top,
.fc-num-btm {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 0;
    right: 0;
    height: 200%;
    width: 100%;
}

.fc-num-top {
    top: 0;
}

.fc-num-btm {
    top: -100%;
}

.fc-next-btm {
    z-index: 4;
    transform: rotateX(90deg);
}

.fc-top {
    z-index: 3;
}

.fc-btm {
    z-index: 2;
}

.fc-next-top {
    z-index: 1;
}

/* Flipping states */
.fc-card.fc-flipping .fc-top {
    animation: fc-flip-down-top 0.6s ease-in forwards;
}

.fc-card.fc-flipping .fc-next-btm {
    animation: fc-flip-down-btm 0.6s ease-out forwards;
}

@keyframes fc-flip-down-top {
    0% {
        transform: rotateX(0deg);
    }

    50% {
        transform: rotateX(-90deg);
    }

    100% {
        transform: rotateX(-90deg);
    }
}

@keyframes fc-flip-down-btm {
    0% {
        transform: rotateX(90deg);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}

.fc-card.fc-flipping .fc-top::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--fc-flap-shadow);
    opacity: 0;
    animation: fc-shadow-top 0.6s ease-in forwards;
}

.fc-card.fc-flipping .fc-next-btm::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--fc-flap-shadow);
    opacity: 1;
    animation: fc-shadow-btm 0.6s ease-out forwards;
}

@keyframes fc-shadow-top {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0.8;
    }
}

@keyframes fc-shadow-btm {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

/* Holidays Styles */
.holidays-wrapper {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.holiday-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    transition: transform 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.holiday-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.holiday-card.today {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-left: 5px solid #28a745;
}

.holiday-icon-large {
    font-size: 3rem;
    margin-right: 20px;
    animation: bounce 2s infinite;
}

.holiday-content {
    flex: 1;
    text-align: left;
}

.holiday-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #28a745;
    font-weight: 600;
    margin-bottom: 4px;
}

.holiday-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.holiday-wish {
    margin: 5px 0 0;
    color: #666;
    font-style: italic;
}

.upcoming-holidays {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.holiday-card.upcoming {
    padding: 12px 15px;
    border-left: 4px solid #007bff;
}

.holiday-icon-small {
    font-size: 1.8rem;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.holiday-info {
    flex: 1;
    text-align: left;
}

.holiday-name-small {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.holiday-date {
    font-size: 0.9rem;
    color: #888;
}

.holiday-countdown-badge {
    background: #e7f1ff;
    color: #007bff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Dark mode support if needed, based on parent class or media query */
@media (prefers-color-scheme: dark) {
    .holiday-card {
        background: #2d2d2d;
        border-color: #404040;
    }

    .holiday-card.today {
        background: linear-gradient(135deg, #2d2d2d 0%, #333 100%);
    }

    .holiday-name,
    .holiday-name-small {
        color: #e0e0e0;
    }

    .holiday-wish,
    .holiday-date {
        color: #aaa;
    }

    .holiday-countdown-badge {
        background: #1a3a5e;
        color: #4da3ff;
    }
}