/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.hidden {
    display: none !important;
}

/* 头部 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    font-size: 2.2em;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

/* ============ 身份选择页 ============ */
.identity-container {
    max-width: 600px;
    margin: 80px auto;
}

.identity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.identity-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 30px 20px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.identity-btn:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.identity-btn-chef {
    grid-column: 2 / 3;
}

.identity-emoji {
    font-size: 3em;
}

.identity-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
}

/* ============ 用户信息栏 ============ */
.user-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.user-badge {
    display: inline-block;
    padding: 6px 20px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1em;
}

.chef-badge {
    background: #e67e22;
}

.btn-switch {
    padding: 6px 15px;
    background: #e0e0e0;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    color: #666;
    font-size: 0.9em;
}

.btn-switch:hover {
    background: #d0d0d0;
}

/* ============ 菜品网格 ============ */
.dishes-section {
    margin-top: 20px;
}

.dishes-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.dishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.dish-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.dish-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.dish-item.selected {
    border-color: #667eea;
    background: #f0f3ff;
}

/* 菜品图片 - 正方形 */
.dish-img-wrap {
    width: 100%;
    padding-bottom: 100%; /* 1:1 宽高比 */
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #f5f5f5;
}

.dish-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dish-img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    background: #f0f3ff;
}

.dish-item h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.2em;
}

.dish-item .price {
    color: #667eea;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
}

/* 选择人标签 */
.selectors {
    min-height: 30px;
    padding-top: 8px;
    border-top: 1px dashed #eee;
    margin-top: 5px;
}

.selector-label {
    font-size: 0.8em;
    color: #999;
}

.selector-tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px 3px;
    background: #667eea;
    color: white;
    border-radius: 10px;
    font-size: 0.8em;
}

/* ============ 我的选择面板 ============ */
.my-selection {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.my-selection h3 {
    margin-bottom: 15px;
    color: #333;
}

.my-dish-tag {
    display: inline-block;
    padding: 6px 15px;
    margin: 4px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 0.95em;
}

.empty-tip {
    color: #999;
    font-style: italic;
}

/* ============ 御厨视图 ============ */
.chef-summary {
    margin-bottom: 30px;
}

.chef-summary h2 {
    color: #333;
    margin-bottom: 20px;
}

.chef-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    padding: 20px 30px;
    border-radius: 12px;
}

.stat-num {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #999;
    font-size: 0.9em;
    margin-top: 5px;
}

.chef-dish-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chef-dish-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.chef-dish-name {
    font-weight: bold;
    color: #333;
    min-width: 120px;
}

.chef-dish-price {
    color: #667eea;
    font-weight: bold;
    min-width: 80px;
}

.chef-dish-selectors {
    color: #666;
    font-size: 0.95em;
}

.chef-detail {
    margin-top: 30px;
}

.chef-detail h3 {
    margin-bottom: 15px;
    color: #333;
}

.person-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 8px;
}

.person-name {
    font-weight: bold;
    color: #333;
    min-width: 80px;
}

.person-dishes {
    color: #666;
}

/* ============ Footer ============ */
footer {
    margin-top: 40px;
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.admin-link {
    color: #667eea;
    text-decoration: none;
    font-size: 1em;
}

.admin-link:hover {
    text-decoration: underline;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.6em;
    }

    .identity-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .identity-btn-chef {
        grid-column: 1 / 3;
    }

    .identity-emoji {
        font-size: 2.5em;
    }

    .dishes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .dish-item {
        padding: 15px;
    }

    .chef-stats {
        flex-direction: column;
        gap: 15px;
    }

    .chef-dish-item,
    .person-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
