/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 浅色主题 */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: #f8f9ff;
    --bg-card: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    --border-color: #e2e8f0;
    --accent-color: #667eea;
    --accent-hover: #5568d3;
    --shadow-sm: 0 2px 8px rgba(102, 126, 234, 0.1);
    --shadow-md: 0 4px 16px rgba(102, 126, 234, 0.15);
    --shadow-lg: 0 10px 40px rgba(102, 126, 234, 0.2);
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
}

body.dark-theme {
    /* 深色主题 */
    --bg-primary: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    --bg-secondary: #1a202c;
    --bg-card: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
    --accent-color: #9f7aea;
    --accent-hover: #805ad5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 背景装饰 ==================== */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.flower-particle {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 182, 193, 0.3), transparent);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.flower-particle:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.flower-particle:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 2s;
}

.flower-particle:nth-child(3) {
    top: 30%;
    left: 60%;
    animation-delay: 4s;
}

.flower-particle:nth-child(4) {
    top: 80%;
    left: 20%;
    animation-delay: 6s;
}

.flower-particle:nth-child(5) {
    top: 50%;
    left: 40%;
    animation-delay: 8s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(30px, -30px) scale(1.2);
        opacity: 0.6;
    }
}

/* ==================== 顶部导航 ==================== */
.header {
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    animation: rotate-flower 3s infinite ease-in-out;
}

@keyframes rotate-flower {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(15deg); }
}

.logo-text {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn, .theme-toggle {
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover, .theme-toggle:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.theme-toggle {
    padding: 0.6rem 1rem;
}

.theme-icon {
    font-size: 1.2rem;
}

/* ==================== 主要内容 ==================== */
.main-content {
    position: relative;
    z-index: 1;
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

/* ==================== 搜索区域 ==================== */
.search-section {
    margin-bottom: 3rem;
}

.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.search-container {
    max-width: 700px;
    margin: 0 auto 2rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.search-icon {
    font-size: 1.3rem;
    margin-right: 12px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: var(--text-primary);
    padding: 0.8rem 0;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    background: var(--text-muted);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: var(--danger-color);
    transform: scale(1.1);
}

/* ==================== 统计栏 ==================== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 1.8rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.stat-clock {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: var(--success-color);
    animation: blink-cursor 1s step-end infinite;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.stat-time {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid var(--accent-color);
}

/* ==================== 筛选标签 ==================== */
.filter-section {
    margin-bottom: 2rem;
}

.filter-tags {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.filter-tag:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.filter-tag.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* ==================== 加载动画 ==================== */
.loading {
    text-align: center;
    padding: 4rem 0;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 0;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* AI 搜索按钮 */
.ai-search-btn {
    margin-top: 1.5rem;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.ai-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.ai-search-btn:active {
    transform: translateY(0);
}

/* ==================== 卡片网格 ==================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.flower-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.flower-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

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

.flower-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.flower-emoji {
    font-size: 3rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.favorite-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
}

.favorite-btn:hover {
    transform: scale(1.2);
    background: rgba(102, 126, 234, 0.1);
}

.favorite-btn.active {
    animation: heartbeat 0.6s ease;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
}

.flower-name {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.flower-name-en {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.flower-meaning {
    margin-bottom: 1rem;
}

.meaning-label {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.meaning-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.flower-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-details {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s ease;
}

.view-details:hover {
    gap: 10px;
}

.query-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-time {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--success-color);
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1), rgba(72, 187, 120, 0.05));
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    border: 1px solid rgba(72, 187, 120, 0.2);
    transition: all 0.3s ease;
}

.flower-card:hover .card-time {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.2), rgba(72, 187, 120, 0.1));
    border-color: var(--success-color);
    transform: scale(1.05);
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 3rem 0;
}

.page-btn {
    padding: 0.8rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-btn:hover:not(:disabled) {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 8px;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-primary);
}

.page-number:hover {
    border-color: var(--accent-color);
}

.page-number.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* ==================== 弹窗 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 25px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--danger-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    transform: rotate(90deg) scale(1.1);
}

.modal-body {
    padding: 3rem;
}

.modal-flower-emoji {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-flower-name {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-flower-name-en {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section-title {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.modal-section-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.modal-meaning {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-color);
}

.modal-time {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success-color);
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1), rgba(72, 187, 120, 0.05));
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    border-left: 4px solid var(--success-color);
    animation: time-glow 2s ease-in-out infinite;
}

@keyframes time-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(72, 187, 120, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(72, 187, 120, 0.4);
    }
}

/* ==================== 底部 ==================== */
.footer {
    background: var(--bg-card);
    padding: 2rem 0;
    margin-top: 4rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-content {
    text-align: center;
}

.footer-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.footer-icon {
    font-size: 1.3rem;
}

.footer-copyright {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.update-time-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
}

.live-indicator {
    color: var(--success-color);
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ==================== 回到顶部 ==================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .search-title {
        font-size: 2rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-bar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-item {
        padding: 0.8rem 1rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .filter-tags {
        gap: 8px;
    }
    
    .filter-tag {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-body {
        padding: 2rem 1.5rem;
    }
    
    .modal-flower-name {
        font-size: 2rem;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

