/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 柔和的牛油果绿/薄荷绿主色系 */
    --primary-color: #66BB6A;
    --primary-light: #81C784;
    --primary-dark: #4CAF50;
    --primary-bg: #F1F8E9;
    --primary-gradient: linear-gradient(135deg, #66BB6A 0%, #81C784 100%);

    /* 辅助色 - 温暖的黄色系 */
    --secondary-color: #66BB6A;
    --accent-color: #FFB74D;
    --accent-light: #FFCC80;

    /* 中性色 - 更柔和的色调 */
    --text-dark: #2E2E2E;
    --text-light: #757575;
    --text-muted: #9E9E9E;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --bg-soft: #F5F5F5;
    --border-color: #E8E8E8;
    --border-light: #F0F0F0;

    /* 阴影效果 */
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-soft: 0 4px 16px rgba(102, 187, 106, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    letter-spacing: 0.01em;
}

.app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-white);
    position: relative;
    /* 确保不会遮挡固定定位的元素 */
    z-index: 1;
}

/* Page Management */
.page {
    display: none;
    min-height: 100vh;
    padding-bottom: 80px;
}

.page.active {
    display: block;
}

/* Headers */
.app-header {
    background: var(--primary-gradient);
    color: white;
    padding: 40px 20px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.app-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.app-header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.page-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

.page-header h2 {
    font-size: 20px;
    flex: 1;
}

.back-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.back-btn:active {
    background: var(--bg-light);
}

/* Today Summary */
.today-summary {
    padding: 28px;
    background: var(--bg-white);
    margin: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}

.today-summary h2 {
    font-size: 20px;
    margin-bottom: 24px;
    color: var(--text-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.today-summary h2::before {
    content: '📊';
    font-size: 22px;
}

.summary-section {
    margin-bottom: 20px;
}

.summary-section:last-child {
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-color);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.summary-grid-small {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 12px;
    background: var(--primary-bg);
    border-radius: 12px;
    border: 1px solid var(--primary-light);
    min-height: 88px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-item:hover::before {
    opacity: 1;
}

.summary-item-small {
    padding: 14px 6px;
    min-height: 80px;
}

.summary-item .label {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 3px;
    text-align: center;
}

.summary-item-small .label {
    font-size: 10px;
}

.summary-item .value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2px;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.summary-item.updated .value {
    animation: valueUpdate 0.6s ease;
}

@keyframes valueUpdate {
    0% {
        transform: scale(1);
        color: var(--primary-color);
    }
    50% {
        transform: scale(1.1);
        color: var(--primary-light);
    }
    100% {
        transform: scale(1);
        color: var(--primary-color);
    }
}

.summary-item-small .value {
    font-size: 20px;
    font-weight: 700;
}

.summary-item .unit {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.summary-item-small .unit {
    font-size: 10px;
}

/* Buttons */
.action-buttons {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn:hover::before {
    opacity: 1;
}

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

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary:hover {
    background: var(--accent-light);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:active {
    background: var(--primary-dark);
    transform: scale(0.96) translateY(1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: var(--accent-color);
    color: white;
}

.btn-secondary:active {
    background: #FF9800;
    transform: scale(0.96) translateY(1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-outline {
    background: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:active {
    background: var(--bg-light);
}

.btn-large {
    padding: 20px;
    font-size: 18px;
    margin-top: 20px;
}

.btn svg {
    flex-shrink: 0;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: 100%;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 0 0 3px 3px;
    transition: width 0.3s ease;
}

.nav-btn.active::before {
    width: 24px;
}

.nav-btn.active {
    color: var(--primary-color);
    transform: translateY(-1px);
}

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

.nav-btn svg {
    transition: transform 0.3s ease;
}

.nav-btn:hover svg {
    transform: scale(1.1);
}

.nav-btn.active svg {
    transform: scale(1.1);
}

.nav-btn span {
    font-size: 12px;
}

/* Image Preview */
.image-preview {
    margin: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Food Templates Grid */
.food-templates {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.food-template {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.food-template:active {
    transform: scale(0.95);
    border-color: var(--primary-color);
}

.food-template.selected {
    border-color: var(--primary-color);
    background: #E8F5E9;
}

.food-template-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-light);
}

.food-template-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.food-template-calories {
    font-size: 12px;
    color: var(--text-light);
}

/* Custom Food Section */
.custom-food-section {
    padding: 20px;
    padding-bottom: 10px;
}

.section-divider {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    padding: 10px 20px;
    position: relative;
}

.section-divider::before,
.section-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: var(--border-color);
}

.section-divider::before {
    left: 10px;
}

.section-divider::after {
    right: 10px;
}

/* Custom Food Form */
.custom-food-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ai-suggestion-box {
    background: #E3F2FD;
    border: 1px solid #90CAF9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1976D2;
    margin-bottom: 12px;
}

.suggestion-header svg {
    color: #1976D2;
}

#aiSuggestionContent {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.6;
}

.suggestion-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #F5F5F5;
}

.suggestion-item:last-child {
    margin-bottom: 0;
}

/* Edit Page */
.edit-content {
    padding: 20px;
}

.food-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.food-item {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.food-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.food-item-name {
    font-size: 16px;
    font-weight: 600;
}

.remove-food-btn {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    padding: 4px;
}

.portion-control {
    margin-bottom: 12px;
}

.portion-control label {
    display: block;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.portion-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-light);
    outline: none;
    -webkit-appearance: none;
}

.portion-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.portion-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.portion-value {
    display: inline-block;
    margin-left: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

.notes-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
}

.food-item-nutrition {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.nutrition-item {
    text-align: center;
}

.nutrition-item .label {
    font-size: 11px;
    color: var(--text-light);
    display: block;
}

.nutrition-item .value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.add-food-btn {
    width: 100%;
}

/* Nutrition Summary */
.nutrition-summary {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.nutrition-summary h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.nutrition-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nutrition-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.bar-bg {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.bar-calories {
    background: linear-gradient(90deg, #FF6B6B, #FF8E53);
}

.bar-protein {
    background: linear-gradient(90deg, #4ECDC4, #44A08D);
}

.bar-fat {
    background: linear-gradient(90deg, #FFD93D, #F6C86B);
}

.bar-carbs {
    background: linear-gradient(90deg, #A8E6CF, #6BCF7F);
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    gap: 8px;
}

.theme-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Card Preview */
.card-preview {
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 60vh;
}

.log-card {
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

/* Card Themes */
.log-card.theme-fresh {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #1B5E20;
}

.log-card.theme-dark {
    background: linear-gradient(135deg, #37474F 0%, #263238 100%);
    color: #ECEFF1;
}

.log-card.theme-minimal {
    background: #FFFFFF;
    color: #212121;
    border: 2px solid #E0E0E0;
}

.card-header {
    text-align: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-date {
    font-size: 14px;
    opacity: 0.8;
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
}

.card-foods {
    margin-bottom: 20px;
}

.card-food-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.card-food-item:last-child {
    border-bottom: none;
}

.card-nutrition {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    background: rgba(255,255,255,0.3);
    border-radius: 12px;
}

.theme-dark .card-nutrition {
    background: rgba(0,0,0,0.2);
}

.card-nutrition-item {
    text-align: center;
}

.card-nutrition-item .label {
    font-size: 12px;
    opacity: 0.8;
    display: block;
    margin-bottom: 4px;
}

.card-nutrition-item .value {
    font-size: 20px;
    font-weight: 700;
    display: block;
}

.card-nutrition-item .unit {
    font-size: 12px;
    opacity: 0.8;
    display: block;
    margin-top: 2px;
}

/* History Page */
.history-list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.history-item:active {
    transform: scale(0.98);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-date {
    font-size: 14px;
    font-weight: 600;
}

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

.history-foods {
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.history-calories {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Responsive */
@media (min-width: 600px) {
    .app {
        box-shadow: var(--shadow-lg);
    }

    .bottom-nav {
        box-shadow: var(--shadow);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-soft);
    }
    50% {
        transform: scale(1.02);
        box-shadow: var(--shadow-lg);
    }
}

.pulse-animation {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.page.active {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.transitioning-right {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.transitioning-left {
    animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Loading Spinner for AI Recognition */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(76, 175, 80, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

/* Suggestion Item Styles */
.suggestion-item {
    padding: 12px;
    margin: 8px 0;
    background: var(--bg-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.suggestion-item:hover {
    background: #e8f5e9;
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.suggestion-item:active {
    transform: translateX(2px);
}
.section-title { font-size: 14px; font-weight: 600; color: #212121; margin: 20px 0 12px 0; padding-bottom: 8px; border-bottom: 2px solid #4CAF50; }

/* AI Chat Panel Styles */
.ai-chat-toggle {
    position: fixed;
    right: 20px;
    bottom: 120px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #45a049 100%);
    color: white;
    border: none;
    outline: none;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    /* 确保按钮在所有元素之上 */
    pointer-events: auto;
}

.ai-chat-toggle:hover {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.ai-chat-toggle.dragging {
    cursor: grabbing;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.6);
}

.ai-chat-toggle:active:not(.dragging) {
    transform: scale(0.95);
}

.ai-chat-toggle:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.6);
}

.ai-chat-panel {
    position: fixed;
    right: -100%;
    top: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--bg-white);
    box-shadow: none;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}

.ai-chat-panel.active {
    right: 0 !important;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #45a049 100%);
    color: white;
}

.ai-chat-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.ai-chat-close {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-chat-close:hover {
    background: rgba(255,255,255,0.3);
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-light);
}

.ai-message, .user-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease;
}

.user-message {
    flex-direction: row-reverse;
}

.ai-avatar, .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-avatar {
    background: var(--secondary-color);
}

.ai-message-content, .user-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 75%;
    box-shadow: var(--shadow);
    line-height: 1.5;
}

.user-message-content {
    background: var(--secondary-color);
    color: white;
}

.ai-message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-message-content li {
    margin: 4px 0;
}

.ai-message-content h3,
.ai-message-content h4 {
    margin: 12px 0 8px 0;
    color: var(--primary-color);
    font-weight: 600;
}

.ai-message-content h3 {
    font-size: 16px;
}

.ai-message-content h4 {
    font-size: 14px;
}

.ai-message-content p {
    margin: 8px 0;
    line-height: 1.6;
}

.ai-message-content strong {
    font-weight: 600;
    color: #333;
}

.ai-message-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 13px;
    color: #e91e63;
}

.ai-message-content pre {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.ai-message-content pre code {
    background: none;
    padding: 0;
    color: #333;
    font-size: 13px;
    line-height: 1.4;
}

.ai-chat-input-container {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: white;
    border-top: 1px solid var(--border-color);
}

.ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ai-chat-input:focus {
    border-color: var(--primary-color);
}

.ai-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-chat-send:hover {
    background: #45a049;
    transform: scale(1.05);
}

.ai-chat-send:active {
    transform: scale(0.95);
}

.ai-chat-send:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.ai-message.loading .ai-message-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-typing-indicator {
    display: flex;
    gap: 4px;
}

.ai-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typing 1.4s infinite;
}

.ai-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

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

/* 移动端适配 */
@media (max-width: 600px) {
    .ai-chat-panel {
        max-width: 100%;
    }

    .ai-chat-toggle {
        right: 16px;
        bottom: 100px;
    }
}

/* History Item Styles */
.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin: 12px 16px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

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

.history-main {
    flex: 1;
    cursor: pointer;
}

.history-delete-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffebee;
    color: #f44336;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.history-delete-btn:hover {
    background: #f44336;
    color: white;
    transform: scale(1.1);
}

.history-delete-btn:active {
    transform: scale(0.95);
}

/* History Detail Modal */
.history-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.history-detail-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.history-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.history-detail-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.history-detail-close {
    background: var(--bg-light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.history-detail-close:hover {
    background: var(--border-color);
}

.history-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.history-detail-time {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 16px;
    text-align: center;
}

.history-detail-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
}

.history-detail-foods h4,
.history-detail-nutrition h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.history-food-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.history-food-item .food-name {
    font-weight: 500;
}

.history-food-item .food-portion {
    color: var(--text-light);
}

.history-detail-nutrition {
    margin-top: 20px;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.nutrition-cell {
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    text-align: center;
}

.nutrition-cell .label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.nutrition-cell .value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

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

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

/* AI Daily Menu Recommendation */
.daily-menu-recommendation {
    margin: 24px;
    background: linear-gradient(135deg, var(--primary-bg) 0%, #F8F9FA 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--primary-light);
    position: relative;
    overflow: hidden;
}

.daily-menu-recommendation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.menu-header h2 {
    font-size: 18px;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-header h2::before {
    content: '🍽️';
    font-size: 20px;
}

.btn-refresh {
    background: white;
    border: 1px solid #2196F3;
    color: #2196F3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.btn-refresh:hover {
    background: #2196F3;
    color: white;
    transform: rotate(180deg);
}

.btn-refresh:active {
    transform: rotate(180deg) scale(0.95);
}

.btn-refresh.loading {
    animation: spin 1s linear infinite;
    pointer-events: none;
}

.menu-content {
    background: white;
    border-radius: 8px;
    padding: 16px;
    min-height: 150px;
}

.menu-placeholder {
    text-align: center;
    color: var(--text-light);
    padding: 30px 20px;
}

.menu-placeholder svg {
    opacity: 0.3;
    margin-bottom: 12px;
}

.menu-placeholder p {
    font-size: 14px;
    margin: 0;
}

.menu-loading {
    text-align: center;
    padding: 40px 20px;
}

.menu-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(33, 150, 243, 0.2);
    border-radius: 50%;
    border-top-color: #2196F3;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.menu-loading p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.menu-analysis {
    margin-bottom: 20px;
}

.menu-analysis h3 {
    font-size: 15px;
    color: #2196F3;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-analysis h3::before {
    content: '📊';
    font-size: 16px;
}

.menu-analysis p {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    border-left: 3px solid #2196F3;
}

.menu-recommendations h3 {
    font-size: 15px;
    color: #4CAF50;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-recommendations h3::before {
    content: '🥗';
    font-size: 16px;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-item {
    background: linear-gradient(135deg, #f1f8f4 0%, #e8f5e9 100%);
    border-radius: 8px;
    padding: 14px;
    border-left: 4px solid #4CAF50;
    transition: all 0.2s;
}

.menu-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.menu-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.menu-item-type {
    font-size: 11px;
    color: white;
    background: #4CAF50;
    padding: 2px 8px;
    border-radius: 12px;
}

.menu-item-reason {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 8px;
}

.menu-item-nutrition {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
}

.menu-item-nutrition span {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
}

.menu-error {
    text-align: center;
    padding: 30px 20px;
    color: #f44336;
}

.menu-error svg {
    margin-bottom: 12px;
}

.menu-error p {
    font-size: 14px;
    margin: 0;
}

.menu-error button {
    margin-top: 12px;
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.menu-error button:active {
    transform: scale(0.95);
}


/* ========== 新功能样式 ========== */

/* 底部导航 - 5个按钮 */
.bottom-nav {
    justify-content: space-between;
    padding: 6px 8px;
}

.nav-btn {
    flex: 1;
    min-width: 0;
    padding: 6px 4px;
}

.nav-btn span {
    font-size: 10px;
}

/* ========== 统计页面 ========== */
.stats-container {
    padding: 16px;
    padding-bottom: 100px;
}

.stats-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.stats-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.stats-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stats-tabs {
    display: flex;
    gap: 8px;
}

.stats-tab {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.stats-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chart-bar-fill {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
}

.chart-bar-label {
    font-size: 11px;
    color: var(--text-light);
}

.chart-bar-value {
    font-size: 10px;
    color: var(--text-dark);
    font-weight: 600;
}

.stats-summary {
    display: flex;
    justify-content: space-around;
    padding-top: 16px;
}

.stats-summary-item {
    text-align: center;
}

.stats-summary-item .label {
    font-size: 12px;
    color: var(--text-light);
    display: block;
}

.stats-summary-item .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.stats-summary-item .unit {
    font-size: 11px;
    color: var(--text-light);
}

/* 饼图 */
.pie-chart-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.pie-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
}

.pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pie-center .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.pie-center .label {
    font-size: 11px;
    color: var(--text-light);
}

.nutrition-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* 目标进度 */
.goals-progress {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.goal-progress-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.goal-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.goal-progress-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.goal-progress-fill.good { background: var(--primary-color); }
.goal-progress-fill.warning { background: #FF9800; }
.goal-progress-fill.danger { background: #f44336; }

/* ========== 工具页面 ========== */
.tools-container {
    padding: 16px;
    padding-bottom: 100px;
}

.tool-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.tool-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tool-card-header h3 {
    font-size: 16px;
    margin: 0;
}

.tool-target {
    font-size: 12px;
    color: var(--text-light);
}

.btn-small {
    padding: 6px 14px;
    font-size: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
}

/* 饮水卡片 */
.water-progress-container {
    display: flex;
    gap: 20px;
    align-items: center;
}

.water-cup {
    width: 80px;
    height: 120px;
    background: linear-gradient(180deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: 0 0 20px 20px;
    border: 3px solid #90CAF9;
    position: relative;
    overflow: hidden;
}

.water-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #42A5F5 0%, #1E88E5 100%);
    transition: height 0.5s ease;
}

.water-amount {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 700;
    color: #1565C0;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.water-buttons {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.water-btn {
    padding: 12px;
    background: #E3F2FD;
    border: 1px solid #90CAF9;
    border-radius: 8px;
    font-size: 13px;
    color: #1565C0;
    cursor: pointer;
    transition: all 0.2s;
}

.water-btn:active {
    background: #BBDEFB;
    transform: scale(0.95);
}

.water-btn.custom {
    background: white;
}

/* 体重卡片 */
.weight-display {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 16px;
}

.current-weight {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.weight-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
}

.weight-unit {
    font-size: 16px;
    color: var(--text-light);
}

.weight-change {
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 12px;
}

.weight-change.up {
    background: #FFEBEE;
    color: #f44336;
}

.weight-change.down {
    background: #E8F5E9;
    color: #4CAF50;
}

.weight-chart {
    height: 80px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.weight-chart-bar {
    flex: 1;
    background: var(--primary-light);
    border-radius: 3px 3px 0 0;
    min-height: 4px;
}

/* 备忘录卡片 */
.notes-list {
    max-height: 200px;
    overflow-y: auto;
}

.note-item {
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.note-item:last-child {
    margin-bottom: 0;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.note-date {
    font-size: 12px;
    color: var(--text-light);
}

.note-mood {
    font-size: 16px;
}

.note-content {
    font-size: 13px;
    color: var(--text-dark);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.note-tag {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--primary-bg);
    color: var(--primary-color);
    border-radius: 10px;
}

.notes-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
}

/* 收藏食物 */
.favorites-list {
    max-height: 200px;
    overflow-y: auto;
}

.favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.favorite-info {
    flex: 1;
}

.favorite-name {
    font-size: 14px;
    font-weight: 500;
}

.favorite-calories {
    font-size: 12px;
    color: var(--text-light);
}

.favorite-actions {
    display: flex;
    gap: 8px;
}

.favorite-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn.add {
    background: var(--primary-color);
    color: white;
}

.favorite-btn.remove {
    background: #FFEBEE;
    color: #f44336;
}

/* ========== 我的页面 ========== */
.profile-container {
    padding: 16px;
    padding-bottom: 100px;
}

.profile-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.profile-card h3 {
    font-size: 16px;
    margin: 0 0 16px 0;
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.goal-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
}

.goal-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-dark);
}

.goal-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 4px;
}

.goal-unit {
    font-size: 12px;
    color: var(--text-light);
}

.data-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.storage-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.storage-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.storage-item:last-child {
    border-bottom: none;
}

.about-info {
    text-align: center;
    color: var(--text-light);
}

.about-info p {
    margin: 4px 0;
}

.version {
    font-size: 12px;
}

/* ========== 弹窗样式 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-content.modal-large {
    max-width: 500px;
}

.modal-content.modal-small {
    max-width: 320px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn {
    flex: 1;
}

/* 心情选择器 */
.mood-selector {
    margin-bottom: 20px;
}

.mood-selector label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.mood-options {
    display: flex;
    gap: 10px;
}

.mood-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.mood-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-bg);
}

/* 标签选择器 */
.tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}


/* 食物项操作按钮 */
.food-item-actions {
    display: flex;
    gap: 8px;
}

.favorite-food-btn {
    background: none;
    border: none;
    color: #FFB74D;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s;
}

.favorite-food-btn:hover {
    color: #FF9800;
    transform: scale(1.1);
}

.favorite-food-btn:active {
    transform: scale(0.9);
}

.favorite-food-btn svg {
    fill: none;
}

.favorite-food-btn.favorited svg {
    fill: #FFB74D;
}
