@font-face {
    font-family: 'Digital Dismay';
    src: url('Digital Dismay.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

/* ===== 基础样式 ===== */
:root {
    --color-red: #ff3b3b;
    --color-green: #00e676;
    --color-orange: #ffab40;
    --color-bg: #0a0a0f;
    --color-surface: rgba(255, 255, 255, 0.03);
    --color-border: rgba(255, 255, 255, 0.08);
    --glow-red: 0 0 20px rgba(255, 59, 59, 0.4), 0 0 40px rgba(255, 59, 59, 0.2);
    --glow-green: 0 0 20px rgba(0, 230, 118, 0.4), 0 0 40px rgba(0, 230, 118, 0.2);
    --glow-orange: 0 0 20px rgba(255, 171, 64, 0.4), 0 0 40px rgba(255, 171, 64, 0.2);
}

body {
    font-family: 'Orbitron', Arial, sans-serif;
    background: var(--color-bg);
    background-image:
        radial-gradient(ellipse at top, rgba(30, 30, 60, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(20, 20, 40, 0.2) 0%, transparent 50%);
    color: white;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
}

/* 主内容包装器 */
#app-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    position: relative;
    z-index: 1;
    padding-bottom: 60px;
    /* 底部空间 */
}

/* 背景暗度遮罩层（使用伪元素覆盖整个内容） */
/* 背景暗度遮罩层（使用伪元素覆盖整个内容） */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-color, rgba(0, 0, 0, 0));
    backdrop-filter: blur(var(--blur-amount, 0px));
    pointer-events: none;
    z-index: 0;
}

/* ===== 时钟容器 ===== */
.clock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    padding: 30px 20px;
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 1;
}

.clock-container:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.project-name {
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1.8em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.project-name:hover {
    background: rgba(255, 255, 255, 0.05);
}

.project-name:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.clocks {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.clock {
    text-align: center;
    margin: 0 20px;
    flex: 1;
}

.clock-divider {
    width: 1px;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(255, 255, 255, 0.15) 20%,
            rgba(255, 255, 255, 0.15) 80%,
            transparent 100%);
    margin: 0 15px;
    align-self: stretch;
    min-height: 100px;
}

/* 时钟标题样式 */
.clock-title {
    font-size: 1em;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    margin: 0;
    /* Margin moved to header */
}

/* 标题容器（包含图标） */
.project-header,
.clock-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    cursor: default;
}

.clock-header {
    margin-bottom: 10px;
}

/* 编辑图标 */
/* 编辑图标 */
.edit-icon {
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 1;
    display: flex;
    /* SVG 居中 */
}

.edit-icon:hover {
    color: var(--color-orange);
    transform: scale(1.1);
}

.edit-icon svg {
    width: 100%;
    height: 100%;
}


.clock-time {
    font-family: 'Digital Dismay', monospace;
    font-size: 6em;
    font-weight: normal;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

/* ===== 时钟颜色与发光效果 ===== */
#startTime .clock-time {
    color: var(--color-red);
    text-shadow: var(--glow-red);
}

#localTime .clock-time {
    color: var(--color-green);
    text-shadow: var(--glow-green);
}

#countdown .clock-time {
    color: var(--color-green);
    text-shadow: var(--glow-green);
}

/* ===== 状态指示器 ===== */
.standby {
    font-size: 1.2em;
    color: var(--color-orange);
    text-shadow: var(--glow-orange);
    animation: pulse 2s ease-in-out infinite;
    letter-spacing: 0.1em;
    margin-top: 10px;
}

.on-air {
    color: var(--color-red);
    text-shadow: var(--glow-red);
    animation: pulse 1s ease-in-out infinite;
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-top: 10px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ===== 按钮样式 ===== */
.buttons {
    position: absolute;
    top: 15px;
    right: 15px;
}

button {
    background: linear-gradient(135deg, #4CAF50 0%, #43A047 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

button:active {
    transform: translateY(0);
}

#resetButton {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

#resetButton:hover {
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.remove-button {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.3);
    box-shadow: none;
}

.remove-button:hover {
    background: rgba(244, 67, 54, 0.4);
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.3);
}

#settingsButton {
    position: fixed !important;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
    backdrop-filter: blur(10px);
    margin: 0;
    /* 防止受 flex 布局影响 */
}

#settingsButton:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-top: 20px;
}

#addClockButton {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 50%;
    font-size: 28px;
    line-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

#resetButton {
    z-index: 1;
}

/* ===== 设置面板 ===== */
#settingsPanel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 25, 0.95);
    padding: 30px;
    border-radius: 16px;
    z-index: 1001;
    display: none;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 100px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
    min-width: 320px;
    backdrop-filter: blur(20px);
}

#settingsPanel h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.4em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

#settingsPanel.light-bg {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a2e;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#settingsPanel label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85em;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

#settingsPanel input[type="range"] {
    width: 100%;
    margin-bottom: 20px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

#settingsPanel input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-green);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

#settingsPanel input[type="file"] {
    display: block;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
}

#settingsPanel select {
    display: block;
    width: 100%;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: inherit;
    font-family: inherit;
    font-size: 0.9em;
    cursor: pointer;
}

#settingsPanel select option {
    background: #1a1a2e;
    color: white;
}

#currentBackgroundImage {
    font-style: italic;
    margin-bottom: 10px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.5);
}

#saveSettings {
    width: 100%;
    margin-top: 10px;
}

.background-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.custom-file-btn,
#removeBackgroundImage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
    line-height: 1;
    height: 42px;
    box-sizing: border-box;
    margin: 0 !important;
    margin-bottom: 0 !important;
    vertical-align: middle;
}

.custom-file-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

#removeBackgroundImage {
    background: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
    border: 1px solid transparent;
    margin-left: 0;
    box-sizing: border-box;
}

#removeBackgroundImage:hover {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
    transform: translateY(-1px);
}

#currentBackgroundImage {
    margin-bottom: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    word-break: break-all;
}

/* ===== 背景遮罩（已改用 body::after 实现，此元素保留用于 JS 兼容） ===== */
#backgroundOverlay {
    display: none;
}

/* ===== 加载动画 ===== */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--color-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.3);
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* ===== 页脚 ===== */
#footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 30px 20px 15px;
    font-size: 0.75em;
    letter-spacing: 0.03em;
}

#footer a {
    color: var(--color-green);
    text-decoration: none;
    transition: all 0.2s ease;
}

#footer a:hover {
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

/* ===== 响应式调整 ===== */
@media (max-width: 1200px) {
    .clock-time {
        font-size: 4.5em;
    }
}

@media (max-width: 768px) {
    .clock-time {
        font-size: 3em;
    }

    .clocks {
        flex-direction: column;
    }

    .clock-divider {
        width: 80%;
        height: 1px;
        margin: 15px auto;
        background: linear-gradient(to right,
                transparent 0%,
                rgba(255, 255, 255, 0.15) 20%,
                rgba(255, 255, 255, 0.15) 80%,
                transparent 100%);
    }
}

/* 全屏模式下隐藏滚动条（使用 JS 控制的 class） */
body.fullscreen-mode {
    overflow: hidden !important;
}

body.fullscreen-mode #app-content {
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body.fullscreen-mode #app-content::-webkit-scrollbar {
    display: none;
}

/* ===== 设置面板开关样式 ===== */
.settings-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    margin: 20px 0;
}

.toggle-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.toggle-setting>label:first-child {
    margin-bottom: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin-bottom: 0 !important;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--color-green);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

/* ===== 演播室深色模式 ===== */
body.dark-mode {
    background: #000000 !important;
    background-image: none !important;
}

body.dark-mode::after {
    display: none !important;
}

body.dark-mode .clock-container {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .clock-container:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ===== 关闭发光效果 ===== */
body.no-glow .clock-time {
    text-shadow: none !important;
}

body.no-glow .clock-container {
    box-shadow: none !important;
}

body.no-glow .status {
    text-shadow: none !important;
}

body.no-glow #settingsButton,
body.no-glow button {
    box-shadow: none !important;
}

/* ===== 时区选择器模态框 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timezone-picker {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.tz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tz-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: white;
}

.tz-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tz-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tz-content {
    padding: 15px;
    max-height: calc(70vh - 80px);
    overflow-y: auto;
}

.tz-region {
    margin-bottom: 15px;
}

.tz-region-title {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px 0;
}

.tz-option {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.tz-option:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.tz-option.selected {
    background: var(--color-green);
    color: white;
}

/* ===== 时区参考显示 ===== */
.local-time-title {
    cursor: pointer;
    transition: color 0.2s ease;
}

.local-time-title:hover {
    color: var(--color-green);
}

.add-tz-hint {
    font-size: 0.8em;
    opacity: 0.5;
    margin-left: 5px;
}

.local-time-title:hover .add-tz-hint {
    opacity: 1;
    color: var(--color-green);
}

.timezone-references {
    margin-top: 10px;
}

.tz-ref-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.9em;
    border-left: 3px solid var(--color-orange);
}

.tz-ref-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tz-ref-name {
    color: rgba(255, 255, 255, 0.7);
}

.tz-ref-offset {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85em;
}

.tz-ref-time {
    font-family: 'Digital Dismay', monospace;
    font-size: 1.2em;
    color: var(--color-orange);
}

.tz-ref-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tz-ref-remove:hover {
    background: rgba(255, 59, 59, 0.2);
    color: var(--color-red);
}

/* ===== 移动端响应式样式 ===== */

/* 平板设备 (max-width: 768px) */
@media screen and (max-width: 768px) {

    /* 禁止水平滚动 */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    body {
        padding: 0;
        margin: 0;
    }

    #app-content {
        padding: 0;
        margin: 0;
        height: 100vh;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        overflow: hidden;
    }

    #clocksContainer {
        flex: 1;
        width: 100%;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
    }

    .clock-container {
        padding: 0;
        border-radius: 0;
        border: none;
        margin: 0;
        height: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
        overflow: hidden;
    }

    .project-header {
        justify-content: center;
        margin-bottom: 5px;
    }

    .clocks {
        flex-direction: column;
        gap: 3vh;
        /* 减少间距腾出空间给超大字体 */
        flex: 1;
        justify-content: center;
        width: 100%;
        align-items: center;
    }

    .clock {
        margin: 0;
        width: 100%;
        padding: 5px 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        flex: 0 0 auto;
    }

    /* 移动端隐藏分隔线 */
    .clock-divider {
        display: none;
    }

    /* 终极超大字体：如图所示 */
    .clock-time {
        font-size: 24vw !important;
        /* 终极填充 */
        text-align: center;
        width: 100%;
        display: block;
        letter-spacing: -0.04em;
        /* 微收字距以防换行 */
        line-height: 0.9;
        /* 紧凑行高 */
        white-space: nowrap;
        padding: 0;
        margin: 0;
    }

    .project-name {
        font-size: 1.2em;
        margin-bottom: 5px;
        text-align: center;
    }

    .clock-title {
        text-align: center;
        margin-bottom: 0;
        font-size: 0.9em;
    }

    .status {
        text-align: center;
    }

    #settingsButton {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 12px;
        z-index: 1001;
    }

    #settingsPanel {
        position: fixed;
        width: 100%;
        max-width: 100%;
        left: 0;
        right: 0;
        top: 50px;
        bottom: 0;
        max-height: none;
        height: calc(100vh - 50px);
        overflow-y: auto;
        border-radius: 0;
        padding: 20px;
        box-sizing: border-box;
        z-index: 1000;
        transform: none !important;
        /* 重置 PC 端的居中偏移 */
    }

    #settingsPanel h2 {
        font-size: 1.2em;
        margin-bottom: 20px;
    }

    #settingsPanel label {
        font-size: 0.85em;
        display: block;
        margin-bottom: 8px;
    }

    #settingsPanel input[type="range"] {
        width: 100%;
    }

    .toggle-setting {
        padding: 10px 0;
    }

    .toggle-setting>label:first-child {
        flex: 1;
    }

    #saveSettings {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        margin-top: 20px;
    }

    /* 时区选择器移动端优化 */
    .timezone-picker {
        width: 95%;
        max-height: 80vh;
    }

    .tz-options {
        grid-template-columns: 1fr;
    }

    .tz-option {
        padding: 12px 15px;
        font-size: 0.9em;
    }

    /* 时区参考显示优化 */
    .tz-ref-item {
        padding: 10px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .tz-ref-time {
        font-size: 1em;
    }

    /* 按钮容器 - 并排显示 */
    .action-buttons {
        display: flex;
        justify-content: center;
        gap: 20px;
        width: 100%;
        padding: 0 20px;
        margin-top: auto;
        padding-bottom: 40px;
        /* 底部安全距离 */
        box-sizing: border-box;
    }

    #addClockButton,
    #resetButton {
        display: inline-flex;
        width: auto !important;
        min-width: 100px;
        max-width: none;
        margin: 0;
        padding: 0 24px;
        font-size: 14px;
        border-radius: 22px;
        /* 胶囊形状 */
        height: 44px;
        line-height: normal;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    #addClockButton {
        margin-bottom: 0;
    }

    #resetButton {
        margin-bottom: 0;
    }

    /* 移动端隐藏页脚 */
    #footer {
        display: none;
    }
}

/* 手机设备 (max-width: 480px) */
@media screen and (max-width: 480px) {
    body {
        padding: 5px;
    }

    #clocksContainer {
        max-width: 100%;
        padding: 5px;
    }

    .clock-container {
        padding: 15px 10px;
        border-radius: 12px;
    }

    .project-name {
        font-size: 1.2em;
        padding: 6px 12px;
        letter-spacing: 0.05em;
    }

    .project-header,
    .clock-header {
        gap: 5px;
    }

    .edit-icon {
        width: 12px;
        height: 12px;
    }

    .clock-title {
        font-size: 0.8em;
        letter-spacing: 0.1em;
    }

    /* .clock-time {
        font-size: 36px !important;
    } */

    .status {
        font-size: 0.8em;
    }

    /* 时区参考紧凑显示 */
    .tz-ref-item {
        padding: 8px;
        font-size: 0.85em;
    }

    .tz-ref-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .tz-ref-name {
        font-size: 0.9em;
    }

    .tz-ref-offset {
        font-size: 0.75em;
    }

    .tz-ref-time {
        font-size: 0.95em;
    }

    /* 设置面板全屏 */
    #settingsPanel {
        width: 100%;
        max-width: 100%;
        right: 0;
        top: 50px;
        border-radius: 0;
        max-height: calc(100vh - 50px);
    }

    #settingsPanel h2 {
        font-size: 1.2em;
    }

    #settingsPanel label {
        font-size: 0.8em;
    }

    /* 时区选择器全屏 */
    .timezone-picker {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
    }

    .tz-header h3 {
        font-size: 1em;
    }

    .tz-region-title {
        font-size: 0.85em;
    }

    .tz-option {
        padding: 14px 12px;
    }

    /* 按钮触摸友好 */
    #addClockButton,
    #resetButton {
        padding: 12px 24px;
        min-height: 44px;
    }

    .remove-button {
        min-width: 36px;
        min-height: 36px;
    }

    /* 开关控件触摸友好 */
    .toggle-switch {
        width: 56px;
        height: 30px;
    }

    .toggle-slider:before {
        height: 24px;
        width: 24px;
    }

    .toggle-switch input:checked+.toggle-slider:before {
        transform: translateX(26px);
    }

    /* 背景控制按钮 */
    .background-controls {
        flex-direction: column;
        gap: 8px;
    }

    .custom-file-btn,
    #removeBackgroundImage {
        width: 100%;
        height: 44px;
    }

    #footer {
        font-size: 9px;
        padding: 8px 5px;
        line-height: 1.4;
    }
}

/* 横屏模式优化 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .clocks {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .clock {
        margin: 0 10px;
    }

    .clock-divider {
        width: 1px;
        height: 60px;
        background: linear-gradient(to bottom,
                transparent 0%,
                var(--color-border) 20%,
                var(--color-border) 80%,
                transparent 100%);
    }

    .clock-time {
        font-size: 32px !important;
    }

    .timezone-references {
        display: none;
        /* 横屏时隐藏时区参考以节省空间 */
    }
}