/* ========================================
   美食侦探 - 高校食堂个性化推荐系统样式
   ======================================== */

:root {
    --primary: #FF6B35;
    --primary-light: #FF8C5A;
    --primary-dark: #E55A25;
    --secondary: #2EC4B6;
    --secondary-light: #4DD8CC;
    --accent: #FFD166;
    --bg: #FAFAFA;
    --bg-card: #FFFFFF;
    --bg-dark: #1A1A2E;
    --text: #2D3436;
    --text-secondary: #636E72;
    --text-light: #B2BEC3;
    --border: #E8E8E8;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --danger: #FF6B6B;
    --success: #51CF66;
    --warning: #FFC93C;
    --info: #339AF0;
    --transition: all 0.3s ease;
}

* { 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;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 3px; }

/* ========== 导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow); }

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}
.nav-icon { font-size: 28px; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-link:hover { color: var(--primary); background: rgba(255,107,53,0.06); }
.nav-link.active { color: var(--primary); background: rgba(255,107,53,0.1); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,107,53,0.3); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #28B0A3; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #e55a5a; }

/* ========== 主内容 ========== */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 88px 24px 40px;
    min-height: 100vh;
}

/* ========== 页面标题 ========== */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}
.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ========== 首页 Hero ========== */
.hero {
    background: linear-gradient(135deg, var(--primary), #FF8C5A, var(--accent));
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    margin-bottom: 40px;
    color: white;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.hero h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}
.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
    max-width: 500px;
}
.hero .btn { position: relative; z-index: 1; background: white; color: var(--primary); font-size: 16px; padding: 14px 32px; }
.hero .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); }

.stat-card.orange .stat-icon { background: rgba(255,107,53,0.1); color: var(--primary); }
.stat-card.green .stat-icon { background: rgba(46,196,182,0.1); color: var(--secondary); }
.stat-card.yellow .stat-icon { background: rgba(255,209,102,0.15); color: #F0A030; }
.stat-card.blue .stat-icon { background: rgba(51,154,240,0.1); color: var(--info); }

/* ========== 区块标题 ========== */
.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title .badge {
    font-size: 12px;
    padding: 2px 10px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-weight: 600;
}

/* ========== 菜品卡片网格 ========== */
.dish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.dish-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}
.dish-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.dish-card .dish-image {
    height: 180px;
    background: linear-gradient(135deg, #FFE0D0, #FFD4B8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    position: relative;
}
.dish-card .dish-tags {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.dish-card .dish-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}
.dish-tag.spicy { background: rgba(255,75,75,0.9); color: white; }
.dish-tag.sweet { background: rgba(255,183,77,0.9); color: white; }
.dish-tag.classic { background: rgba(102,187,106,0.9); color: white; }

.dish-card .dish-info { padding: 16px; }
.dish-card .dish-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dish-card .dish-price {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
}
.dish-card .dish-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dish-card .dish-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
}
.dish-card .dish-rating {
    color: var(--accent);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}
.dish-card .dish-canteen {
    background: rgba(0,0,0,0.04);
    padding: 2px 8px;
    border-radius: 10px;
}
.dish-card .dish-nutrition {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-light);
}
.dish-card .nutrition-item {
    background: rgba(0,0,0,0.03);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 推荐分标签 */
.recommend-score {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* ========== 筛选栏 ========== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.filter-group select, .filter-group input {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
    background: white;
    min-width: 120px;
}
.filter-group select:focus, .filter-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

/* ========== 看板 ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.dashboard-card.full-width {
    grid-column: 1 / -1;
}
.dashboard-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dashboard-card h3 i { color: var(--primary); }

/* 图表容器 */
.chart-container {
    width: 100%;
    height: 250px;
    position: relative;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    background: #F8F9FA;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:hover td { background: #FAFBFC; }
.data-table .rating-stars { color: var(--accent); }

/* 简易柱状图 */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding-top: 20px;
}
.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
}
.bar {
    width: 100%;
    max-width: 60px;
    border-radius: 6px 6px 0 0;
    transition: height 0.6s ease;
    position: relative;
}
.bar:hover { opacity: 0.85; }
.bar-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}
.bar-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

/* 水平柱状图 */
.h-bar-chart { display: flex; flex-direction: column; gap: 12px; }
.h-bar-item { display: flex; align-items: center; gap: 12px; }
.h-bar-label { width: 80px; font-size: 13px; font-weight: 500; text-align: right; flex-shrink: 0; }
.h-bar-track { flex: 1; height: 28px; background: #F0F0F0; border-radius: 14px; overflow: hidden; }
.h-bar-fill { height: 100%; border-radius: 14px; transition: width 0.8s ease; display: flex; align-items: center; padding: 0 12px; font-size: 12px; font-weight: 600; color: white; }

/* 环形进度 */
.ring-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}
.ring-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.ring-progress {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    position: relative;
}

/* ========== 登录/注册弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 420px;
    max-width: 90vw;
    position: relative;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-header h2 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.modal-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}
.auth-switch a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

.demo-accounts {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.demo-title { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.demo-item {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-family: monospace;
}
.demo-item:hover { background: rgba(255,107,53,0.06); color: var(--primary); }

/* ========== 个人中心 ========== */
.profile-header {
    background: linear-gradient(135deg, var(--primary), #FF8C5A);
    border-radius: var(--radius-lg);
    padding: 32px;
    color: white;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
}
.profile-info h2 { font-size: 24px; margin-bottom: 4px; }
.profile-info p { opacity: 0.85; font-size: 14px; }
.profile-stats {
    display: flex;
    gap: 24px;
    margin-left: auto;
}
.profile-stat {
    text-align: center;
}
.profile-stat .value { font-size: 24px; font-weight: 700; }
.profile-stat .label { font-size: 12px; opacity: 0.8; }

.profile-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.profile-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 偏好设置 */
.prefs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.pref-item label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}
.pref-item .range-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pref-item input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #E8E8E8;
    border-radius: 3px;
    outline: none;
}
.pref-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255,107,53,0.3);
}
.pref-item .range-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    min-width: 24px;
    text-align: center;
}
.pref-item .range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}
.pref-item input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
}
.pref-item input[type="text"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,107,53,0.1); }

/* 光盘行动卡片 */
.clean-plate-card {
    background: linear-gradient(135deg, #2EC4B6, #4DD8CC);
    border-radius: var(--radius);
    padding: 24px;
    color: white;
    text-align: center;
}
.clean-plate-card .big-icon { font-size: 48px; margin-bottom: 12px; }
.clean-plate-card h4 { font-size: 18px; margin-bottom: 4px; }
.clean-plate-card p { opacity: 0.9; font-size: 13px; margin-bottom: 16px; }
.clean-plate-points { font-size: 36px; font-weight: 800; margin-bottom: 8px; }

/* ========== 评价列表 ========== */
.review-list { display: flex; flex-direction: column; gap: 16px; }
.review-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.review-author { font-weight: 600; font-size: 14px; }
.review-date { font-size: 12px; color: var(--text-light); margin-left: auto; }
.review-rating { color: var(--accent); font-size: 14px; font-weight: 600; }
.review-content { font-size: 14px; color: var(--text); line-height: 1.7; }
.review-dish-name { font-size: 12px; color: var(--text-light); margin-top: 8px; }

/* ========== 点餐弹窗 ========== */
.order-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}
.order-modal.show { display: flex; }
.order-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 520px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}
.order-dish-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.order-dish-emoji { font-size: 48px; }
.order-dish-detail h3 { font-size: 18px; margin-bottom: 4px; }
.order-dish-detail .price { color: var(--primary); font-size: 20px; font-weight: 700; }
.quantity-control {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.quantity-control button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: white;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.quantity-control button:hover { border-color: var(--primary); color: var(--primary); }
.quantity-control .qty { font-size: 20px; font-weight: 700; min-width: 24px; text-align: center; }

/* 评分星星 */
.star-rating {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}
.star-rating .star {
    font-size: 28px;
    cursor: pointer;
    color: #E0E0E0;
    transition: var(--transition);
}
.star-rating .star.active { color: var(--accent); }
.star-rating .star:hover { transform: scale(1.15); }

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
    min-width: 280px;
    border-left: 4px solid;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--info); }
.toast.warning { border-color: var(--warning); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== 标签 ========== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    gap: 4px;
}
.tag-orange { background: rgba(255,107,53,0.1); color: var(--primary); }
.tag-green { background: rgba(46,196,182,0.1); color: var(--secondary); }
.tag-red { background: rgba(255,107,107,0.1); color: var(--danger); }
.tag-blue { background: rgba(51,154,240,0.1); color: var(--info); }

/* ========== 排行榜 ========== */
.ranking-list { display: flex; flex-direction: column; gap: 12px; }
.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #FAFAFA;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.ranking-item:hover { background: #F0F0F0; }
.ranking-item.top-1 { background: linear-gradient(135deg, #FFF8E1, #FFECB3); }
.ranking-item.top-2 { background: linear-gradient(135deg, #F5F5F5, #E0E0E0); }
.ranking-item.top-3 { background: linear-gradient(135deg, #FFF3E0, #FFE0B2); }
.ranking-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    background: var(--border);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.top-1 .ranking-num { background: var(--accent); color: #7B5800; }
.top-2 .ranking-num { background: #BDBDBD; color: #424242; }
.top-3 .ranking-num { background: #FFAB91; color: white; }
.ranking-info { flex: 1; }
.ranking-info .name { font-weight: 600; font-size: 14px; }
.ranking-info .meta { font-size: 12px; color: var(--text-light); }
.ranking-score { font-weight: 700; color: var(--primary); font-size: 14px; }

/* ========== 加载动画 ========== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 菜品详情弹窗 ========== */
.detail-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}
.detail-modal.show { display: flex; }
.detail-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 600px;
    max-width: 100%;
    overflow: hidden;
    animation: modalIn 0.3s ease;
}
.detail-hero {
    height: 200px;
    background: linear-gradient(135deg, #FFE0D0, #FFD4B8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    position: relative;
}
.detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.detail-body { padding: 24px; }
.detail-body h2 { font-size: 22px; margin-bottom: 8px; }
.detail-body .detail-price { font-size: 24px; color: var(--primary); font-weight: 700; margin-bottom: 12px; }
.detail-body .detail-desc { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.7; }
.detail-nutrition {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.nutrition-card {
    text-align: center;
    padding: 12px;
    background: #F8F9FA;
    border-radius: var(--radius-sm);
}
.nutrition-card .value { font-size: 18px; font-weight: 700; color: var(--primary); }
.nutrition-card .label { font-size: 12px; color: var(--text-light); }
.detail-actions { display: flex; gap: 12px; margin-top: 20px; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 12px;
        box-shadow: var(--shadow);
        display: none;
    }
    .nav-menu.show { display: flex; }
    .nav-toggle { display: flex; }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dish-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .hero { padding: 40px 24px; }
    .hero h1 { font-size: 28px; }
    .prefs-grid { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-stats { margin-left: 0; margin-top: 16px; }
    .filter-bar { flex-direction: column; }
    .filter-group select, .filter-group input { width: 100%; }
    .detail-nutrition { grid-template-columns: repeat(2, 1fr); }
}

/* ========== 选项卡 ========== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #F0F0F0;
    padding: 4px;
    border-radius: var(--radius-sm);
}
.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.tab-btn.active { background: white; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.tab-btn:hover:not(.active) { color: var(--text); }

.tab-content { display: none; }
.tab-content.active { display: block; }
