/* ============================================
   午餐决策器专用样式
   依赖 tools-common.css 公共样式
   ⚠️ 不重复定义 info-card 等公共样式
   ============================================ */

/* 主要决策区域 */
.tool-page .decision-area {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 30px;
    background-color: #f9f9f9;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

/* 大按钮 */
.tool-page .big-button {
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 180px;
    height: 180px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
}

.tool-page .big-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.tool-page .big-button:active {
    transform: scale(0.98);
}

/* 结果展示区域 */
.tool-page .result-display {
    margin-top: 30px;
    padding: 20px;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    display: none;
}

.tool-page .result-display.active {
    display: block;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tool-page .food-name {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.tool-page .food-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tool-page .food-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.tool-page .result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* 筛选区域 */
.tool-page .filter-section {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.tool-page .section-title {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-page .filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tool-page .form-group {
    margin-bottom: 15px;
}

.tool-page .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.tool-page .form-select,
.tool-page .form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.tool-page .tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tool-page .tag {
    background-color: #f0f0f0;
    color: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-page .tag:hover {
    background-color: #e0e0e0;
}

.tool-page .tag.active {
    background-color: #ff6b6b;
    color: white;
}

/* 历史记录区域 */
.tool-page .history-section {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.tool-page .history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tool-page .history-item {
    background-color: #f9f9f9;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-page .history-item:hover {
    background-color: #f0f0f0;
}

.tool-page .history-time {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 个人偏好区域 */
.tool-page .preferences-section {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.tool-page .preference-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.tool-page .preference-tab {
    padding: 10px 20px;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tool-page .preference-tab.active {
    color: #ff6b6b;
    border-bottom: 2px solid #ff6b6b;
}

.tool-page .preference-content {
    display: none;
}

.tool-page .preference-content.active {
    display: block;
}

.tool-page .food-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.tool-page .food-item {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-page .food-item:hover {
    background-color: #f0f0f0;
}

.tool-page .food-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 8px;
}

.tool-page .food-item-name {
    font-size: 14px;
    color: #333;
}

/* 动画效果 */
.tool-page .spin-animation {
    animation: spin 1s ease-in-out;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.tool-page .shake-animation {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-10px);
    }
    40%, 80% {
        transform: translateX(10px);
    }
}

/* 主题切换 */
.tool-page .theme-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-page .switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.tool-page .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tool-page .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.tool-page .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.tool-page .switch input:checked + .slider {
    background-color: #2196F3;
}

.tool-page .switch input:checked + .slider:before {
    transform: translateX(26px);
}

.tool-page .theme-icon {
    font-size: 16px;
    color: #666;
}

/* 暗色主题 */
body.dark-theme {
    background-color: #222;
    color: #eee;
}

body.dark-theme .tool-page .tool-content {
    background-color: #333;
}

body.dark-theme .tool-page .decision-area {
    background-color: #444;
}

body.dark-theme .tool-page .result-display {
    background-color: #333;
}

body.dark-theme .tool-page .food-name {
    color: #eee;
}

body.dark-theme .tool-page .food-description {
    color: #ccc;
}

body.dark-theme .tool-page .tag {
    background-color: #555;
    color: #eee;
}

body.dark-theme .tool-page .tag:hover {
    background-color: #666;
}

body.dark-theme .tool-page .history-item {
    background-color: #444;
    color: #ddd;
}

body.dark-theme .tool-page .history-item:hover {
    background-color: #555;
}

body.dark-theme .tool-page .food-item {
    background-color: #444;
}

body.dark-theme .tool-page .food-item:hover {
    background-color: #555;
}

body.dark-theme .tool-page .food-item-name {
    color: #eee;
}

body.dark-theme .tool-page .form-select,
body.dark-theme .tool-page .form-input {
    background-color: #444;
    border-color: #555;
    color: #eee;
}

body.dark-theme .tool-page .form-label {
    color: #ddd;
}

body.dark-theme .tool-page .section-title {
    color: #ddd;
}

body.dark-theme .tool-page .theme-icon {
    color: #aaa;
}

body.dark-theme .tool-page .info-card {
    background-color: #333;
    border-color: #444;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tool-page .filter-grid {
        grid-template-columns: 1fr;
    }

    .tool-page .big-button {
        width: 150px;
        height: 150px;
        font-size: 20px;
    }

    .tool-page .food-name {
        font-size: 24px;
    }

    .tool-page .food-image {
        width: 150px;
        height: 150px;
    }

    .tool-page .section-title {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .tool-page .decision-area {
        padding: 20px 15px;
    }

    .tool-page .big-button {
        width: 130px;
        height: 130px;
        font-size: 18px;
    }

    .tool-page .food-name {
        font-size: 20px;
    }

    .tool-page .food-image {
        width: 120px;
        height: 120px;
    }

    .tool-page .theme-switch {
        top: 10px;
        right: 10px;
    }
}
