/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 根元素样式 - 浅色模式（默认） */
:root {
    /* 颜色变量 - 基于logo配色 */
    --primary-color: #5BA3C5;  /* 主色调 - 天蓝色 */
    --primary-light: #7ABBD7;  /* 浅天蓝色 */
    --primary-dark: #4A8FB0;   /* 深天蓝色 */
    
    --secondary-color: #F4C467;  /* 次要色 - 金黄色 */
    --secondary-light: #FFD489;  /* 浅金黄色 */
    --secondary-dark: #E6A94F;   /* 深金黄色 */
    
    --accent-color: #FF9557;     /* 强调色 - 火焰橙 */
    --accent-light: #FFB380;     /* 浅橙色 */
    
    --cloud-color: #FFF5E6;      /* 云朵色 - 奶白色 */
    --background-color: #F0F7FA;  /* 背景色 - 极浅蓝 */
    --background-secondary: #E8F3F8; /* 次要背景色 */
    --card-background: #ffffff;   /* 卡片背景色 */
    --text-color: #2C4A5C;        /* 文字颜色 - 深蓝灰 */
    --text-secondary: #6B8395;    /* 次要文字 - 中蓝灰 */
    --border-color: #D6E7F0;      /* 边框颜色 - 浅蓝灰 */
    --white: #ffffff;
    --shadow-color: rgba(91, 163, 197, 0.1);
    --shadow-hover: rgba(91, 163, 197, 0.15);
    
    /* 导航栏特定颜色 */
    --nav-background: #ffffff;
    --nav-shadow: rgba(91, 163, 197, 0.08);
    --nav-item-hover: rgba(244, 196, 103, 0.08);
    
    /* 表单控件颜色 */
    --input-background: #ffffff;
    --input-border: #D6E7F0;
    --input-focus-shadow: rgba(91, 163, 197, 0.1);
    
    /* 尺寸变量 */
    --header-height: 56px;
    --bottom-nav-height: 60px;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        /* 深色模式下的颜色调整 */
        --primary-color: #6BAFD1;    /* 稍微提亮主色调 */
        --primary-light: #8AC5E3;    
        --primary-dark: #5A9ABC;     
        
        --secondary-color: #F4C467;  /* 金黄色保持不变，提供对比 */
        --secondary-light: #FFD489;  
        --secondary-dark: #E6A94F;   
        
        --accent-color: #FF9557;     
        --accent-light: #FFB380;     
        
        --cloud-color: #3A4D5C;       /* 深色模式下的"云朵色" */
        --background-color: #1A2631;  /* 深蓝灰背景 */
        --background-secondary: #243140; /* 次要背景色 */
        --card-background: #243140;   /* 卡片背景色 */
        --text-color: #E0E9F0;        /* 浅色文字 */
        --text-secondary: #A0B3C5;    /* 次要文字 */
        --border-color: #354555;      /* 边框颜色 */
        --white: #ffffff;
        --shadow-color: rgba(0, 0, 0, 0.3);
        --shadow-hover: rgba(0, 0, 0, 0.4);
        
        /* 导航栏特定颜色 */
        --nav-background: #243140;
        --nav-shadow: rgba(0, 0, 0, 0.3);
        --nav-item-hover: rgba(244, 196, 103, 0.15);
        
        /* 表单控件颜色 */
        --input-background: #2A3B4D;
        --input-border: #354555;
        --input-focus-shadow: rgba(107, 175, 209, 0.2);
    }
}

/* 全局样式 */
html {
    height: 100%;
}

body {
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", 
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", 
                 Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--background-color);
    padding-top: var(--header-height);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 顶部导航栏 - 使用天蓝色渐变 */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    box-shadow: 0 2px 8px var(--shadow-color);
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

/* 深色模式下的header调整 */
@media (prefers-color-scheme: dark) {
    .site-header {
        background: linear-gradient(135deg, #2A3B4D, #354555);
        border-bottom: 1px solid var(--border-color);
    }
}

.header-container {
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.site-title .site-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: inline-block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* 顶部用户信息区域 */
.header-user-info {
    display: flex;
    align-items: center;
}

.user-hearts {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

@media (prefers-color-scheme: dark) {
    .user-hearts {
        background: rgba(0, 0, 0, 0.3);
    }
}

.hearts-count {
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
}

.hearts-icon {
    font-size: 16px;
}

.get-hearts-link {
    color: var(--white);
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .get-hearts-link {
        background: rgba(244, 196, 103, 0.2);
    }
}

.get-hearts-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
    .get-hearts-link:hover {
        background: rgba(244, 196, 103, 0.3);
    }
}

/* 主内容区域 */
.main-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
    padding-bottom: calc(var(--bottom-nav-height) + 40px);
    min-height: calc(100vh - var(--header-height));
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--nav-background);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 -2px 10px var(--nav-shadow);
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
}

.nav-item .nav-emoji {
    font-size: 24px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

/* 导航项激活状态 - 使用金黄色高亮 */
.nav-item.active {
    color: var(--secondary-dark);
}

.nav-item.active .nav-emoji {
    transform: scale(1.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 8px rgba(244, 196, 103, 0.3);
}

/* 导航项悬停效果 */
.nav-item:active {
    background-color: var(--nav-item-hover);
    border-radius: 8px;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .main-content {
        padding: 30px 24px;
        padding-bottom: calc(var(--bottom-nav-height) + 50px);
    }
    
    .bottom-nav {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px var(--nav-shadow);
    }
}

/* 大屏幕保持底部导航栏 */
@media (min-width: 1024px) {
    .main-content {
        padding: 40px 32px;
        padding-bottom: calc(var(--bottom-nav-height) + 60px);
    }
    
    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px var(--nav-shadow);
    }
}

/* 工具类 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: var(--white);
    box-shadow: 0 2px 8px rgba(244, 196, 103, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 196, 103, 0.4);
}

/* 卡片样式 */
.card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px var(--shadow-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px var(--shadow-hover);
}

/* 渐变文字效果 */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 深色模式下的额外优化 */
@media (prefers-color-scheme: dark) {
    /* 平滑过渡 */
    * {
        transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    }
    
    /* 图片和logo在深色模式下的处理 */
    img {
        opacity: 0.9;
    }
    
    .site-logo {
        filter: brightness(1.1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    }
}

/* Toast动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* 模态框动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* 模态框遮罩层 */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

/* 模态框主体 */
.custom-modal {
    background: var(--card-background, #ffffff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
}

.animate-modal-in {
    animation: modalSlideIn 0.3s ease;
}

.animate-modal-out {
    animation: modalSlideOut 0.2s ease;
}

/* 模态框头部 */
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.modal-header.modal-success .modal-icon {
    background: #d1fae5;
    color: #10b981;
}

.modal-header.modal-error .modal-icon,
.modal-header.modal-danger .modal-icon {
    background: #fee2e2;
    color: #ef4444;
}

.modal-header.modal-warning .modal-icon {
    background: #fed7aa;
    color: #f59e0b;
}

.modal-header.modal-info .modal-icon {
    background: #dbeafe;
    color: #3b82f6;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color, #1f2937);
    margin: 0;
}

/* 模态框内容 */
.modal-body {
    padding: 24px;
}

.modal-message {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

/* 模态框底部 */
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color, #e5e5e5);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer-center {
    justify-content: center;
}

/* 模态框按钮 */
.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 80px;
}

.modal-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-btn-cancel {
    background: var(--background-secondary, #f3f4f6);
    color: var(--text-secondary, #6b7280);
}

.modal-btn-cancel:hover {
    background: var(--border-color, #e5e5e5);
}

.modal-btn-confirm {
    color: white;
}

.modal-btn-info {
    background: #3b82f6;
}

.modal-btn-info:hover {
    background: #2563eb;
}

.modal-btn-success {
    background: #10b981;
}

.modal-btn-success:hover {
    background: #059669;
}

.modal-btn-danger,
.modal-btn-error {
    background: #ef4444;
}

.modal-btn-danger:hover,
.modal-btn-error:hover {
    background: #dc2626;
}

.modal-btn-warning {
    background: #f59e0b;
}

.modal-btn-warning:hover {
    background: #d97706;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .custom-modal-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
    
    .custom-modal {
        background: #243140;
        color: #e0e9f0;
    }
    
    .modal-header {
        border-bottom-color: #354555;
    }
    
    .modal-title {
        color: #e0e9f0;
    }
    
    .modal-message {
        color: #a0b3c5;
    }
    
    .modal-footer {
        border-top-color: #354555;
    }
    
    .modal-btn-cancel {
        background: #2a3b4d;
        color: #a0b3c5;
    }
    
    .modal-btn-cancel:hover {
        background: #354555;
    }
    
    .modal-header.modal-success .modal-icon {
        background: rgba(16, 185, 129, 0.2);
    }
    
    .modal-header.modal-error .modal-icon,
    .modal-header.modal-danger .modal-icon {
        background: rgba(239, 68, 68, 0.2);
    }
    
    .modal-header.modal-warning .modal-icon {
        background: rgba(245, 158, 11, 0.2);
    }
    
    .modal-header.modal-info .modal-icon {
        background: rgba(59, 130, 246, 0.2);
    }
}

/* 响应式设计 */
@media (max-width: 480px) {
    .custom-modal {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 14px 20px;
    }
}