/* ================== 基础样式重置 ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================== 全局隐藏滚动条 (保留功能) ================== */
/* Chrome, Safari, Opera */
::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    background: transparent;
    display: none;
}
/* Firefox */
html {
    scrollbar-width: none;
    height: 100%;
}
/* IE 10+ */
body {
    -ms-overflow-style: none;
    min-height: 100%;
}

/* ================== 根元素样式 - 浅色模式（默认） ================== */
:root {
    /* 颜色变量 - 基于logo配色 */
    --primary-color: #5BA3C5;      /* 主色调 - 天蓝色 */
    --primary-light: #7ABBD7;      /* 浅天蓝色 */
    --primary-dark: #4A8FB0;       /* 深天蓝色 */
    --primary-pale: #E8F4F9;       /* 极浅天蓝 */
    
    --secondary-color: #F4C467;    /* 次要色 - 金黄色 */
    --secondary-light: #FFD489;    /* 浅金黄色 */
    --secondary-dark: #E6A94F;     /* 深金黄色 */
    
    --accent-color: #FF9557;       /* 强调色 - 火焰橙 */
    --accent-light: #FFB380;       /* 浅橙色 */
    
    --heart-color: #ff4d4f;        /* 爱心颜色 - 红色 */

    --cloud-color: #FFF5E6;        /* 云朵色 - 奶白色 */
    --background-color: #F2F7FA;   /* 背景色 - 极浅蓝 */
    --background-secondary: #E8F0F5; /* 次要背景色 */
    --card-background: #ffffff;    /* 卡片背景色 */
    --text-color: #2C4A5C;         /* 文字颜色 - 深蓝灰 */
    --text-secondary: #7A95A8;     /* 次要文字 - 中蓝灰 */
    --text-tertiary: #A3BCCC;      /* 三级文字 */
    --border-color: #DAE8F0;       /* 边框颜色 - 浅蓝灰 */
    --white: #ffffff;
    --shadow-color: rgba(91, 163, 197, 0.08);
    --shadow-medium: rgba(91, 163, 197, 0.12);
    --shadow-hover: rgba(91, 163, 197, 0.18);
    
    /* 导航栏特定颜色 */
    --nav-background: rgba(255, 255, 255, 0.92);
    --nav-shadow: rgba(91, 163, 197, 0.06);
    --nav-item-hover: rgba(244, 196, 103, 0.08);
    --nav-active-color: #E6A94F;
    
    /* 表单控件颜色 */
    --input-background: #ffffff;
    --input-border: #D6E7F0;
    --input-focus-shadow: rgba(91, 163, 197, 0.1);
    
    /* 尺寸变量 */
    --header-height: 56px;
    --bottom-nav-height: 64px;
    --section-gap: 28px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

/* ================== 深色模式 ================== */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #6BAFD1;
        --primary-light: #8AC5E3;
        --primary-dark: #5A9ABC;
        --primary-pale: #1E3040;
        
        --secondary-color: #F4C467;
        --secondary-light: #FFD489;
        --secondary-dark: #E6A94F;
        
        --accent-color: #FF9557;
        --accent-light: #FFB380;
        
        --heart-color: #ff5e61;

        --cloud-color: #3A4D5C;
        --background-color: #151E27;
        --background-secondary: #1C2A36;
        --card-background: #1F2F3D;
        --text-color: #E0E9F0;
        --text-secondary: #8EA8BC;
        --text-tertiary: #5A7A90;
        --border-color: #2A3E4E;
        --white: #ffffff;
        --shadow-color: rgba(0, 0, 0, 0.2);
        --shadow-medium: rgba(0, 0, 0, 0.3);
        --shadow-hover: rgba(0, 0, 0, 0.4);
        
        --nav-background: rgba(31, 47, 61, 0.95);
        --nav-shadow: rgba(0, 0, 0, 0.3);
        --nav-item-hover: rgba(244, 196, 103, 0.12);
        --nav-active-color: #F4C467;
        
        --input-background: #2A3B4D;
        --input-border: #354555;
        --input-focus-shadow: rgba(107, 175, 209, 0.2);
    }
}

/* ================== 全局样式 ================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
                 "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding-top: var(--header-height);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ================== 滚动渐入动画 ================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ================== 顶部导航栏 ================== */
.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 16px rgba(91, 163, 197, 0.2);
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .site-header {
        background: linear-gradient(135deg, #1F2F3D, #2A3E4E);
        box-shadow: 0 1px 0 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: 10px;
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.site-title .site-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: inline-block;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15));
    border-radius: 6px;
}

/* 顶部用户信息区域 */
.header-user-info {
    display: flex;
    align-items: center;
}

.user-hearts {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.18);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (prefers-color-scheme: dark) {
    .user-hearts {
        background: rgba(0, 0, 0, 0.25);
        border-color: rgba(255, 255, 255, 0.06);
    }
}

.hearts-count {
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
}

.hearts-icon {
    width: 16px;
    height: 16px;
    fill: var(--heart-color);
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.get-hearts-link {
    color: var(--white);
    font-size: 12px;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    transition: all 0.25s ease;
    font-weight: 500;
}

@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.28);
    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);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 20px 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: 3px;
    height: 100%;
    color: var(--text-tertiary);
    transition: all 0.25s ease;
    position: relative;
    text-decoration: none;
}

/* SVG 图标样式 */
.nav-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: block;
}

/* 导航项文字 */
.nav-item span {
    font-size: 11px;
    font-weight: 500;
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
}

/* 导航项悬停效果 */
.nav-item:hover {
    color: var(--primary-color);
}

.nav-item:hover .nav-icon {
    transform: translateY(-2px);
}

/* 导航项激活状态 */
.nav-item.active {
    color: var(--nav-active-color);
}

.nav-item.active .nav-icon {
    transform: scale(1.12);
    filter: drop-shadow(0 2px 6px rgba(244, 196, 103, 0.35));
}

.nav-item.active span {
    font-weight: 600;
}

/* 激活状态顶部指示条 */
.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 0 0 3px 3px;
    box-shadow: 0 2px 8px rgba(244, 196, 103, 0.4);
}

/* 导航项点击效果 */
.nav-item:active {
    background-color: var(--nav-item-hover);
    border-radius: 8px;
}

.nav-item:active .nav-icon {
    transform: scale(0.92);
}

/* ================== 响应式设计 ================== */
@media (min-width: 768px) {
    .main-content {
        padding: 28px 24px;
        padding-bottom: calc(var(--bottom-nav-height) + 50px);
    }
    
    .bottom-nav {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
        bottom: 12px;
        border-radius: 18px;
        border: 1px solid var(--border-color);
        box-shadow: 0 4px 24px var(--shadow-medium);
    }
    
    .nav-icon {
        width: 24px;
        height: 24px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 36px 32px;
        padding-bottom: calc(var(--bottom-nav-height) + 80px);
    }
    
    .bottom-nav {
        max-width: 460px;
        bottom: 16px;
        border-radius: 20px;
        box-shadow: 0 4px 32px var(--shadow-medium);
    }
    
    .nav-icon {
        width: 24px;
        height: 24px;
    }
}

/* ================== 工具类 ================== */
.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;
}

/* ================== 按钮样式 ================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    box-shadow: 0 3px 12px rgba(91, 163, 197, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 163, 197, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: var(--white);
    box-shadow: 0 3px 12px rgba(244, 196, 103, 0.25);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 196, 103, 0.3);
}

/* ================== 卡片样式 ================== */
.card {
    background: var(--card-background);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 0 2px 12px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 6px 24px 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) {
    img {
        opacity: 0.92;
    }
    
    .site-logo {
        filter: brightness(1.1) drop-shadow(0 1px 3px 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.92) translateY(-16px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.92) translateY(-16px);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ================== 模态框 ================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

.custom-modal {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.animate-modal-in {
    animation: modalSlideIn 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.animate-modal-out {
    animation: modalSlideOut 0.2s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    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: 17px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-message {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer-center {
    justify-content: center;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    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);
    color: var(--text-secondary);
}

.modal-btn-cancel:hover {
    background: var(--border-color);
}

.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.65);
    }
    
    .custom-modal {
        background: var(--card-background);
        border-color: var(--border-color);
    }
    
    .modal-title {
        color: var(--text-color);
    }
    
    .modal-message {
        color: var(--text-secondary);
    }
    
    .modal-btn-cancel {
        background: var(--background-secondary);
        color: var(--text-secondary);
    }
    
    .modal-btn-cancel:hover {
        background: var(--border-color);
    }
    
    .modal-header.modal-success .modal-icon {
        background: rgba(16, 185, 129, 0.15);
    }
    
    .modal-header.modal-error .modal-icon,
    .modal-header.modal-danger .modal-icon {
        background: rgba(239, 68, 68, 0.15);
    }
    
    .modal-header.modal-warning .modal-icon {
        background: rgba(245, 158, 11, 0.15);
    }
    
    .modal-header.modal-info .modal-icon {
        background: rgba(59, 130, 246, 0.15);
    }
}

/* 模态框响应式 */
@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; }
}