/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 应用容器 */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
}

/* 导航样式 */
.nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.nav-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 主内容区域 */
.main {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 模块容器 */
.module-container {
    display: none;
    flex: 1;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    min-height: 100vh;
    height: 100vh;
}

/* 美食光球容器特殊样式 */
#food-globe-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: transparent; /* 移除背景色，让body的渐变背景显示 */
}

#food-globe {
    flex: 1;
    height: 100vh;
    width: 100vw;
    min-height: 500px;
    width: 100%;
    background: transparent; /* 移除背景色，让body的渐变背景显示 */
}

.module-container.active {
    display: block;
}

/* 模块头部 */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.module-header h2 {
    color: #333;
    font-size: 1.5rem;
    font-weight: bold;
}

/* 控制按钮 */
.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 表单元素 */
select,
input[type="text"] {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

select:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close:hover {
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .main {
        padding: 1rem;
    }

    .module-container {
        padding: 1rem;
    }

    .module-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .controls {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 美食详情收藏功能样式 */
.food-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.food-detail-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
    font-weight: bold;
}

.favorite-button-container {
    display: flex;
    align-items: center;
}

.favorite-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #ff6b6b;
    border-radius: 25px;
    background: white;
    color: #ff6b6b;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.favorite-btn:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.favorite-btn.favorited {
    background: #ff6b6b;
    color: white;
}

.favorite-btn.favorited:hover {
    background: #ff5252;
    border-color: #ff5252;
}

.favorite-icon {
    font-size: 1.2rem;
}

.favorite-text {
    font-weight: 500;
}

.food-detail-info {
    margin-bottom: 1.5rem;
}

.food-detail-info p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: #666;
}

.food-detail-info strong {
    color: #333;
    font-weight: 600;
}

.food-detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    flex: 1;
    justify-content: center;
}

.action-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.action-icon {
    font-size: 1.1rem;
}

/* Toast提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.toast-info {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

.toast-error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

/* 响应式设计 - 收藏功能 */
@media (max-width: 768px) {
    .food-detail-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .food-detail-header h2 {
        font-size: 1.5rem;
        text-align: center;
    }

    .favorite-btn {
        width: 100%;
        justify-content: center;
    }

    .food-detail-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* 问答收藏功能样式 */
.qa-collection-container {
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.qa-collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.qa-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qa-count {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.qa-label {
    color: #666;
    font-size: 1rem;
}

.qa-actions {
    display: flex;
    gap: 0.5rem;
}

.add-qa-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid #28a745;
    border-radius: 20px;
    background: white;
    color: #28a745;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.add-qa-btn:hover {
    background: #28a745;
    color: white;
    transform: translateY(-2px);
}

.clear-qa-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid #ff6b6b;
    border-radius: 20px;
    background: white;
    color: #ff6b6b;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.clear-qa-btn:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-2px);
}

.qa-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.qa-search input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.qa-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.search-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.qa-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.empty-qa {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #666;
}

.empty-qa h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.empty-qa p {
    margin-bottom: 1.5rem;
    color: #666;
}

.add-first-qa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.add-first-qa-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.qa-item {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.qa-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
    background: #f8f9fa;
}

.qa-info {
    margin-bottom: 1rem;
}

.qa-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.qa-question {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin: 0;
    flex: 1;
}

.qa-category {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 1rem;
}

.qa-answer {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.qa-answer-preview {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    font-size: 0.95rem;
    opacity: 0.9;
}

.qa-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.qa-date {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

.qa-actions {
    display: flex;
    gap: 0.5rem;
}

.qa-actions .action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid #667eea;
    border-radius: 20px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.qa-actions .action-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.qa-actions .edit-btn {
    border-color: #ffc107;
    color: #ffc107;
}

.qa-actions .edit-btn:hover {
    background: #ffc107;
    color: white;
}

.qa-actions .remove-btn {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.qa-actions .remove-btn:hover {
    background: #ff6b6b;
    color: white;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group textarea,
.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* 问答详情样式 */
.qa-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.qa-detail-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
    font-weight: bold;
}

.qa-category-badge {
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.qa-detail-content {
    margin-bottom: 1.5rem;
}

.qa-question-section,
.qa-answer-section,
.qa-tags-section {
    margin-bottom: 1.5rem;
}

.qa-question-section h3,
.qa-answer-section h3,
.qa-tags-section h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.qa-question-section p,
.qa-answer-section p {
    color: #666;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin: 0;
}

.qa-answer-section p {
    border-left: 4px solid #28a745;
}

.qa-question-section p {
    border-left: 4px solid #667eea;
}

.qa-meta {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.qa-meta p {
    margin: 0.25rem 0;
    color: #666;
}

.qa-detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.qa-detail-actions .action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #667eea;
    border-radius: 25px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.qa-detail-actions .action-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.qa-detail-actions .edit-btn {
    border-color: #ffc107;
    color: #ffc107;
}

.qa-detail-actions .edit-btn:hover {
    background: #ffc107;
    color: white;
}

.qa-detail-actions .remove-btn {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.qa-detail-actions .remove-btn:hover {
    background: #ff6b6b;
    color: white;
}

/* 响应式设计 - 问答收藏功能 */
@media (max-width: 768px) {
    .qa-collection-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .qa-stats {
        justify-content: center;
    }

    .qa-actions {
        flex-direction: column;
    }

    .qa-actions .action-btn {
        width: 100%;
    }

    .qa-search {
        flex-direction: column;
    }

    .qa-item {
        padding: 1rem;
    }

    .qa-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .qa-category {
        margin-left: 0;
        align-self: flex-start;
    }

    .qa-actions {
        flex-direction: column;
    }

    .qa-actions .action-btn {
        width: 100%;
    }

    .qa-detail-actions {
        flex-direction: column;
    }

    .qa-detail-actions .action-btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}
