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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f59e0b;
    --accent-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 导航样式 */
.navbar {
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-link {
    transition: var(--transition);
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* 内容区域样式 */
.content-section {
    display: none;
    animation: fadeInUp 0.6s ease-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片样式 */
.card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bg-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* 时钟样式 */
.clock-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: visible;
    width: 400px;
    height: 400px;
    margin: 0 auto;
}

.clock-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-gradient);
    opacity: 0.05;
    z-index: -1;
    border-radius: var(--border-radius-lg);
}

#clock {
    font-family: 'Inter', sans-serif;
    font-size: 18vw;
    letter-spacing: 0.05em;
    font-weight: 800;
    text-shadow: 0 4px 32px rgba(0,0,0,0.1);
    user-select: none;
    color: var(--text-primary);
}

#clock .colon {
    position: relative;
    top: -0.05em;
    animation: blink 1s steps(1) infinite;
    color: var(--primary-color);
}

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

/* 时辰标签样式 */
.hour-label {
    position: absolute;
    width: 70px;
    height: 70px;
    text-align: center;
    transform: translate(-50%, -50%);
    font-size: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    z-index: 10;
}

.zodiac-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.time-range {
    font-size: 12px;
    color: var(--text-secondary);
}

.hour-label span {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.active-hour {
    background: var(--bg-gradient);
    color: white;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    box-shadow: var(--shadow-lg);
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 20;
}

.active-hour .zodiac-label,
.active-hour .time-range {
    color: white;
}

.active-hour.pulse-hour {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.6);
    }
}

/* 时辰卡片样式 */
.zodiac-card {
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.zodiac-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.zodiac-card:hover::after {
    transform: scaleX(1);
}

.zodiac-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

/* 子午流注信息样式 */
.meridian-info {
    background: var(--bg-gradient);
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 32px;
    margin: 24px 0;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.meridian-info::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 倒计时样式 */
.countdown-container {
    text-align: center;
    padding: 40px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.countdown {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 32px 0;
}

.time-box {
    background: var(--bg-gradient);
    color: white;
    padding: 24px 16px;
    border-radius: var(--border-radius);
    min-width: 100px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.time-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.time-box:hover::before {
    left: 100%;
}

.time-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.time-box span {
    font-size: 2.5rem;
    font-weight: 800;
    display: block;
    margin-bottom: 8px;
}

.time-box p {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 表单样式 */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* 表格样式 */
.table-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tr:hover {
    background-color: rgba(99, 102, 241, 0.02);
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-green {
    background-color: #dcfce7;
    color: #166534;
}

.tag-red {
    background-color: #fee2e2;
    color: #991b1b;
}

.tag-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

/* 渐变背景 */
.gradient-bg {
    background: var(--bg-gradient);
}

.gradient-bg-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-bg-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* 动画效果 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .clock-container {
        width: 300px;
        height: 300px;
        padding: 20px;
    }
    
    .hour-label {
        width: 50px;
        height: 50px;
        font-size: 14px;
    }
    
    .zodiac-label {
        font-size: 14px;
    }
    
    .time-range {
        font-size: 10px;
    }
    
    .quick-countdown-card {
        padding: 24px;
    }
    
    .time-unit span {
        font-size: 28px;
    }
    
    .time-inputs {
        gap: 8px;
    }
    
    .input-group {
        max-width: 70px;
    }
    
    .control-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .control-btn {
        min-width: 90px;
        padding: 10px 16px;
    }
    
    .countdown {
        gap: 16px;
    }
    
    .time-box {
        min-width: 80px;
        padding: 20px 12px;
    }
    
    .time-box span {
        font-size: 2rem;
    }
    
    .time-box p {
        font-size: 0.75rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .meridian-info {
        padding: 24px;
        margin: 20px 0;
    }
    
    .zodiac-card {
        margin-bottom: 20px;
    }
}

@media (max-width: 640px) {
    .clock-container {
        width: 250px;
        height: 250px;
        padding: 15px;
    }
    
    .hour-label {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }
    
    .zodiac-label {
        font-size: 12px;
    }
    
    .time-range {
        font-size: 8px;
    }
    
    .quick-countdown-card {
        padding: 20px;
    }
    
    .countdown-header h3 {
        font-size: 20px;
    }
    
    .time-unit span {
        font-size: 24px;
    }
    
    .time-unit {
        min-width: 50px;
    }
    
    .time-inputs {
        gap: 6px;
    }
    
    .input-group {
        max-width: 60px;
    }
    
    .input-group input {
        padding: 10px 6px;
        font-size: 14px;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .preset-buttons {
        gap: 6px;
    }
    
    .preset-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .countdown {
        gap: 12px;
    }
    
    .time-box {
        min-width: 70px;
        padding: 16px 8px;
    }
    
    .time-box span {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 16px;
    }
    
    .meridian-info {
        padding: 20px;
        margin: 16px 0;
    }
}

/* 打印样式 */
@media print {
    .nav-link,
    .mobile-menu,
    .btn {
        display: none !important;
    }
    
    .content-section {
        display: block !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 页面加载动画 */
body.loaded {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 页面隐藏时的样式 */
body.page-hidden .pulse-hour {
    animation-play-state: paused;
}

/* 主题预览样式 */
.theme-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    background: none;
}

.theme-preview:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.theme-preview.active {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
}

.theme-preview span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 倒计时完成动画 */
@keyframes celebration {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

#countdown-complete {
    animation: celebration 0.6s ease-out;
}

/* 保存的倒计时样式 */
.saved-countdown-item {
    transition: var(--transition);
}

.saved-countdown-item:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

/* 快速倒计时卡片样式 */
.quick-countdown-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.quick-countdown-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* 倒计时头部 */
.countdown-header {
    text-align: center;
    margin-bottom: 32px;
}

.countdown-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.countdown-header p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* 倒计时显示 */
.countdown-display {
    text-align: center;
    margin-bottom: 32px;
}

.time-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.time-unit span {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 4px;
}

.time-unit label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-separator {
    font-size: 24px;
    font-weight: 600;
    color: #d1d5db;
    margin-top: -8px;
}

.countdown-status {
    margin-top: 16px;
}

.countdown-status #home-countdown-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.countdown-status #home-countdown-subtitle {
    font-size: 14px;
    color: #6b7280;
}

/* 时间输入区域 */
.time-input-section {
    margin-bottom: 24px;
}

.time-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 80px;
}

.input-group input {
    width: 100%;
    padding: 12px 8px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: #1f2937;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-group label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 控制按钮 */
.control-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    justify-content: center;
}

.control-btn.primary {
    background: #6366f1;
    color: white;
}

.control-btn.primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.control-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}

.control-btn.secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.control-btn.reset {
    background: #fef2f2;
    color: #dc2626;
}

.control-btn.reset:hover {
    background: #fee2e2;
    transform: translateY(-1px);
}

.btn-icon {
    width: 16px;
    height: 16px;
}

/* 预设按钮 */
.preset-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
    transform: translateY(-1px);
}

/* 倒计时完成动画 */
@keyframes countdownComplete {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 30px rgba(16, 185, 129, 0.6); }
    100% { transform: scale(1); }
}

.countdown-complete-animation {
    animation: countdownComplete 0.6s ease-in-out;
}

/* 预设时间按钮样式 */
.preset-time-btn {
    transition: var(--transition);
    font-size: 0.875rem;
    padding: 8px 16px;
}

.preset-time-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 响应式调整 */
@media (max-width: 1024px) {
    #home-countdown .time-box {
        min-width: 80px;
        padding: 16px 8px;
    }
    
    #home-countdown .time-box span {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    #home-countdown .time-box {
        min-width: 70px;
        padding: 12px 6px;
    }
    
    #home-countdown .time-box span {
        font-size: 1.25rem;
    }
    
    #home-countdown .time-box p {
        font-size: 0.75rem;
    }
}