:root {
    --primary-color: #e63946;
    --secondary-color: #f4a261;
    --accent-color: #2a9d8f;
    --text-color: #1d3557;
    --text-light: #6c757d;
    --background: #fafafa;
    --black: #111111;
    --white: #ffffff;
    --border-color: #e9ecef;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: nowrap;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-right: 1rem;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
    margin-right: 2rem;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-color);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.search-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    max-width: 250px;
    flex-shrink: 0;
}

.search-container input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    transition: var(--transition);
    min-width: 0;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.search-container button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.search-container button:hover {
    background: #d62839;
    transform: translateY(-2px);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    margin-left: auto;
}

.lang-switch {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--white);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.lang-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.lang-btn:hover:not(.active) {
    border-color: var(--primary-color);
}

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.scenario-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.scenario-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.scenario-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.scenario-card-content {
    padding: 1.5rem;
}

.scenario-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.scenario-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
    gap: 2rem;
    justify-content: center;
}

.recipe-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.recipe-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.recipe-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.recipe-card-content {
    padding: 1.25rem;
}

.recipe-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.recipe-card .meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.recipe-card .difficulty {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-color);
    color: var(--white);
    border-radius: 12px;
    font-size: 0.8rem;
}

.recipe-card .difficulty-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.recipe-card .spiciness {
    display: inline-block;
    font-size: 1rem;
    cursor: help;
    transition: var(--transition);
}

.recipe-card .spiciness:hover {
    transform: scale(1.1);
}

.recipe-card-small {
    grid-column: span 1;
    grid-row: span 1;
}

.recipe-card-small img {
    height: 150px;
}

.recipe-card-small h3 {
    font-size: 0.95rem;
}

.recipe-card-small .meta {
    font-size: 0.75rem;
}

.recipe-card-small .difficulty {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
}

.empty-state {
    max-width: 560px;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    color: var(--text-light);
}

.festival-categories {
    max-width: 1200px;
    margin: 0 auto;
}

.festival-category {
    margin-bottom: 3rem;
}

.festival-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-align: center;
}

.festival-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.festival-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.festival-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.festival-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.festival-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.festival-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.recipe-detail {
    max-width: 900px;
    margin: 0 auto;
}

.recipe-detail-header {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.recipe-detail-header img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.recipe-detail-header-content {
    padding: 2rem;
}

.recipe-detail-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.recipe-detail-header .meta {
    display: flex;
    gap: 2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.recipe-detail-header .difficulty {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.9rem;
}

.recipe-detail-section {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.culture-subsections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .culture-subsections-grid {
        grid-template-columns: 1fr;
    }
}

.recipe-detail-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.ingredients-list {
    list-style: none;
}

.ingredients-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.ingredients-list li:last-child {
    border-bottom: none;
}

.ingredient-name {
    font-weight: 500;
}

.ingredient-amount {
    color: var(--text-light);
}

.substitution {
    display: inline-block;
    margin-left: 1rem;
    padding: 0.25rem 0.5rem;
    background: #fff3cd;
    color: #856404;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* 食材替代指南样式 */
.substitution-list {
    list-style: none;
}

.substitution-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.substitution-item:last-child {
    border-bottom: none;
}

.substitution-header {
    margin-bottom: 0.5rem;
}

.substitution-header .ingredient-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
}

.substitution-content {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.substitution-text {
    color: var(--text-color);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 新的替代指南样式 */
.substitution-guide {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px solid #ffc107;
}

.substitution-guide h2 {
    color: #856404;
    border-bottom: 2px solid #ffc107;
    padding-bottom: 0.5rem;
}

.substitution-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.substitution-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 5px solid #28a745;
}

.substitution-ingredient-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #ddd;
}

.substitution-details {
    color: #555;
    line-height: 1.8;
    font-size: 1rem;
}

.substitution-details strong,
.substitution-details b {
    color: #28a745;
}

.steps-list {
    counter-reset: step;
}

.steps-list li {
    counter-increment: step;
    padding: 1.5rem 0 1.5rem 3.5rem;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.steps-list li:last-child {
    border-bottom: none;
}

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.steps-list h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.steps-list p {
    color: var(--text-light);
}

.steps-list .time {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 12px;
    font-size: 0.8rem;
}

.culture-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 8px;
}

.culture-illustration {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.culture-illustration img {
    max-width: 200px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.culture-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.culture-box p {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.video-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    background: var(--black);
    aspect-ratio: 16 / 9;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.portion-note {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
}

.culture-category {
    max-width: 900px;
    margin: 0 auto;
}

.category-title {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--secondary-color);
    text-align: center;
}

.recipe-detail-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.recipe-detail-section strong {
    color: var(--primary-color);
    font-weight: 600;
}

.recipe-detail-section br {
    line-height: 2;
}

.culture-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.culture-category-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
}

.culture-category-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-8px);
}

.category-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.culture-category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.culture-category-card h3 span {
    display: block;
    font-size: 1rem;
    color: var(--text-light);
    font-weight: normal;
    margin-top: 0.25rem;
}

.culture-category-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.category-items span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.culture-category-detail {
    max-width: 900px;
    margin: 0 auto;
}

.category-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 16px;
    color: var(--white);
}

.category-icon-large {
    font-size: 5rem;
    display: block;
    margin-bottom: 1rem;
}

.category-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.category-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.festival-dishes {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.festival-dishes strong {
    color: var(--secondary-color);
    display: block;
    margin-bottom: 0.75rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

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

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--white);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--border-color);
}

.community-header {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.share-button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.no-posts {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    font-size: 1.2rem;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.community-post {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.community-post:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.post-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.post-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.post-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.post-content {
    padding: 1rem;
}

.post-caption {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.action-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    transition: var(--transition);
}

.action-button:hover {
    transform: scale(1.1);
}

.action-count {
    font-size: 0.9rem;
    color: var(--text-light);
}

.comments-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.comments-list {
    margin-bottom: 1rem;
}

.comment {
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.comment-user {
    font-weight: bold;
    color: var(--primary-color);
}

.comment-text {
    color: var(--text-color);
}

.add-comment {
    display: flex;
    gap: 0.5rem;
}

.add-comment input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.add-comment button {
    background: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.add-comment button:hover {
    background: var(--primary-color);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.close:hover {
    color: var(--primary-color);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.share-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: bold;
    color: var(--text-color);
}

.form-group input[type="file"] {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.image-preview {
    margin-top: 0.5rem;
    max-height: 200px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
}

.post-button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    align-self: center;
}

.post-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .logo {
        font-size: 1.15rem;
        margin-right: auto;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin: 0;
        padding: 1rem 0 0.5rem;
    }

    .nav-links.open {
        display: flex;
    }

    .header-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
    }

    .search-container {
        max-width: none;
        width: 100%;
    }

    .lang-switch {
        justify-content: flex-end;
    }

    .community-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}

footer {
    background: var(--text-color);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}

footer p {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .recipe-detail-header img {
        height: 250px;
    }
    
    .recipe-detail-header .meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ingredients-list li {
        flex-direction: column;
    }

    .substitution {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}
