:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-secondary: #64748B;
    --border: #E2E8F0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px;
}

header {
    text-align: center;
    padding: 32px 0 24px;
}

header h1 {
    color: var(--primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

main {
    padding-bottom: 32px;
}

.search-section {
    background-color: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: var(--bg);
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--surface);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.form-group input[type="url"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: var(--bg);
}

.form-group input[type="url"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--surface);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group .hint {
    font-weight: normal;
    color: var(--text-secondary);
    font-size: 12px;
}

.auth-section, .config-section {
    background-color: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    background-color: var(--border);
    color: var(--text);
}

.btn {
    color: var(--text-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--border);
    color: var(--text);
}

    .btn-secondary:hover {
    background-color: #CBD5E1;
}

/* Streaming text */
.streaming-text {
    line-height: 1.8;
    color: var(--text);
    font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--primary);
    animation: blink 1s infinite;
    margin-left: 2px;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Danger button */
.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #DC2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Cache section styles */
.cache-section {
    background-color: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.warning-box {
    background: linear-gradient(135deg, #FEF2F2, #FEF7F7);
    border: 1px solid #FECACA;
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 24px;
}

.warning-box h3 {
    color: var(--danger);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.warning-box p {
    color: var(--text);
    font-size: 14px;
    margin-bottom: 12px;
}

.warning-box ul {
    margin: 12px 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.warning-box li {
    margin-bottom: 6px;
}

#loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

#loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-section, .error-section {
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section h2, .error-section h2 {
    font-size: 16px;
    font-weight: 600;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg);
}

.result-section h2 {
    color: var(--success);
}

.error-section h2 {
    color: var(--danger);
}

.result-item {
    padding: 20px;
}

.food-name {
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
    font-size: 18px;
    font-weight: 700;
}

.markdown-body {
    line-height: 1.8;
    color: var(--text);
    font-size: 15px;
}

.markdown-body strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.markdown-body p {
    margin-bottom: 16px;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.markdown-body li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.markdown-body li strong {
    color: var(--text);
}

.markdown-body code {
    background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.875em;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    color: var(--primary-dark);
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.markdown-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 14px 18px;
    margin: 16px 0;
    background: linear-gradient(135deg, #F8FAFC, #EEF2FF);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.markdown-body em {
    color: var(--text-secondary);
    font-style: normal;
    background-color: rgba(79, 70, 229, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 表格样式 */
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-size: 14px;
}

.markdown-body thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.markdown-body th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    border: none;
    letter-spacing: 0.3px;
}

.markdown-body td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.markdown-body tbody tr:hover {
    background-color: #F8FAFC;
    transition: background-color 0.15s ease;
}

.markdown-body tbody tr:last-child td {
    border-bottom: none;
}

/* GI值高亮 */
.markdown-body td:nth-child(2) {
    font-weight: 600;
    color: var(--primary);
}

@media (max-width: 480px) {
    .markdown-body table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .markdown-body th,
    .markdown-body td {
        padding: 10px 12px;
    }
}

#errorSection .error-content {
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.alert {
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.hidden {
    display: none !important;
}

/* Source badge */
.source-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: #F1F5F9;
    color: #475569;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

/* Similarity badge */
.similarity-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
    margin-right: 8px;
}

.similarity-badge.match-high {
    background-color: #ECFDF5;
    color: #065F46;
}

.similarity-badge.match-medium {
    background-color: #FFFBEB;
    color: #92400E;
}

.similarity-badge.match-low {
    background-color: #FEF2F2;
    color: #991B1B;
}

.no-match-notice {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
}

.no-match-notice i {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
    color: var(--text-disabled, #CBD5E1);
}

.no-match-notice p {
    margin: 4px 0;
}

.no-match-hint {
    font-size: 14px;
    color: var(--text-disabled, #CBD5E1);
}

/* Disclaimer */
.disclaimer {
    background-color: #F8FAFC;
    border-top: 1px solid var(--border);
    padding: 14px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Recipe recommendation section */
.recipe-recommend-section {
    border-top: 1px solid var(--border);
    padding: 16px 20px;
}

.recipe-recommend-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.recommend-loading {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 8px 0;
}

.recommend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recommend-card {
    display: block;
    padding: 12px 14px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.recommend-card:hover {
    border-color: var(--primary-light);
    background-color: var(--surface);
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.1);
}

.recommend-card-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.recommend-card-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.recommend-card-tag {
    background-color: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

@media (max-width: 480px) {
    .container {
        padding: 16px 12px;
    }
    
    header {
        padding: 24px 0 20px;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    header p {
        font-size: 13px;
    }
    
    .search-section, .auth-section, .config-section {
        padding: 20px 16px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="url"],
    .form-group input[type="password"] {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .result-item {
        padding: 16px;
    }
    
    .food-name {
        font-size: 16px;
    }
    
    .markdown-body {
        font-size: 14px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0F172A;
        --surface: #1E293B;
        --text: #F1F5F9;
        --text-secondary: #94A3B8;
        --border: #334155;
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    }
    
    .form-group input[type="text"] {
        color: var(--text);
    }
    
    .markdown-body code {
        background-color: #0F172A;
    }
    
    .markdown-body blockquote {
        background-color: #1E293B;
    }
    
    .alert-success {
        background-color: #052E16;
        border-color: #064E3B;
    }
    
    .alert-error {
        background-color: #450A0A;
        border-color: #7F1D1D;
    }
    
    .btn-outline {
        border-color: var(--border);
    }
    
    .btn-outline:hover {
        background-color: var(--border);
    }
    
    .streaming-text {
        line-height: 1.8;
        color: var(--text);
        font-size: 15px;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    .cursor {
        display: inline-block;
        width: 2px;
        height: 1em;
        background-color: var(--primary);
        animation: blink 1s infinite;
        margin-left: 2px;
        vertical-align: text-bottom;
    }
    
    @keyframes blink {
        0%, 50% { opacity: 1; }
        51%, 100% { opacity: 0; }
    }
}

/* ===== Tab Navigation ===== */
.tab-content {
    min-height: calc(100vh - 200px);
    padding-bottom: 80px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Bottom Tab Bar */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.tab-button {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    font-family: inherit;
}

.tab-button:hover {
    color: var(--primary);
}

.tab-button.active {
    color: var(--primary);
}

.tab-icon {
    font-size: 22px;
    line-height: 1;
}

.tab-label {
    font-size: 12px;
    font-weight: 500;
}

/* ===== Recipe Tab Styles ===== */
.recipe-hero {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #2563EB 100%);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: white;
}

.recipe-hero h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    border: none;
    background: none;
    padding: 0;
    color: white;
}

.recipe-hero .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

/* Weekly Recipe Section */
.weekly-recipe-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.weekly-recipe-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.weekly-recipe-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 0.25rem;
}

.weekly-recipe-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Weekly Recipe Slider */
.weekly-recipe-slider {
    position: relative;
    overflow: hidden;
    margin: 0 -0.5rem;
}

.weekly-slider-container {
    display: flex;
    transition: transform 0.3s ease;
}

.weekly-day-slide {
    min-width: 100%;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

.weekly-day-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    border: 1px solid var(--border);
}

.weekly-day-header {
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.weekly-day-header.today {
    background: var(--success);
}

.weekly-meal-section {
    margin-bottom: 0.75rem;
}

.weekly-meal-section:last-child {
    margin-bottom: 0;
}

.weekly-meal-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    border-bottom: 1px dashed var(--border);
}

.weekly-recipe-item {
    font-size: 0.85rem;
    padding: 0.25rem 0;
    color: var(--text);
    line-height: 1.4;
    text-decoration: none;
    display: block;
    transition: color 0.2s;
}

a.weekly-recipe-item:hover {
    color: var(--primary);
    text-decoration: underline;
}

.weekly-recipe-item::before {
    content: "•";
    color: var(--primary);
    margin-right: 0.3rem;
}

/* Slider Navigation Buttons */
.weekly-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: var(--shadow);
}

.weekly-slider-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.weekly-slider-prev {
    left: 0.5rem;
}

.weekly-slider-next {
    right: 0.5rem;
}

/* Slider Dots */
.weekly-slider-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.weekly-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.weekly-slider-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

.weekly-slider-dot.today {
    background: var(--success);
}

.weekly-slider-dot.today.active {
    background: var(--success);
}

/* Recipe Search */
.recipe-search-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.recipe-search-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 1.1rem;
}

.recipe-search-wrapper input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--surface);
    transition: all 0.2s;
}

.recipe-search-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.search-actions button {
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-search {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-clear {
    background: var(--bg);
    color: var(--text-secondary);
}

.btn-clear:hover {
    background: var(--border);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1.2rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.25s;
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.filter-tab.active {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Recipe Count */
.recipe-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-left: 0.25rem;
}

/* Recipe Grid & Cards */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.recipe-card {
    border: none;
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: cardFadeIn 0.4s ease both;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.recipe-card::before {
    content: '';
    display: block;
    height: 4px;
    width: 100%;
}

.recipe-card[data-meal="早餐"]::before { background: linear-gradient(90deg, #F59E0B, #F97316); }
.recipe-card[data-meal="正餐"]::before { background: linear-gradient(90deg, #3B82F6, #6366F1); }
.recipe-card[data-meal="加餐"]::before { background: linear-gradient(90deg, #10B981, #14B8A6); }

.card-body { padding: 1.2rem; }
.card-body h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.recipe-meta {
    display: flex;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    align-items: center;
}

.meal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.meal-badge.早餐 { background: #FEF3C7; color: #92400E; }
.meal-badge.正餐 { background: #DBEAFE; color: #1E40AF; }
.meal-badge.加餐 { background: #D1FAE5; color: #065F46; }

.card-arrow {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: all 0.2s;
}

.recipe-card:hover .card-arrow {
    background: var(--primary);
    color: white;
    transform: translateX(2px);
}

/* Skeleton Loading */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.skeleton-card {
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.skeleton-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-body { padding: 1.2rem; }

.skeleton-title {
    height: 1.2rem;
    width: 70%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    margin-bottom: 0.75rem;
}

.skeleton-meta {
    display: flex;
    gap: 0.5rem;
}

.skeleton-tag {
    height: 1.2rem;
    width: 3.5rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button:not(:disabled):hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.pagination .page-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0 0.5rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-results .emoji { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* Mobile Responsive */
@media (max-width: 480px) {
    .recipe-grid, .skeleton-grid {
        grid-template-columns: 1fr;
    }
    
    .recipe-hero {
        padding: 1.5rem 1rem;
    }
    
    .recipe-hero h2 {
        font-size: 1.25rem;
    }
    
    .weekly-day-card {
        padding: 1rem;
    }
    
    .weekly-slider-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .bottom-tab-bar {
        height: 56px;
    }
    
    .tab-icon {
        font-size: 20px;
    }
    
    .tab-label {
        font-size: 11px;
    }
}

/* Dark Mode for Recipe Tab */
@media (prefers-color-scheme: dark) {
    .recipe-hero {
        background: linear-gradient(135deg, #4338CA 0%, #6D28D9 50%, #1D4ED8 100%);
    }
    
    .recipe-search-wrapper input {
        background: var(--surface);
        border-color: var(--border);
        color: var(--text);
    }
    
    .recipe-search-wrapper input:focus {
        border-color: #818CF8;
        box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.15);
    }
    
    .filter-tab {
        background: var(--surface);
        border-color: var(--border);
        color: var(--text-secondary);
    }
    
    .filter-tab.active {
        background: linear-gradient(135deg, #6366F1, #8B5CF6);
    }
    
    .recipe-card {
        background: var(--surface);
    }
    
    .card-body h3 {
        color: var(--text);
    }
    
    .card-arrow {
        background: var(--border);
        color: var(--text-secondary);
    }
    
    .btn-clear {
        background: var(--border);
        color: var(--text-secondary);
    }
    
    .skeleton-card {
        background: var(--surface);
    }
    
    .skeleton-bar, .skeleton-title, .skeleton-tag {
        background: linear-gradient(90deg, var(--border) 25%, #475569 50%, var(--border) 75%);
        background-size: 200% 100%;
    }
    
    .pagination button {
        background: var(--surface);
        border-color: var(--border);
        color: var(--text-secondary);
    }
    
    .bottom-tab-bar {
        background: var(--surface);
        border-top-color: var(--border);
    }
}

/* Top 3 Matches Buttons */
.top-matches-buttons {
    margin-bottom: 16px;
}

.similar-recommend-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--surface);
}

.similar-recommend-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.similar-recommend-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.top-match-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.top-match-btn:hover {
    border-color: var(--primary-light);
    background: #F5F3FF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.top-match-btn .match-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.top-match-btn .match-percent {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
}
