/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin: 1rem 0;
}

/* 主要内容区域 */
.result-section {
    text-align: center;
    margin-bottom: 2rem;
}

.result-display {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#selectedFood {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e74c3c;
}

/* 按钮样式 */
button {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.primary-button {
    background-color: #3498db;
    color: white;
    font-size: 1.2rem;
    padding: 1rem 2rem;
}

.primary-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.secondary-button {
    background-color: #2ecc71;
    color: white;
}

.secondary-button:hover {
    background-color: #27ae60;
}

.delete-button {
    background-color: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.delete-button:hover {
    background-color: #c0392b;
}

/* 输入区域 */
.input-section {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

input[type="text"] {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
}

/* 食物列表 */
.list-section {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.food-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.food-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.food-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 消息提示 */
.message {
    text-align: center;
    color: #666;
    margin-top: 1rem;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .food-list {
        grid-template-columns: 1fr;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group input[type="text"] {
        width: 100%;
    }

    .primary-button {
        width: 100%;
    }
}

/* 动画效果 */
@keyframes highlight {
    0% { background-color: #fff; }
    50% { background-color: #fff3cd; }
    100% { background-color: #fff; }
}

.highlight {
    animation: highlight 1s ease-in-out;
}

/* 管理员按钮样式 */
.admin-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #34495e;
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.admin-button:hover {
    background-color: #2c3e50;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close-button {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: #666;
    padding: 0.2rem 0.5rem;
}

.close-button:hover {
    color: #000;
}

/* 管理员状态样式 */
.admin-mode .delete-button {
    display: inline-block;
}

.delete-button {
    display: none;
}

/* 响应式设计补充 */
@media (max-width: 600px) {
    .admin-button {
        position: static;
        margin-top: 1rem;
        width: auto;
    }

    .modal-content {
        margin: 30% auto;
        width: 95%;
    }
} 