/* ============================================
   年夜饭菜单推荐系统 - 艺术化中国新年主题
   ============================================ */

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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'SimSun', serif;
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 25%, #FF4500 50%, #DC143C 75%, #8B0000 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: #fff;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   背景装饰
   ============================================ */

.background-decoration {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.cloud {
    position: absolute;
    font-size: 3rem;
    opacity: 0.15;
    animation: floatCloud 20s ease-in-out infinite;
}

.cloud-1 {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.cloud-2 {
    top: 30%;
    right: 10%;
    animation-delay: 5s;
}

.cloud-3 {
    bottom: 20%;
    left: 15%;
    animation-delay: 10s;
}

@keyframes floatCloud {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-20px) translateX(10px); }
    50% { transform: translateY(-10px) translateX(-10px); }
    75% { transform: translateY(-30px) translateX(5px); }
}

.snowflake {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: fallSnow 10s linear infinite;
}

.snowflake:nth-child(4) {
    top: -5%;
    left: 20%;
    animation-delay: 0s;
}

.snowflake:nth-child(5) {
    top: -5%;
    left: 50%;
    animation-delay: 3s;
}

.snowflake:nth-child(6) {
    top: -5%;
    left: 80%;
    animation-delay: 6s;
}

@keyframes fallSnow {
    0% { transform: translateY(-10%) rotate(0deg); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ============================================
   增强版灯笼系统 - 样式由 lantern.js 动态生成
   ============================================ */

/* ============================================
   主容器
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 200px 20px 40px;
    position: relative;
    z-index: 5;
}

/* ============================================
   标题区
   ============================================ */

.header {
    text-align: center;
    margin-bottom: 50px;
    margin-top: 180px;
    position: relative;
}

.header-decoration {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
}

.title {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.9), 0 4px 8px rgba(0, 0, 0, 0.3);
    font-weight: bold;
    letter-spacing: 5px;
}

.title-char {
    display: inline-block;
    animation: bounce 0.8s ease-in-out infinite;
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-char:nth-child(1) { animation-delay: 0s; }
.title-char:nth-child(2) { animation-delay: 0.12s; }
.title-char:nth-child(3) { animation-delay: 0.24s; }
.title-char:nth-child(4) { animation-delay: 0.36s; }
.title-char:nth-child(5) { animation-delay: 0.48s; }
.title-char:nth-child(6) { animation-delay: 0.6s; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.subtitle {
    font-size: 1.3rem;
    color: #FFD700;
    opacity: 0.95;
    font-weight: 300;
    letter-spacing: 3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.blessing {
    margin-top: 20px;
}

.blessing-text {
    display: inline-block;
    padding: 10px 30px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border: 2px solid #FFD700;
    border-radius: 25px;
    color: #FFD700;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.7); }
}

/* ============================================
   区块标题
   ============================================ */

.section-title {
    font-size: 2rem;
    margin-bottom: 25px;
    text-align: center;
    color: #FFD700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    font-weight: bold;
    letter-spacing: 2px;
}

.subsection-title {
    font-size: 1.5rem;
    margin: 25px 0 15px;
    color: #FFD700;
    font-weight: bold;
}

/* ============================================
   API配置按钮
   ============================================ */

.api-config-trigger {
    text-align: center;
    margin-bottom: 35px;
}

.btn-config {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 35px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 165, 0, 0.25));
    border: 2px solid #FFD700;
    border-radius: 15px;
    color: #FFD700;
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.btn-config::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-config:hover::before {
    left: 100%;
}

.btn-config:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.35), rgba(255, 165, 0, 0.35));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.status-badge {
    background: rgba(220, 20, 60, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: normal;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.status-badge.configured {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.4);
}

/* ============================================
   配置区块
   ============================================ */

.config-section,
.menu-config-section,
.menu-result-section {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.5), rgba(220, 20, 60, 0.5));
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 35px;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 0 30px rgba(255, 215, 0, 0.1);
}

.config-box {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.config-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-label {
    font-size: 1rem;
    color: #FFD700;
    font-weight: bold;
    letter-spacing: 1px;
}

.config-input,
.config-select,
.config-textarea {
    padding: 14px 18px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    color: #333;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.config-input:focus,
.config-select:focus,
.config-textarea:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    background: #fff;
}

.config-textarea {
    resize: vertical;
    min-height: 70px;
}

.form-hint {
    font-size: 0.85rem;
    color: rgba(255, 215, 0, 0.8);
    margin-top: 5px;
}

/* ============================================
   按钮
   ============================================ */

.btn {
    padding: 14px 35px;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-large {
    padding: 16px 45px;
    font-size: 1.15rem;
}

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

.btn-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #8B0000;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.95);
    color: #DC143C;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-export {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.4);
    padding: 10px 20px;
    font-size: 0.95rem;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.6);
}

/* ============================================
   加载动画
   ============================================ */

.loading {
    text-align: center;
    padding: 50px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 215, 0, 0.3);
    border-top: 5px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #FFD700;
    font-size: 1.2rem;
}

/* ============================================
   菜单内容
   ============================================ */

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.menu-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.dish-card {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border-radius: 18px;
    padding: 25px;
    color: #333;
    transition: all 0.4s ease;
    border-left: 6px solid #DC143C;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.dish-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #DC143C, #FFD700, #DC143C);
}

.dish-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.dish-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.dish-icon {
    font-size: 3rem;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.dish-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #8B0000;
    letter-spacing: 1px;
}

.dish-meaning {
    color: #DC143C;
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 1rem;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1), rgba(255, 215, 0, 0.1));
    border-radius: 8px;
    border-left: 3px solid #DC143C;
}

.dish-info {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.8;
}

.dish-info strong {
    color: #8B0000;
    font-weight: bold;
}

/* ============================================
   导出卡片（隐藏，用于生成导出文件）
   ============================================ */

.export-card {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 800px;
    background: linear-gradient(145deg, #8B0000, #DC143C);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.export-card-inner {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    border: 8px solid #FFD700;
    box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.3);
}

.export-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #DC143C;
}

.export-card-decoration-left,
.export-card-decoration-right {
    font-size: 3rem;
}

.export-card-title {
    text-align: center;
}

.export-card-title h1 {
    font-size: 2.5rem;
    color: #8B0000;
    margin-bottom: 10px;
    font-weight: bold;
    letter-spacing: 5px;
}

.export-card-subtitle {
    font-size: 1.2rem;
    color: #DC143C;
    letter-spacing: 3px;
}

.export-card-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border-radius: 10px;
}

.export-card-date {
    font-size: 1rem;
    color: #8B0000;
    font-weight: bold;
    margin-bottom: 8px;
}

.export-card-blessing {
    font-size: 1.3rem;
    color: #DC143C;
    font-weight: bold;
    letter-spacing: 3px;
}

.export-menu-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.export-dish-item {
    padding: 15px;
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.05), rgba(255, 215, 0, 0.05));
    border-radius: 10px;
    border-left: 4px solid #DC143C;
}

.export-dish-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.export-dish-name {
    font-size: 1.3rem;
    color: #8B0000;
    font-weight: bold;
    margin-bottom: 5px;
}

.export-dish-meaning {
    font-size: 0.95rem;
    color: #DC143C;
    margin-bottom: 8px;
}

.export-dish-details {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
}

.export-card-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid rgba(220, 20, 60, 0.3);
}

.footer-decoration-top {
    font-size: 1.5rem;
    color: #FFD700;
    margin-bottom: 10px;
    letter-spacing: 10px;
}

.footer-blessing {
    font-size: 1.4rem;
    color: #8B0000;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.footer-decoration-bottom {
    font-size: 1.8rem;
    color: #DC143C;
}

/* ============================================
   采购清单
   ============================================ */

.shopping-list-section {
    margin-top: 35px;
    padding-top: 30px;
    border-top: 3px dashed rgba(255, 215, 0, 0.5);
}

.shopping-list-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    padding: 25px;
    color: #333;
}

.shopping-category {
    margin-bottom: 25px;
}

.shopping-category-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #8B0000;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.shopping-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1), rgba(255, 215, 0, 0.1));
    border-radius: 8px;
    font-size: 0.95rem;
    border-left: 3px solid #DC143C;
    transition: all 0.3s ease;
}

.shopping-item:hover {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.15), rgba(255, 215, 0, 0.15));
    transform: translateX(5px);
}

.shopping-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   弹窗样式
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #8B0000 0%, #DC143C 100%);
    border-radius: 25px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
    border: 3px solid #FFD700;
    animation: slideUp 0.4s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(60px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.4);
}

.modal-header h2 {
    color: #FFD700;
    font-size: 1.6rem;
    margin: 0;
    font-weight: bold;
    letter-spacing: 2px;
}

.modal-close {
    background: none;
    border: none;
    color: #FFD700;
    font-size: 2.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 215, 0, 0.25);
    transform: rotate(90deg) scale(1.1);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid rgba(255, 215, 0, 0.4);
    display: flex;
    justify-content: flex-end;
}

.model-select-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed rgba(255, 215, 0, 0.4);
}

/* ============================================
   Toast消息动画
   ============================================ */

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ============================================
   底部
   ============================================ */

.footer {
    text-align: center;
    padding: 40px 20px;
    color: #FFD700;
}

.footer-decoration {
    font-size: 1.5rem;
    margin-bottom: 15px;
    letter-spacing: 15px;
    opacity: 0.8;
}

.footer p {
    font-size: 1.05rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.footer-note {
    margin-top: 15px;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 768px) {
    .title {
        font-size: 2.2rem;
        gap: 8px;
    }

    .container {
        padding: 75px 15px 30px;
    }

    .menu-content {
        grid-template-columns: 1fr;
    }

    .export-menu-content {
        grid-template-columns: 1fr;
    }

    .shopping-items {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .btn-config,
    .btn-large {
        width: 100%;
        justify-content: center;
    }

    .result-header {
        flex-direction: column;
        align-items: stretch;
    }

    .export-buttons {
        justify-content: center;
    }

    .export-card {
        width: 100%;
        max-width: 400px;
    }

    .config-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .cloud {
        font-size: 2rem;
    }

    .export-buttons {
        flex-direction: column;
    }
}
