* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #2d1b69 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* 夜空背景效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent),
        radial-gradient(1px 1px at 200px 60px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 240px 90px, #fff, transparent),
        radial-gradient(2px 2px at 280px 40px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 320px 70px, #eee, transparent),
        radial-gradient(1px 1px at 360px 30px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 400px 80px, #fff, transparent),
        radial-gradient(1px 1px at 440px 50px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 480px 90px, #ddd, transparent),
        radial-gradient(2px 2px at 520px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 560px 70px, #fff, transparent),
        radial-gradient(1px 1px at 600px 40px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 640px 80px, #eee, transparent),
        radial-gradient(1px 1px at 680px 50px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 720px 90px, #fff, transparent),
        radial-gradient(2px 2px at 760px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 800px 70px, #ddd, transparent),
        radial-gradient(1px 1px at 840px 40px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 880px 80px, #fff, transparent),
        radial-gradient(1px 1px at 920px 50px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 960px 90px, #eee, transparent),
        radial-gradient(2px 2px at 1000px 30px, rgba(255,255,255,0.8), transparent);
    background-repeat: repeat;
    background-size: 1000px 100px;
    animation: twinkle 4s ease-in-out infinite;
    z-index: -1;
}

/* 月亮效果 */
body::after {
    content: '🌙';
    position: fixed;
    top: 50px;
    right: 80px;
    font-size: 60px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: moonGlow 3s ease-in-out infinite;
    z-index: -1;
}

/* 星星闪烁动画 */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* 月亮发光动画 */
@keyframes moonGlow {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.language-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-btn:hover:not(.active) {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

.main-content {
    flex: 1;
}

.calculator-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

.input-section {
    text-align: center;
    margin-bottom: 30px;
}

.calculator-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tab-btn {
    flex: 1;
    padding: 14px 0;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 1.08rem;
    font-weight: 500;
    cursor: pointer;
    color: #888;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
    position: relative;
    z-index: 1;
    margin: 0 2px;
}

.tab-btn.active {
    background: #fff;
    color: #2d1b69;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(45,27,105,0.08);
    border: 2px solid #2d1b69;
    border-bottom: 3px solid #4a2b8a;
    z-index: 2;
}

.tab-btn:not(.active):hover {
    background: #f0f0f7;
    color: #4a2b8a;
}

.calculator-panel {
    display: none;
}

.calculator-panel.active {
    display: block;
}

.input-section h2 {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: #222;
    letter-spacing: 0.5px;
}

.time-input-group {
    margin-bottom: 32px;
}

.time-input {
    font-size: 1.5rem;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 700;
    margin-bottom: 12px;
}

.time-input:focus {
    outline: none;
    border-color: #2d1b69;
    box-shadow: 0 0 0 3px rgba(45, 27, 105, 0.1);
}

.quick-buttons {
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.quick-btn {
    padding: 10px 18px;
    font-size: 1rem;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 4px;
}

.quick-btn:hover {
    background: #2d1b69;
    color: white;
    border-color: #2d1b69;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 27, 105, 0.3);
}

.calculate-btn {
    background: linear-gradient(135deg, #2d1b69 0%, #4a2b8a 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(45, 27, 105, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 27, 105, 0.4);
    background: linear-gradient(135deg, #4a2b8a 0%, #6b3fa3 100%);
}

.current-time-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

.results-section {
    padding: 12px 0 8px 0;
    margin: 0;
}

.results-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.sleep-times {
    margin-bottom: 6px;
    gap: 6px;
}

.sleep-time {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.sleep-time.primary {
    background: linear-gradient(135deg, rgba(45, 27, 105, 0.1) 0%, rgba(74, 43, 138, 0.1) 100%);
    border: 2px solid rgba(45, 27, 105, 0.3);
    box-shadow: 0 8px 25px rgba(45, 27, 105, 0.2);
    color: #2d1b69;
}

.sleep-time.primary .time-label,
.sleep-time.primary .time-desc {
    color: #666;
}

.sleep-time.secondary {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(45, 27, 105, 0.2);
}

.sleep-time:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.time-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.time-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #2d1b69;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.time-desc {
    font-size: 0.75rem;
    color: #888;
    font-weight: 400;
    margin: 2px 0;
}

.sleep-info {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    margin-top: 4px;
    margin-bottom: 0;
}

.sleep-info p {
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: #666;
}

.sleep-info p:last-child {
    margin-bottom: 0;
}

.info-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

.info-section h3 {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 30px;
    color: #2d1b69;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.info-card h4 {
    font-size: 0.82rem;
    margin-bottom: 8px;
    color: #2d1b69;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.info-card p {
    color: #555;
    line-height: 1.6;
}

.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .calculator-container {
        padding: 20px;
    }
    
    .calculator-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 15px;
    }
    
    .quick-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .quick-btn {
        width: 100px;
    }
    
    .sleep-times {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .time-value {
        font-size: 1.2rem;
    }
    
    .language-switcher {
        margin: 0 auto 20px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2rem;
    }
    
    .calculator-container {
        padding: 15px;
    }
    
    .input-section h2 {
        font-size: 1.1rem;
    }
    
    .time-input {
        font-size: 1rem;
        padding: 8px 6px;
    }
    
    .calculate-btn {
        font-size: 0.9rem;
        width: 100%;
        padding: 10px 0;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section {
    animation: fadeIn 0.5s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* SEO和可访问性样式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* SEO内容区域样式 */
.seo-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

.seo-text h3 {
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 25px 0 15px 0;
    line-height: 1.4;
}

.seo-text h3:first-child {
    margin-top: 0;
}

.seo-text p {
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 15px;
}

.seo-text ul {
    margin: 15px 0;
    padding-left: 20px;
}

.seo-text li {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.seo-text strong {
    color: #333;
    font-weight: 600;
}

/* 改进的页脚样式 */
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section h4 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

/* 语义化标签样式 */
section {
    margin-bottom: 40px;
}

article {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* 响应式SEO内容 */
@media (max-width: 768px) {
    .seo-content {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .seo-text h3 {
        font-size: 1.2rem;
        margin: 20px 0 12px 0;
    }
    
    .seo-text p {
        font-size: 0.95rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .seo-content {
        padding: 15px;
    }
    
    .seo-text h3 {
        font-size: 1.1rem;
    }
    
    .seo-text p {
        font-size: 0.9rem;
    }
}

/* 打印样式 */
@media print {
    .header-top,
    .language-switcher,
    .calculator-tabs,
    .quick-buttons,
    .calculate-btn {
        display: none !important;
    }
    
    .calculator-container,
    .info-section,
    .seo-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

#starfield {
  position: fixed;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: -2;
  overflow: hidden;
}
.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  opacity: 0.7;
  animation: twinkle 2s infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.return-btn {
    display: block;
    margin: 10px auto 0 auto;
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #2d1b69 0%, #4a2b8a 100%);
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(45,27,105,0.13);
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}
.return-btn:hover {
    background: linear-gradient(135deg, #4a2b8a 0%, #6b3fa3 100%);
    transform: translateY(-2px) scale(1.04);
}

.calculate-bedtime-btn {
    background: linear-gradient(135deg, #2d1b69 0%, #4a2b8a 100%);
    color: #fff;
}
.calculate-bedtime-btn:hover {
    background: linear-gradient(135deg, #4a2b8a 0%, #6b3fa3 100%);
}

.calculate-wakeup-btn {
    background: linear-gradient(135deg, #1e8e6e 0%, #3ec6a8 100%);
    color: #fff;
}
.calculate-wakeup-btn:hover {
    background: linear-gradient(135deg, #3ec6a8 0%, #1e8e6e 100%);
}

.return-icon {
    font-size: 1.1em;
    margin-right: 6px;
    vertical-align: middle;
    display: inline-block;
} 