:root {
    --primary-color: #FF4081;
    --background-color: #f5f6fa;
    --card-background: #ffffff;
    --text-primary: #333333;
    --radius-large: 10px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.1);

    /* 优雅粉主题 */
    --elegant-primary: #FF4081;
    --elegant-background: #f5f6fa;
    --elegant-card: #ffffff;
    --elegant-text: #333333;

    /* 深海蓝主题 */
    --ocean-primary: #0288D1;
    --ocean-background: #E3F2FD;
    --ocean-card: #ffffff;
    --ocean-text: #01579B;

    /* 森林绿主题 */
    --forest-primary: #2E7D32;
    --forest-background: #E8F5E9;
    --forest-card: #ffffff;
    --forest-text: #1B5E20;

    /* 日落橙主题 */
    --sunset-primary: #F57C00;
    --sunset-background: #FFF3E0;
    --sunset-card: #ffffff;
    --sunset-text: #E65100;

    /* 梦幻紫主题 */
    --purple-primary: #7B1FA2;
    --purple-background: #F3E5F5;
    --purple-card: #ffffff;
    --purple-text: #4A148C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    margin-top: 80px;
}

/* 翻牌时钟样式 */
.flip-clock {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.time-section {
    flex: 1;
    text-align: center;
    padding: 0 10px;
}

.number-card {
    background: var(--card-background);
    border-radius: var(--radius-large);
    font-size: 96px;
    font-weight: bold;
    margin-bottom: 15px;
    width: 100%;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.time-section label {
    font-size: 20px;
    color: var(--text-primary);
}

/* 设置工具栏样式 */
.settings-toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.settings-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-large);
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-panel {
    background: var(--card-background);
    padding: 20px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow);
    margin-top: 10px;
    display: none;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    color: var(--text-primary);
}

/* 响应式布局 */
@media (max-width: 768px) {
    .flip-clock {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .time-section {
        width: 100%;
        max-width: 200px;
    }

    .number-card {
        font-size: 72px;
        min-height: 120px;
    }

    .time-section label {
        font-size: 18px;
    }
}

.quick-countdown .quick-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.quick-countdown button {
    background: var(--card-background);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: var(--radius-large);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-countdown button:hover {
    background: var(--primary-color);
    color: var(--card-background);
}

/* 添加时间选择器样式 */
.time-picker {
    margin-top: 8px;
}

.time-input {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--background-color);
    padding: 12px;
    border-radius: var(--radius-large);
}

.time-row {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.time-input-group label {
    font-size: 12px;
    color: var(--text-secondary);
}

.time-input input {
    width: 50px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: var(--radius-medium);
    font-size: 16px;
    text-align: center;
    background: white;
}

.time-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.time-input span {
    font-weight: bold;
    color: var(--text-primary);
}

/* 去掉输入框的上下箭头 */
.time-input input::-webkit-outer-spin-button,
.time-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-input input[type=number] {
    -moz-appearance: textfield;
}

/* 修改按钮组样式 */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.primary-button {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-large);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.primary-button:hover {
    background: var(--primary-color);
    opacity: 0.9;
    transform: translateY(-1px);
}

.secondary-button {
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px;
    border-radius: var(--radius-large);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.secondary-button:hover {
    background: var(--primary-color);
    color: white;
}

.fullscreen-icon {
    font-size: 20px;
}

/* 修改输入框样式 */
.time-input input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: var(--radius-medium);
    font-size: 16px;
    text-align: center;
    background: white;
}

.time-input input::placeholder {
    color: #999;
}

/* 添加标题样式 */
.countdown-title {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 30px;
    opacity: 0.8;
}

/* 标题输入框样式 */
.title-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-medium);
    font-size: 16px;
    background: white;
}

.title-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 主题按钮样式 */
.theme-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 2px;
    background: none;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    transform: scale(1.1);
}

.theme-btn.active {
    border-color: #333;
}

.color-preview {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* 为每个主题按钮设置预览颜色 */
[data-theme="elegant"] .color-preview {
    background: linear-gradient(45deg, var(--elegant-primary), var(--elegant-background));
}

[data-theme="ocean"] .color-preview {
    background: linear-gradient(45deg, var(--ocean-primary), var(--ocean-background));
}

[data-theme="forest"] .color-preview {
    background: linear-gradient(45deg, var(--forest-primary), var(--forest-background));
}

[data-theme="sunset"] .color-preview {
    background: linear-gradient(45deg, var(--sunset-primary), var(--sunset-background));
}

[data-theme="purple"] .color-preview {
    background: linear-gradient(45deg, var(--purple-primary), var(--purple-background));
}

/* 清零按钮样式 */
.clear-button {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: var(--radius-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.clear-button:hover {
    background: var(--primary-color);
    color: var(--card-background);
}

/* 倒计时结束弹窗样式 */
.countdown-finish {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.finish-modal {
    background: var(--card-background);
    padding: 40px;
    border-radius: var(--radius-large);
    text-align: center;
    width: 50%;
    max-width: 400px;
    animation: scaleIn 0.5s ease;
}

.finish-emoji {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.finish-text {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-weight: bold;
}

.finish-close {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: var(--radius-large);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.finish-close:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* 动画关键帧 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        transform: scale(0.8);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .finish-modal {
        width: 90%;
        padding: 30px;
    }
}

/* 时间操作按钮组 */
.time-action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.time-action-buttons button {
    flex: 1;
    height: 36px;  /* 统一高度 */
    padding: 0 12px;  /* 调整内边距 */
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-medium);
    background: var(--background-color);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.time-action-buttons button:hover {
    background: var(--primary-color);
    color: var(--card-background);
}

/* 重置按钮样式 */
.reset-button {
    padding: 8px 12px;
    background: var(--background-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reset-button:hover {
    background: var(--primary-color);
    color: var(--card-background);
}

/* 设置面板头部样式 */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--background-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-left span {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
}

/* 图标按钮样式 */
.icon-button {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.icon-button:hover {
    background: var(--background-color);
    color: var(--primary-color);
}

.icon-button .material-icons {
    font-size: 20px;
}

/* 重置确认弹窗 */
.reset-confirm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.confirm-modal {
    background: var(--card-background);
    padding: 30px;
    border-radius: var(--radius-large);
    text-align: center;
    animation: scaleIn 0.3s ease;
}

.confirm-text {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-buttons button {
    padding: 8px 20px;
    border-radius: var(--radius-medium);
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-yes {
    background: #ff4444;
    color: white;
    border: none;
}

.confirm-no {
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.confirm-yes:hover {
    background: #ff6666;
}

.confirm-no:hover {
    background: var(--primary-color);
    color: white;
}

/* Tab 样式 */
.tab-container {
    margin-top: 8px;
}

.tab-buttons {
    display: flex;
    gap: 1px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    padding: 8px;
    background: var(--background-color);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:first-child {
    border-radius: var(--radius-medium) 0 0 var(--radius-medium);
}

.tab-btn:last-child {
    border-radius: 0 var(--radius-medium) var(--radius-medium) 0;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 日期时间选择器样式 */
.datetime-picker {
    background: var(--background-color);
    padding: 15px;
    border-radius: var(--radius-large);
}

.date-select, .time-select {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.datetime-picker select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: var(--radius-medium);
    background: white;
    font-size: 14px;
    cursor: pointer;
}

.datetime-picker select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 修改预计倒计时提示样式 */
.countdown-preview {
    margin-top: 12px;
    padding: 12px;
    background: var(--background-color);
    border-radius: var(--radius-medium);
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-text {
    flex: 1;
}

.now-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-medium);
    background: var(--background-color);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.now-button:hover {
    background: var(--primary-color);
    color: var(--card-background);
}

.now-button .material-icons {
    font-size: 16px;
}

/* 软件标题样式 */
.app-header {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    z-index: 900;
}

.app-header h1 {
    font-size: 28px;
    margin: 0;
    opacity: 0.9;
}

.version {
    font-size: 14px;
    opacity: 0.7;
    margin-left: 8px;
}

/* 页脚样式 */
.app-footer {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0.7;
}

.app-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.app-footer a:hover {
    opacity: 0.8;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .app-header {
        top: 10px;
    }
    
    .container {
        margin-top: 60px;
    }
    
    .app-header h1 {
        font-size: 24px;
    }
    
    .version {
        font-size: 12px;
    }
    
    .app-footer {
        font-size: 12px;
        bottom: 10px;
    }
}

/* 添加震动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* 错误提示样式 */
.error-tip {
    color: #ff4444;
    font-size: 14px;
    margin-top: 8px;
    display: none;
    text-align: center;
}

.error-tip.show {
    display: block;
}

/* 工具栏按钮组样式 */
.toolbar-buttons {
    display: flex;
    gap: 8px;
}

.settings-toggle, .fullscreen-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-large);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.settings-toggle:hover, .fullscreen-toggle:hover {
    opacity: 0.9;
}

.fullscreen-toggle .material-icons {
    font-size: 20px;
}

/* 全屏模式样式重构 */
.fullscreen-mode .app-header,
.fullscreen-mode .app-footer {
    display: none;  /* 隐藏标题和页脚 */
}

.fullscreen-mode .container {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.fullscreen-mode .flip-clock {
    width: 95vw;  /* 略微增加宽度 */
    max-width: none;
    height: auto;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5vw;  /* 稍微减小间距以容纳更大的数字 */
    justify-content: center;
}

.fullscreen-mode .number-card {
    width: 100%;
    aspect-ratio: 1.1;  /* 稍微降低宽高比，让数字更高 */
    font-size: min(24vh, 18vw);  /* 增大字体尺寸 */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 2vh;
    background: var(--card-background);
    box-shadow: 0 1vh 2vh rgba(0, 0, 0, 0.1);
    margin-bottom: 2vh;
}

.fullscreen-mode .time-section {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fullscreen-mode .time-section label {
    font-size: min(4vh, 3vw);
    margin-top: 1vh;
}

.fullscreen-mode .settings-toolbar {
    position: fixed;
    top: 2vh;
    right: 2vh;
    z-index: 1000;
    transform: scale(0.8);  /* 缩小整体尺寸 */
}

.fullscreen-mode .toolbar-buttons {
    display: flex;
    gap: 8px;
}

.fullscreen-mode .settings-toggle,
.fullscreen-mode .fullscreen-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
}

/* 隐藏全屏模式下的按钮文字 */
.fullscreen-mode .button-text {
    display: none;
}

/* 调整图标大小 */
.fullscreen-mode .settings-toggle .material-icons,
.fullscreen-mode .fullscreen-toggle .material-icons {
    font-size: 20px;
}

.fullscreen-mode .settings-toggle:hover,
.fullscreen-mode .fullscreen-toggle:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* 移除之前的设置图标相关样式 */
.fullscreen-mode .settings-toggle::before {
    content: none;
}

/* 超宽屏优化 */
@media (min-aspect-ratio: 16/9) {
    .fullscreen-mode .flip-clock {
        width: 85vw;
    }
    
    .fullscreen-mode .number-card {
        font-size: min(22vh, 16vw);
    }
}

/* 竖屏模式 */
@media (max-aspect-ratio: 3/4) {
    .fullscreen-mode .flip-clock {
        width: 98vw;
        grid-template-columns: repeat(2, 1fr);
        gap: 2vh 2vw;
    }

    .fullscreen-mode .number-card {
        font-size: min(18vh, 24vw);
    }
}

/* 修改输入框和按钮布局 */
.input-with-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;  /* 确保每组输入有足够的宽度 */
}

.input-with-buttons input {
    width: 50px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: var(--radius-medium);
    text-align: center;
    font-size: 16px;
    background: white;
}

.input-with-buttons input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-with-buttons button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-medium);
    background: var(--background-color);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    user-select: none;
}

.input-with-buttons button:hover {
    background: var(--primary-color);
    color: white;
}

.input-with-buttons button:active {
    transform: scale(0.95);
}

/* 移除旧的样式 */
.number-input {
    display: none;
}

/* 全屏模式下的标题样式 */
.fullscreen-mode .countdown-title {
    position: absolute;
    top: 5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 75vw;  /* 占据75%的视窗宽度 */
    font-size: min(8vh, 6vw);  /* 响应式字体大小 */
    text-align: center;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;  /* 文字过长时显示省略号 */
    margin: 0;
    padding: 0;
}

/* 超宽屏优化 */
@media (min-aspect-ratio: 16/9) {
    .fullscreen-mode .countdown-title {
        font-size: min(7vh, 5vw);
        top: 4vh;
    }
}

/* 竖屏模式 */
@media (max-aspect-ratio: 3/4) {
    .fullscreen-mode .countdown-title {
        font-size: min(6vh, 7vw);
        top: 6vh;
        width: 85vw;  /* 竖屏时可以占据更多宽度 */
    }
} 