/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image: url('https://images.unsplash.com/photo-1446776811953-b23d57bd21aa?q=80&w=2072&auto=format&fit=crop');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.2rem;
    position: relative;
    z-index: 1;
}

/* 页面整体背景覆盖 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 245, 247, 0.6); /* 增加遮罩透明度，从0.4改为0.6 */
    backdrop-filter: blur(1px);
    z-index: 0;
}

/* 标题样式 - 美化设计 */
header {
    text-align: center;
    margin-bottom: 1.2rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(229, 229, 229, 0.3);
    background: transparent; /* 移除头部背景 */
    border-radius: 16px;
    box-shadow: none; /* 移除阴影 */
    backdrop-filter: none; /* 移除模糊效果 */
    -webkit-backdrop-filter: none;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1 {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, #0066cc 0%, #0099ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.subtitle {
    display: none; /* 隐藏副标题 */
}

/* 标题统一样式 */
.input-title label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 0.2rem;
    display: block;
}

/* 输入标题样式 */
.input-title {
    margin-bottom: 0.2rem; /* 进一步减小标题和下方元素的间距 */
}

/* 调整label样式，移除冲突 */
label {
    font-size: 0.85rem;
    color: #222;
    font-weight: 500;
    margin-bottom: 0.2rem; /* 减小标签与元素间的距离，从0.3rem改为0.2rem */
}

/* 输入组样式 */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem; /* 减小内部间距，从0.4rem改为0.3rem */
    margin-bottom: 0.4rem; /* 减小与下方元素的间距，从0.6rem改为0.4rem */
}

/* 按钮组样式单独设置 */
.button-group {
    margin-top: 0.3rem; /* 减小与上方元素的间距 */
}

h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
    letter-spacing: -0.01em;
    color: #1d1d1f;
}

/* 主网格布局 - 调整顺序 */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 420px; /* 增加右侧组件宽度，从380px改为420px */
    gap: 1.2rem;
    align-items: start;
}

/* 输入区域样式 */
.time-input-section {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 1.2rem; /* 减小内边距，从1.5rem改为1.2rem */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 1rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 100%; /* 确保宽度占满 */
}

.time-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* 进一步减小主要组件间的间距，从0.7rem改为0.5rem */
}

/* 苹果风格的输入框 */
.apple-input, .apple-select {
    height: 42px; /* 增加高度，从40px改为42px */
    padding: 0 12px; /* 减小左右内边距，从14px改为12px */
    font-size: 0.95rem;
    color: #1d1d1f;
    border: 1px solid rgba(210, 210, 215, 0.8);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.85);
    transition: all 0.2s ease;
    width: 100%;
    font-family: inherit;
    text-overflow: ellipsis; /* 文本溢出时显示省略号 */
}

/* 输入框的占位符文本样式 */
.apple-input::placeholder {
    color: #999;
    opacity: 0.8;
}

.apple-input:focus, .apple-select:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.3);
    background-color: rgba(255, 255, 255, 0.95); /* 增加不透明度，从0.85改为0.95 */
}

.apple-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M10.3 3.3L6 7.6 1.7 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4l5 5c.4.4 1 .4 1.4 0l5-5c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 14px) center;
    padding-right: 36px;
}

/* 苹果风格的按钮 - 增强样式 */
.apple-button {
    height: 42px; /* 固定按钮高度，与输入框匹配 */
    padding: 0 16px; /* 调整内边距，使用左右内边距代替上下内边距 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #0077ed, #0071e3);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%; /* 重要：确保按钮宽度为100% */
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.apple-button:hover {
    background: linear-gradient(to bottom, #0080ff, #0077ed);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 113, 227, 0.4);
}

.apple-button:active {
    background: linear-gradient(to bottom, #0068d1, #0071e3);
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 113, 227, 0.2);
}

/* 世界时钟部分 */
.world-clock-section h2 {
    display: none; /* 隐藏小标题 */
}

.time-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.time-card {
    background-color: rgba(255, 255, 255, 0.75); /* 增加不透明度，从0.5改为0.75 */
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.time-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.85); /* 增加不透明度，从0.65改为0.85 */
}

/* 时间段样式 - 增强对比度 */
.time-card.morning {
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.75), rgba(240, 248, 255, 0.75)); /* 增加不透明度 */
    border-left: 5px solid #8ecae6;
}

.time-card.noon {
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.75), rgba(255, 250, 240, 0.75)); /* 增加不透明度 */
    border-left: 5px solid #ffb703;
}

.time-card.afternoon {
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.75), rgba(255, 249, 230, 0.75)); /* 增加不透明度 */
    border-left: 5px solid #fb8500;
}

.time-card.evening {
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.75), rgba(243, 240, 255, 0.75)); /* 增加不透明度 */
    border-left: 5px solid #8338ec;
}

.time-card.night {
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.75), rgba(240, 242, 245, 0.75)); /* 增加不透明度 */
    border-left: 5px solid #023047;
}

.time-period-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.1rem;
    opacity: 0.9;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* 时间卡片样式优化 */
.country-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.timezone-info {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.7rem;
}

.time-display {
    font-size: 2rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.3rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.date-display {
    font-size: 0.8rem;
    color: #222;
    display: flex;
    align-items: center;
    gap: 0.5rem; /* 添加日期和星期之间的间距 */
}

.date-info {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.day-of-week {
    color: #666;
    font-weight: 500;
}

.time-period {
    color: #0066cc;
    font-weight: 600;
    margin-left: auto; /* 将时间段推到右侧 */
}

/* 日期提示样式增强 */
.date-alert {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    width: fit-content;
}

.date-alert.prev-day {
    color: #ffffff;
    background-color: rgba(255, 59, 48, 0.9);
}

.date-alert.next-day {
    color: #ffffff;
    background-color: rgba(0, 122, 255, 0.9);
}

.date-alert-icon {
    font-size: 0.9rem;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding-top: 1rem;
    margin-top: 1rem;
    color: #222;
    font-size: 0.8rem;
    border-top: 1px solid rgba(229, 229, 229, 0.3);
}

/* 新增：并列输入框样式 */
.time-inputs-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* 调整间距，从0.7rem改为0.5rem */
    width: 100%;
    align-items: center;
    margin-bottom: 0.5rem; /* 增加与下方元素的间距，保持一致性 */
}

.datetime-input-group,
.text-time-input-group {
    width: 100%;
}

/* 或分隔符样式 */
.or-divider {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    text-align: center;
    position: relative;
    margin: 0.2rem 0; /* 减小上下间距，从0.3rem改为0.2rem */
    padding: 0 0.2rem; /* 减小左右内边距，从0.3rem改为0.2rem */
}

/* 输入框禁用状态 */
.apple-input:disabled,
.apple-select:disabled {
    background-color: rgba(230, 230, 235, 0.5);
    color: #999;
    cursor: not-allowed;
    border-color: rgba(210, 210, 215, 0.5);
}

/* 响应式设计 */
@media (min-width: 1024px) {
    /* 在较大屏幕上实现并排布局 */
    .time-inputs-row {
        flex-direction: row;
        gap: 0.3rem; /* 减小间距，从0.5rem改为0.3rem */
        align-items: center;
    }
    
    .datetime-input-group,
    .text-time-input-group {
        width: calc(50% - 0.15rem); /* 调整宽度计算，适应更小的间距 */
    }
    
    .or-divider {
        width: auto;
        margin: 0;
        flex-shrink: 0;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 1.2rem;
    }
    
    .main-grid {
        grid-template-columns: 1fr 380px; /* 适应中等屏幕 */
    }
    
    .time-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .time-quote {
        margin-top: 1.2rem;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 1rem;
    }
    
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .time-input-section {
        order: -1;
        position: relative;
        top: 0;
        padding: 1.2rem; /* 在小屏幕上减小内边距 */
    }
    
    .time-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .time-display {
        font-size: 1.6rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .time-quote {
        margin-top: 1rem;
    }
}

/* 名人名言样式 */
.quote-section {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(200, 200, 200, 0.2);
    padding-top: 1rem;
}

.quote-title {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: #777;
    margin-bottom: 0.8rem;
}

.quote-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 0.8rem 1.2rem;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.quote-text {
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
    margin-bottom: 0.5rem;
}

.quote-author {
    font-size: 0.85rem;
    color: #555;
    text-align: right;
    font-weight: 500;
}

.footer-quote {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    transform: scale(0.98);
}

.time-quote {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    max-width: 100%;
    opacity: 0.95;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.input-quote {
    margin-top: 0.2rem;
    max-width: 100%;
    opacity: 0.8;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.quote-divider {
    margin: 1.2rem 0 0.8rem;
    border: none;
    height: 1px;
    background: linear-gradient(to right, 
        rgba(200, 200, 200, 0.05), 
        rgba(200, 200, 200, 0.2), 
        rgba(200, 200, 200, 0.05)
    );
}

.input-quote .quote-text {
    font-size: 0.85rem;
    color: #555;
}

.input-quote .author-name {
    font-size: 0.8rem;
    color: #0077cc;
    opacity: 0.85;
}

.input-quote .author-title {
    font-size: 0.75rem;
    color: #777;
    opacity: 0.7;
}

.input-quote::before,
.input-quote::after {
    font-size: 3.5rem;
    opacity: 0.03;
} 