/* ================= CSS Variables & Base Responsive Setup ================= */
:root {
    /* Base font size - scales with viewport */
    font-size: clamp(12px, 1vw + 8px, 18px);
    
    /* Spacing scale */
    --space-xs: clamp(4px, 0.5vw, 8px);
    --space-sm: clamp(8px, 1vw, 12px);
    --space-md: clamp(12px, 1.5vw, 20px);
    --space-lg: clamp(16px, 2vw, 28px);
    --space-xl: clamp(20px, 3vw, 40px);
    
    /* Container max widths */
    --container-max: min(95vw, 1400px);
    --container-padding: clamp(8px, 2vw, 24px);
    
    /* Border radius scale */
    --radius-sm: clamp(16px, 2vw, 24px);
    --radius-md: clamp(24px, 3vw, 40px);
    --radius-lg: clamp(32px, 4vw, 64px);
    
    /* Font sizes */
    --text-xs: clamp(0.65rem, 0.8vw, 0.75rem);
    --text-sm: clamp(0.75rem, 1vw, 0.9rem);
    --text-base: clamp(0.85rem, 1.2vw, 1rem);
    --text-lg: clamp(1rem, 1.5vw, 1.2rem);
    --text-xl: clamp(1.2rem, 2vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 3vw, 2rem);
    --text-3xl: clamp(2rem, 4vw, 3rem);
    --text-4xl: clamp(3rem, 6vw, 5rem);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Smooth scrolling */
    scroll-behavior: smooth;
    /* Prevent text size adjustment on orientation change */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', 'Segoe UI Emoji', cursive, sans-serif;
    padding: 10px;
    font-size: var(--text-base);
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    body {
        background-attachment: scroll; /* Fixed background can cause performance issues on mobile */
    }
}

/* Large screens (> 1440px) */
@media (min-width: 1440px) {
    :root {
        font-size: 18px;
    }
    
    .app-container {
        max-width: 1600px;
        /* aspect-ratio: 16/9 will automatically calculate height */
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .welcome-title {
        font-size: 6rem;
    }
    
    .step-menu-item {
        min-width: 200px;
        padding: 12px 24px;
    }
    
    .step-title {
        font-size: 0.85rem;
    }
    
    .plant-image-wrapper {
        width: 320px;
        height: 380px;
    }
    
    .tips-panel,
    .task-panel {
        min-height: 450px;
    }
}

/* Extra large screens (> 1920px) */
@media (min-width: 1920px) {
    :root {
        font-size: 20px;
    }
    
    .app-container {
        max-width: 1800px;
        /* aspect-ratio: 16/9 will automatically calculate height */
    }
    
    .plant-image-wrapper {
        width: 360px;
        height: 420px;
    }
}

/* 如果背景图片加载失败，使用渐变色 */
@media (prefers-color-scheme: no-preference) {
    body {
        background-color: #c8e6df;
    }
}

.app-container {
    max-width: var(--container-max);
    margin: 0 auto;
    background: rgba(255, 254, 245, 0.94);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 45px rgba(60, 40, 20, 0.25);
    overflow: hidden;
    width: 100%;
    /* Fixed 16:9 aspect ratio using aspect-ratio property */
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
}

/* Ensure content fits within fixed height */
.app-container > .header {
    flex-shrink: 0;
}

.app-container > .steps-menu {
    flex-shrink: 0;
}

.app-container > .step-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.header {
    background: linear-gradient(135deg, #9bcd6c, #6fa83d);
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: clamp(50px, 8vh, 70px);
}
.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.header h1 { 
    font-size: var(--text-2xl); 
    text-shadow: 2px 2px 0 #4a7328; 
    margin: 0; 
}
.header-info {
    font-size: var(--text-sm);
    color: #fff9e6;
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}
.header-info img {
    width: clamp(18px, 2vw, 24px);
    height: clamp(18px, 2vw, 24px);
    object-fit: contain;
    vertical-align: middle;
}

.home-btn {
    position: absolute;
    left: var(--space-sm);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    width: clamp(36px, 5vw, 44px);
    height: clamp(36px, 5vw, 44px);
    border-radius: 50%;
    font-size: var(--text-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* Header responsive adjustments */
@media (max-width: 768px) {
    .header h1 {
        font-size: var(--text-xl);
    }
    .home-btn {
        left: var(--space-xs);
    }
}

.welcome-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('images/background.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.welcome-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(155, 205, 108, 0.8), rgba(111, 168, 61, 0.8));
    z-index: -1;
}

.welcome-page.hidden {
    opacity: 0;
    visibility: hidden;
}

.welcome-content {
    text-align: center;
    color: white;
}

.welcome-title {
    font-size: var(--text-4xl);
    font-weight: bold;
    text-shadow: 4px 4px 0 #4a7328, 0 0 20px rgba(0,0,0,0.3);
    margin-bottom: var(--space-md);
    animation: welcomePulse 2s ease-in-out infinite;
    line-height: 1.2;
}

@keyframes welcomePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.welcome-subtitle {
    font-size: var(--text-lg);
    margin-bottom: var(--space-xl);
    opacity: 0.9;
}

.welcome-start-btn {
    background: white;
    color: #5d8736;
    border: none;
    padding: clamp(12px, 2vw, 18px) clamp(40px, 6vw, 60px);
    font-size: var(--text-lg);
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.welcome-start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.welcome-start-btn:active {
    transform: translateY(0);
}

/* Welcome page responsive */
@media (max-width: 768px) {
    .welcome-content {
        padding: var(--space-md);
    }
    .welcome-title {
        font-size: var(--text-3xl);
    }
}

.step-header {
    margin-bottom: 25px;
    text-align: center;
}
.step-header h2 {
    color: #5d8736;
    margin-bottom: 15px;
}
.step-header-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.step-footer-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ffdfb0;
}
.back-btn {
    background: #ffb347;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    color: white;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.back-btn:hover {
    background: #e09d30;
}

.step-content {
    padding: clamp(12px, 1.5vw, 20px) clamp(10px, 1.2vw, 16px);
    background: transparent;
    min-height: clamp(350px, 50vh, 450px);
}
.hidden { display: none; }

/* Group Grid */
.group-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(12px, 1.5vw, 20px);
    margin: clamp(20px, 3vw, 30px) 0;
}

/* Tablet: 3 columns */
@media (max-width: 1024px) {
    .group-grid { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 15px;
    }
}

/* Small tablet: 2 columns */
@media (max-width: 768px) {
    .group-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 12px;
    }
}

/* Mobile: 2 columns with smaller cards */
@media (max-width: 480px) {
    .group-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
    }
}

.group-card {
    background: white;
    border-radius: clamp(32px, 4vw, 48px);
    padding: clamp(12px, 1.5vw, 20px) clamp(8px, 1vw, 12px);
    text-align: center;
    cursor: pointer;
    border: 3px solid #ffdfb0;
    box-shadow: 0 8px 0 #e0c494;
    transition: all 0.2s;
}
.group-card.selected {
    border-color: #6fbf4c;
    background: #f1ffe6;
    transform: scale(1.02);
}

.group-number-circle {
    width: clamp(45px, 6vw, 60px);
    height: clamp(45px, 6vw, 60px);
    background: linear-gradient(135deg, #6fbf4c, #5da63e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    font-weight: bold;
    color: white;
    margin: 0 auto;
    box-shadow: 0 4px 0 #4a7328;
}

.group-name { 
    font-size: clamp(0.9rem, 1.2vw, 1.1rem); 
    font-weight: bold; 
    margin-top: clamp(6px, 1vw, 8px); 
}

/* Plant Grid - 3 columns x 2 rows layout */
.plant-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: clamp(15px, 2vw, 24px);
    margin: clamp(15px, 2vw, 25px) 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Tablet: 3 columns */
@media (max-width: 1024px) {
    .plant-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        max-width: 500px;
    }
}

/* Small tablet: 2 columns */
@media (max-width: 768px) {
    .plant-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 12px;
        max-width: 400px;
    }
}

/* Mobile: 2 columns */
@media (max-width: 480px) {
    .plant-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 320px;
    }
}
.plant-card {
    background: white;
    border-radius: clamp(36px, 4vw, 48px);
    padding: clamp(12px, 1.5vw, 18px) clamp(8px, 1vw, 12px);
    width: clamp(120px, 15vw, 150px);
    text-align: center;
    cursor: pointer;
    border: 3px solid #ffdfb0;
    box-shadow: 0 8px 0 #e0c494;
    transition: all 0.2s;
}
.plant-card.selected {
    border-color: #6fbf4c;
    background: #f1ffe6;
    transform: scale(1.02);
}
.plant-emoji { 
    font-size: clamp(2.8rem, 4vw, 3.8rem); 
}
.plant-emoji img {
    width: clamp(50px, 7vw, 70px);
    height: clamp(50px, 7vw, 70px);
    object-fit: contain;
}
.plant-name { 
    font-size: clamp(1rem, 1.3vw, 1.3rem); 
    font-weight: bold; 
}

/* Tips Card */
.tips-card {
    background: #eef4e0;
    border-radius: 48px;
    padding: 30px 25px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}
.tip-box {
    background: white;
    border-radius: 48px;
    padding: 25px 20px;
    flex: 1;
    min-width: 220px;
    text-align: center;
    box-shadow: 0 8px 0 #cdd8b0;
}
.tip-icon { font-size: 3rem; margin-bottom: 12px; }
.tip-box h3 { color: #5d8736; margin-bottom: 12px; }

/* Tools Area */
.tools-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin: 30px 0;
}
.tool-card {
    background: #fff3e0;
    border-radius: 48px;
    padding: 18px;
    width: 130px;
    text-align: center;
    cursor: pointer;
    border: 3px solid #ffe2b5;
}
.tool-card.selected {
    border-color: #6fbf4c;
    background: #eaffd6;
}
.tool-emoji { font-size: 3rem; }
.tool-icon { display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }

/* Garden */
.garden-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.plant-stage-area {
    background: linear-gradient(145deg, #d9e6b3, #c3d9a3);
    border-radius: 60px;
    padding: 30px 20px;
    text-align: center;
}
.big-plant { font-size: 8rem; transition: transform 0.2s; }
.day-badge { background: #ffd966; display: inline-block; padding: 6px 20px; border-radius: 40px; font-weight: bold; margin: 10px 0; font-size: 1.2rem; }
.growth-message { background: #fff0c0; border-radius: 32px; padding: 8px 16px; display: inline-block; }

.time-magic {
    background: #ffefcf;
    border-radius: 56px;
    padding: 18px 20px;
    text-align: center;
    border: 2px solid #ffdc97;
}
.magic-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 12px;
}
.magic-btn {
    background: #ffb347;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-family: inherit;
    box-shadow: 0 4px 0 #b4621a;
    cursor: pointer;
    color: white;
}
.care-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}
.care-btn {
    background: #9bc47a;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 0 #5a7a3e;
    color: white;
}
.water-counter { background: #fff2cc; border-radius: 32px; padding: 8px; display: inline-block; margin-top: 8px; }

/* Diary */
.diary-template {
    background: #fff9ef;
    border-radius: clamp(24px, 3vw, 40px);
    padding: clamp(12px, 1.5vw, 20px);
    border: 3px solid #ffe0b5;
}
.name-section {
    background: #fff3cc;
    border-radius: clamp(24px, 3vw, 40px);
    padding: clamp(8px, 1vw, 12px) clamp(12px, 1.5vw, 20px);
    margin-bottom: clamp(15px, 2vw, 25px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 1vw, 15px);
    flex-wrap: wrap;
}
.name-section label { font-weight: bold; font-size: clamp(0.9rem, 1.2vw, 1.1rem); color: #7c5e3a; }
.name-input {
    padding: clamp(6px, 1vw, 8px) clamp(12px, 1.5vw, 20px);
    border: 2px solid #ffd27a;
    border-radius: 40px;
    font-family: inherit;
    font-size: var(--text-base);
    background: white;
    width: clamp(150px, 20vw, 200px);
    text-align: center;
}

.diary-layout {
    display: flex;
    gap: clamp(10px, 1.5vw, 15px);
    margin: clamp(10px, 1.5vw, 15px) 0;
}

.diary-tips-column {
    flex: 0 0 clamp(140px, 18vw, 180px);
    background: #e8f0da;
    border-radius: clamp(16px, 2vw, 24px);
    padding: clamp(10px, 1.2vw, 15px);
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 0.8vw, 10px);
}

/* Tablet diary layout */
@media (max-width: 1024px) {
    .diary-layout {
        flex-direction: column;
    }
    .diary-tips-column {
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .diary-plant-name-item,
    .diary-tip-item {
        flex-direction: column;
        border-bottom: none;
        padding-bottom: 0;
        flex: 1 1 calc(50% - 10px);
        min-width: 120px;
    }
    .diary-divider {
        display: none;
    }
}

/* Mobile diary layout */
@media (max-width: 768px) {
    .diary-plant-name-item,
    .diary-tip-item {
        flex: 1 1 100%;
    }
}

.diary-plant-name-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid #c8e6c9;
}

.diary-tip-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.diary-divider {
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(
        to right,
        #d1b38b,
        #d1b38b 5px,
        transparent 5px,
        transparent 10px
    );
    margin-top: 8px;
}

.diary-tip-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.diary-tip-text {
    font-size: 0.8rem;
    color: #5d4a2e;
    text-align: center;
}

.diary-tip-text label {
    display: block;
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 0.75rem;
}

.diary-tip-input {
    background: white;
    border: 2px solid #ffd27a;
    padding: 3px 6px;
    border-radius: 16px;
    font-family: inherit;
    font-size: 0.8rem;
    text-align: center;
}

.diary-plant-name-input {
    background: white;
    border: 2px solid #ffd27a;
    padding: 4px 8px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.8rem;
    width: 100%;
    margin-top: 5px;
}

.diary-group-info {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: bold;
    width: 100%;
    margin-top: 5px;
    text-align: center;
}

.plant-image-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.diary-cards-column {
    flex: 1;
}

.grid-4-small {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.diary-card-small {
    background: #fef5e8;
    border-radius: 0;
    padding: 10px 8px 10px 60px;
    text-align: center;
    box-shadow: 0 4px 0 #e0cfaa;
    transition: transform 0.2s;
    border: 2px solid #ffe0b0;
    position: relative;
}

.day-tag {
    position: absolute;
    top: 15px;
    left: 0;
    background-image: url('images/day.png');
    background-size: 100%;
    background-repeat: no-repeat;
    color: #5d3a1a;
    padding: 8px 16px;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    height: 38px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.diary-card {
    background: #fef5e8;
    border-radius: 40px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 8px 0 #e0cfaa;
    transition: transform 0.2s;
    border: 2px solid #ffe0b0;
}
.diary-card:hover { transform: translateY(-3px); }
.card-number {
    background: #ffd966;
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    font-weight: bold;
    margin-bottom: 12px;
    color: #5d3a1a;
}
.photo-area {
    background: white;
    border-radius: 0;
    padding: 20px;
    margin: 12px 0;
    min-height: 140px;
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 3px dashed #c0b28a;
}
.photo-area.selected {
    border: 3px solid #6fbf4c;
    background: white;
}
.photo-area.fixed {
    border: 3px solid #ffb347;
    background: white;
    cursor: default;
}

.photo-placeholder {
    font-size: 3rem;
    margin-bottom: 8px;
    opacity: 0.6;
}

.plant-emoji-large { font-size: 4rem; filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1)); }

.diary-plant-img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1));
}
.photo-day { font-size: 0.7rem; color: #b47c44; margin-top: 8px; }
.sentence {
    background: #fff6e6;
    border-radius: 0;
    padding: 12px;
    margin-top: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #5d4a2e;
}
.sentence-input {
    background: white;
    border: 2px solid #ffd27a;
    padding: 4px 10px;
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.9rem;
    width: 110px;
    text-align: center;
    margin: 0 4px;
}

.sentence-select {
    background: white;
    border: 2px solid #ffd27a;
    padding: 4px 8px;
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.9rem;
    text-align: center;
    margin: 0 4px;
    cursor: pointer;
}
.final-report-box {
    background: #e8f0da;
    border-radius: 40px;
    padding: 20px;
    margin-top: 25px;
    text-align: center;
}
.generate-btn {
    background: #6fbf4c;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 60px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin: 8px;
}
.next-btn {
    background: #6fbf4c;
    color: white;
    border: none;
    padding: 10px 32px;
    border-radius: 60px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}
.flex-center { display: flex; justify-content: center; }
.learning-tip {
    background: #fff0d0;
    border-radius: 28px;
    padding: 8px 16px;
    margin-top: 15px;
    font-size: 0.7rem;
    color: #b47c44;
    text-align: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}
.modal-content {
    background: #fffef0;
    border-radius: 56px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 3px solid #ffd966;
}
.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #5d8736;
    margin-bottom: 20px;
}
.thumbnail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin: 15px 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}
.modal-thumb {
    background: #fef0cf;
    border-radius: 32px;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.1s;
    border: 2px solid #ffdca8;
    min-width: 90px;
}
.modal-thumb:hover { transform: scale(1.05); background: #ffe6b3; }
.modal-thumb-emoji { font-size: 2.5rem; }
.modal-thumb-day { font-size: 0.8rem; font-weight: bold; color: #b47c44; margin-top: 5px; }
.modal-close {
    background: #ffb347;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: bold;
    margin-top: 15px;
    cursor: pointer;
    color: white;
    font-size: 1rem;
}

.toast-msg {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c5a2e;
    color: white;
    padding: 12px 24px;
    border-radius: 60px;
    z-index: 1000;
    font-weight: bold;
    animation: fadeOut 2s forwards;
}
@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}
/* ================= Step Navigation Bar ================= */
.steps-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff3e0;
    padding: 15px 20px;
    flex-wrap: wrap;
    gap: 5px;
    border-bottom: 3px solid #ffdfb0;
}

.step-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 40px;
    transition: all 0.2s;
    opacity: 0.6;
}

.step-nav-item.active {
    opacity: 1;
    background: #eaffd6;
}

.step-nav-item.completed {
    opacity: 1;
}

.step-nav-number {
    width: 32px;
    height: 32px;
    background: #ffd966;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #5d3a1a;
    margin-bottom: 5px;
}

.step-nav-item.active .step-nav-number {
    background: #6fbf4c;
    color: white;
    box-shadow: 0 2px 8px rgba(111,191,76,0.4);
}

.step-nav-item.completed .step-nav-number {
    background: #aad68e;
    color: white;
}

.step-nav-label {
    font-size: 0.7rem;
    font-weight: bold;
    color: #b47c44;
    white-space: nowrap;
}

.step-nav-item.active .step-nav-label {
    color: #5d8736;
}

.step-nav-arrow {
    color: #ffd966;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 响应式：小屏幕时隐藏箭头文字 */
@media (max-width: 700px) {
    .step-nav-label {
        font-size: 0.6rem;
    }
    .step-nav-arrow {
        font-size: 0.8rem;
    }
    .step-nav-number {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
}

/* 步骤内容区域的小按钮 */
.next-btn-small {
    background: #6fbf4c;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.next-btn-small:hover {
    background: #5da63e;
}

.next-btn-small:disabled {
    background: #ccc;
    cursor: not-allowed;
}
/* ================= 6-Step Navigation Menu ================= */
.steps-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff8e8, #fff3e0);
    padding: var(--space-sm) var(--space-md);
    flex-wrap: wrap;
    gap: clamp(2px, 0.5vw, 8px);
    border-bottom: 3px solid #ffdfb0;
}

.step-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: clamp(8px, 1vw, 14px) clamp(10px, 1.5vw, 20px);
    border-radius: 20px;
    transition: all 0.3s ease;
    min-width: clamp(100px, 15vw, 180px);
    position: relative;
    background: #f0f0f0;
    border: 2px solid #d0d0d0;
    flex: 0 1 auto;
}

.step-menu-item:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.step-menu-item.active {
    background: linear-gradient(135deg, #eaffd6, #d4f0c0);
    box-shadow: 0 4px 12px rgba(111, 191, 76, 0.3);
    border: 2px solid #6fbf4c;
}

.step-menu-item.completed {
    background: rgba(170, 214, 142, 0.3);
    border: 2px solid #aadd8e;
}

/* Top row: number + icon */
.step-top-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 0.8vw, 8px);
    margin-bottom: 0;
}

.step-icon {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    flex-shrink: 0;
}

.step-icon img {
    width: clamp(24px, 3vw, 36px);
    height: clamp(24px, 3vw, 36px);
    object-fit: contain;
}

.step-title {
    font-size: clamp(0.55rem, 0.9vw, 0.75rem);
    font-weight: bold;
    color: #7c5e3a;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
    margin: 0;
    padding: 0;
}

.step-menu-item.active .step-title {
    color: #5d8736;
}

.step-number {
    width: clamp(18px, 2vw, 24px);
    height: clamp(18px, 2vw, 24px);
    background: #ffd966;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.55rem, 0.8vw, 0.7rem);
    font-weight: bold;
    color: #5d3a1a;
    flex-shrink: 0;
}

.step-menu-item.active .step-number {
    background: #6fbf4c;
    color: white;
}

.step-menu-item.completed .step-number {
    background: #aad68e;
    color: white;
}

.step-arrow {
    color: #ffd966;
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    font-weight: bold;
    flex-shrink: 0;
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .steps-menu {
        padding: var(--space-xs) var(--space-sm);
    }
    .step-menu-item {
        min-width: clamp(90px, 14vw, 140px);
        padding: 8px 10px;
    }
    .step-title {
        font-size: clamp(0.5rem, 0.9vw, 0.65rem);
    }
}

/* Small Tablet / Large Phone (600px - 768px) */
@media (max-width: 768px) {
    .steps-menu {
        gap: 4px;
        padding: var(--space-xs);
    }
    .step-menu-item {
        min-width: clamp(80px, 22vw, 120px);
        padding: 5px 8px;
    }
    .step-top-row {
        gap: 3px;
        margin-bottom: 0;
    }
    .step-icon {
        font-size: 1.2rem;
    }
    .step-icon img {
        width: 24px;
        height: 24px;
    }
    .step-title {
        font-size: 0.55rem;
    }
    .step-number {
        width: 16px;
        height: 16px;
        font-size: 0.5rem;
    }
    .step-arrow {
        font-size: 0.7rem;
    }
}

/* Mobile (< 600px) */
@media (max-width: 600px) {
    .steps-menu {
        gap: 2px;
        justify-content: space-around;
    }
    .step-menu-item {
        min-width: 0;
        flex: 1 1 calc(33% - 4px);
        max-width: 110px;
        padding: 4px 4px;
        border-radius: 12px;
    }
    .step-top-row {
        gap: 2px;
        margin-bottom: 0;
    }
    .step-icon {
        font-size: 1.1rem;
    }
    .step-icon img {
        width: 20px;
        height: 20px;
    }
    .step-title {
        font-size: 0.5rem;
        line-height: 1.2;
    }
    .step-number {
        width: 14px;
        height: 14px;
        font-size: 0.45rem;
    }
    .step-arrow {
        display: none;
    }
}

/* Very small mobile (< 400px) */
@media (max-width: 400px) {
    .step-menu-item {
        flex: 1 1 calc(33% - 2px);
        max-width: 90px;
        padding: 4px 3px;
    }
    .step-title {
        font-size: 0.45rem;
    }
}

.garden-main-new {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vw, 20px);
}

.immersive-garden {
    background: linear-gradient(145deg, #e8f5e9, #c8e6c9);
    border-radius: clamp(20px, 3vw, 40px);
    padding: clamp(12px, 2vw, 25px);
    border: 3px solid #a5d6a7;
}

.garden-three-columns {
    display: flex;
    gap: clamp(10px, 2vw, 20px);
}

.tips-column,
.plant-column,
.tasks-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex item overflow */
}

.tips-panel {
    background-image: url('images/tipsbackground.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: clamp(16px, 2vw, 24px);
    padding: clamp(12px, 1.5vw, 20px);
    min-height: clamp(280px, 35vh, 400px);
    display: flex;
    flex-direction: column;
}

.tips-panel-title {
    font-weight: bold;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    color: #5d8736;
    margin-bottom: clamp(10px, 1.5vw, 20px);
    text-align: center;
}

.tips-list {
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.5vw, 5px);
    flex: 1;
}

.tip-card {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 12px);
    padding: clamp(6px, 1vw, 8px) clamp(10px, 1.5vw, 15px) clamp(6px, 1vw, 8px) clamp(15px, 2vw, 30px);
    border-radius: 16px;
}

.tip-card-icon {
    font-size: clamp(1.3rem, 1.8vw, 1.8rem);
    width: clamp(32px, 4vw, 40px);
    height: clamp(32px, 4vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tip-card-icon img {
    width: clamp(28px, 3.5vw, 48px);
    height: clamp(28px, 3.5vw, 48px);
    object-fit: contain;
}

.tip-card-text {
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    font-weight: 500;
    color: #5d4a2e;
}

.garden-scene {
    position: relative;
    width: 100%;
    min-height: clamp(200px, 30vh, 300px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #c8e6c9, #dcedc8);
    border-radius: clamp(20px, 2.5vw, 32px);
    padding: clamp(10px, 1.5vw, 15px);
}

/* Tablet (768px - 1024px) - Garden layout */
@media (max-width: 1024px) {
    .garden-three-columns {
        gap: 12px;
    }
    .tips-panel {
        min-height: 320px;
    }
    .tip-card {
        padding: 6px 10px;
    }
    .tip-card-icon {
        width: 32px;
        height: 32px;
    }
}

/* Small Tablet (600px - 768px) - Garden layout */
@media (max-width: 768px) {
    .garden-three-columns {
        flex-direction: column;
        gap: 15px;
    }
    .tips-panel,
    .task-panel {
        min-height: auto;
    }
    .garden-scene {
        min-height: 250px;
    }
}

.action-animation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.3);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.action-animation-overlay.show {
    opacity: 1;
    visibility: visible;
}

.action-animation-overlay.top {
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 20px;
    padding-left: 20px;
}

.action-animation-overlay.right {
    justify-content: flex-end;
    padding-right: 60px;
}

.action-animation-overlay.right .action-gif {
    max-width: 60%;
    max-height: 60%;
}

.action-animation-overlay.center-left {
    justify-content: flex-start;
    padding-left: 80px;
}

.action-gif {
    max-width: 40%;
    max-height: 40%;
    object-fit: contain;
    border-radius: 20px;
}

.plant-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.plant-image-wrapper {
    width: clamp(180px, 22vw, 280px);
    height: clamp(220px, 28vh, 320px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.plant-image-wrapper .plant-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.2));
    transition: transform 0.5s ease;
}

.plant-day {
    margin-top: clamp(10px, 1.5vw, 15px);
    font-size: clamp(0.9rem, 1.3vw, 1.2rem);
    font-weight: bold;
    color: #5d8736;
    background: rgba(255, 255, 255, 0.8);
    padding: clamp(6px, 1vw, 8px) clamp(12px, 1.5vw, 20px);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.task-panel {
    background: linear-gradient(135deg, #fff9e6, #fff3cc);
    border-radius: clamp(16px, 2vw, 24px);
    padding: clamp(12px, 1.5vw, 20px);
    border: 2px solid #ffe082;
    min-height: clamp(280px, 35vh, 400px);
    display: flex;
    flex-direction: column;
}

.task-panel-title {
    font-weight: bold;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    color: #f57c00;
    margin-bottom: clamp(10px, 1.5vw, 20px);
    text-align: center;
    background: rgba(255,255,255,0.8);
    padding: clamp(8px, 1vw, 10px);
    border-radius: 16px;
}

.task-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(10px, 1.5vw, 15px);
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.task-button-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1vw, 8px);
}

.task-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: clamp(70px, 9vw, 90px);
    height: clamp(70px, 9vw, 90px);
    border-radius: clamp(14px, 1.8vw, 20px);
    border: 3px solid;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    background: white;
}

.task-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

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

.task-btn.water-btn {
    border-color: #64b5f6;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

/* Sun Animation Container */
.sun-animation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
    position: relative;
    height: 60px;
}

.sun-icon {
    position: relative;
    z-index: 2;
    animation: sunPulse 2s ease-in-out infinite;
}

.sun-icon img {
    filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.6));
}

@keyframes sunPulse {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.6));
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 193, 7, 0.9));
    }
}

.sun-rays {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.3) 0%, transparent 70%);
    animation: sunRays 3s linear infinite;
}

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

.task-btn.fertilizer-btn {
    border-color: #aed581;
    background: linear-gradient(135deg, #f1f8e9, #dcedc8);
}

.task-btn.completed {
    border-color: #81c784 !important;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9) !important;
}

.task-btn.needed {
    animation: btnPulse 1.2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.5);
}

@keyframes btnPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 152, 0, 0.5);
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 0 0 25px rgba(255, 152, 0, 0.8);
    }
}

.task-btn-icon {
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.task-btn-icon img {
    width: clamp(20px, 2.5vw, 28px);
    height: clamp(20px, 2.5vw, 28px);
    object-fit: contain;
}

.task-btn-text {
    font-size: clamp(0.65rem, 0.9vw, 0.75rem);
    font-weight: bold;
    color: #5d4a2e;
    margin-top: 4px;
}

.task-btn-status {
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: #bdbdbd;
    font-weight: bold;
}

.task-btn-status.done {
    color: #4caf50;
}

.task-btn-status.not-needed {
    color: #bdbdbd;
}

/* Mobile task buttons adjustments */
@media (max-width: 600px) {
    .task-buttons {
        gap: 10px;
    }
    .task-btn {
        width: clamp(60px, 18vw, 70px);
        height: clamp(60px, 18vw, 70px);
    }
    .task-btn-icon {
        font-size: 1.3rem;
    }
    .task-btn-text {
        font-size: 0.6rem;
    }
}

.timeline-container {
    background: linear-gradient(135deg, #fff8e8, #fff3e0);
    border-radius: 32px;
    padding: 20px;
    border: 2px solid #ffdfb0;
}

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

.timeline-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #5d8736;
}

.timeline-track {
    position: relative;
    height: 12px;
    background: #e8e0d0;
    border-radius: 10px;
    overflow: visible;
    margin-top: 25px;
}

.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #9bcd6c, #6fbf4c);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.timeline-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: #ffd966;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: left 0.5s ease;
    left: 0%;
}

.marker-day {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #6fbf4c, #5da63e);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.75rem;
    color: #8b7355;
    font-weight: bold;
}

@media (max-width: 600px) {
    .garden-three-columns {
        flex-direction: column;
    }
    .garden-scene {
        min-height: 300px;
    }
    .plant-image-wrapper {
        width: 200px;
        height: 250px;
    }
    .tips-panel,
    .task-panel {
        min-height: auto;
    }
    .task-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

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

.celebration-content {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    border-radius: 40px;
    padding: 40px;
    text-align: center;
    border: 4px solid #ffd54f;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: celebrationPop 0.5s ease;
}

@keyframes celebrationPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.celebration-emoji {
    font-size: 5rem;
    margin-bottom: 20px;
}

.celebration-title {
    font-size: 2rem;
    font-weight: bold;
    color: #f57f17;
    margin-bottom: 15px;
}

.celebration-message {
    font-size: 1.1rem;
    color: #5d4a2e;
    margin-bottom: 25px;
}

.celebration-btn {
    background: linear-gradient(135deg, #6fbf4c, #5da63e);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
}

.day-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    animation: fadeInOut 1.5s ease forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.day-transition-content {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 30px;
    padding: 30px 50px;
    text-align: center;
    border: 3px solid #81c784;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.day-transition-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
}

.day-transition-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #5d8736;
}

.preview-btn {
    background: linear-gradient(135deg, #64b5f6, #42a5f5);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #1976d2;
}

.preview-btn:hover {
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
    transform: translateY(-2px);
}

.preview-btn:active {
    transform: translateY(0);
}

.diary-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.diary-preview-overlay.show {
    display: flex;
}

.diary-preview-modal {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    animation: previewSlideIn 0.3s ease;
}

@keyframes previewSlideIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.diary-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.diary-preview-header h2 {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #9bcd6c, #6fa83d);
    padding: 8px 20px;
    border-radius: 25px;
    text-shadow: none;
    margin: 0;
}

.preview-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
}

.preview-close-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.6);
    transform: rotate(90deg);
}

.diary-preview-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 40px;
    overflow: hidden;
}

.diary-preview-content .diary-template {
    background: linear-gradient(135deg, #fffef5, #fff9e6);
    border-radius: 30px;
    padding: 35px 40px;
    border: 4px solid #ffd966;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 1300px;
    width: 100%;
}

.diary-preview-content .diary-layout {
    display: flex;
    gap: 30px;
    margin: 0;
}

.diary-preview-content .diary-tips-column {
    flex: 0 0 220px;
    background: #e8f0da;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diary-preview-content .diary-plant-name-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid #c8e6c9;
}

.diary-preview-content .diary-tip-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.diary-preview-content .diary-divider {
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(
        to right,
        #d1b38b,
        #d1b38b 5px,
        transparent 5px,
        transparent 10px
    );
    margin-top: 10px;
}

.diary-preview-content .diary-tip-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.diary-preview-content .diary-tip-text {
    font-size: 1rem;
    color: #5d4a2e;
    text-align: center;
}

.diary-preview-content .diary-group-info {
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    width: 100%;
    margin-top: 5px;
    text-align: center;
}

.diary-preview-content .plant-image-container {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.diary-preview-content .plant-image-container img {
    width: 110px;
    height: 110px;
    object-fit: contain;
}

.diary-preview-content .diary-cards-column {
    flex: 1;
}

.diary-preview-content .grid-4-small {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.diary-preview-content .diary-card-small {
    background: #fef5e8;
    border-radius: 0;
    padding: 15px 12px 15px 70px;
    text-align: center;
    box-shadow: 0 4px 0 #e0cfaa;
    border: 2px solid #ffe0b0;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.diary-preview-content .diary-card-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 0 #e0cfaa, 0 10px 20px rgba(0,0,0,0.15);
}

.diary-preview-content .diary-card-small::after {
    content: '🔍 Click to view';
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 0.75rem;
    color: #b47c44;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.diary-preview-content .diary-card-small:hover::after {
    opacity: 1;
}

.diary-preview-content .day-tag {
    position: absolute;
    top: 16px;
    left: 0;
    background-image: url('images/day.png');
    background-size: 100%;
    background-repeat: no-repeat;
    color: #5d3a1a;
    padding: 10px 18px;
    font-weight: bold;
    font-size: 1rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    height: 42px;
}

.diary-preview-content .photo-area {
    background: white;
    border-radius: 0;
    padding: 20px;
    margin: 12px 0;
    min-height: 150px;
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffb347;
}

.diary-preview-content .diary-plant-img {
    width: 100%;
    height: 130px;
    object-fit: contain;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1));
}

.diary-preview-content .sentence {
    background: #fff6e6;
    border-radius: 0;
    padding: 14px;
    margin-top: 12px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #5d4a2e;
}

.diary-preview-content .sentence-text {
    display: inline;
}

.diary-preview-content .sentence-highlight {
    background: linear-gradient(135deg, #fff3cc, #ffe082);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: bold;
    color: #5d4a2e;
}

@media (max-width: 900px) {
    .diary-preview-content {
        padding: 15px 20px;
    }
    
    .diary-preview-content .diary-template {
        padding: 15px;
    }
    
    .diary-preview-content .diary-layout {
        flex-direction: column;
    }
    
    .diary-preview-content .diary-tips-column {
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .diary-preview-content .diary-plant-name-item,
    .diary-preview-content .diary-tip-item {
        flex-direction: column;
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .diary-preview-content .diary-divider {
        display: none;
    }
    
    .diary-preview-content .plant-image-container {
        display: none;
    }
    
    .diary-preview-content .diary-card-small {
        padding: 8px 8px 8px 50px;
    }
    
    .diary-preview-content .diary-plant-img {
        height: 70px;
    }
}

@media (max-width: 600px) {
    .diary-preview-header {
        padding: 10px 15px;
    }
    
    .diary-preview-header h2 {
        font-size: 1rem;
        padding: 6px 15px;
    }
    
    .preview-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .diary-preview-content {
        padding: 10px;
    }
    
    .diary-preview-content .diary-template {
        padding: 10px;
        border-radius: 20px;
    }
    
    .diary-preview-content .diary-tips-column {
        padding: 10px;
        gap: 10px;
    }
    
    .diary-preview-content .grid-4-small {
        gap: 8px;
    }
    
    .diary-preview-content .diary-card-small {
        padding: 6px 6px 6px 45px;
    }
    
    .diary-preview-content .day-tag {
        font-size: 0.7rem;
        min-width: 70px;
        height: 28px;
        padding: 5px 10px;
    }
    
    .diary-preview-content .photo-area {
        padding: 10px;
        min-height: 80px;
    }
    
    .diary-preview-content .diary-plant-img {
        height: 60px;
    }
    
    .diary-preview-content .sentence {
        font-size: 0.75rem;
        padding: 8px;
    }
}

.diary-slideshow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 4000;
}

.diary-slideshow-overlay.show {
    display: flex;
}

.diary-slideshow-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.slideshow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.3);
}

.slideshow-page-indicator {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #6fbf4c, #5da63e);
    padding: 8px 20px;
    border-radius: 25px;
}

.slideshow-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
}

.slideshow-close-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.6);
    transform: rotate(90deg);
}

.slideshow-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    overflow: hidden;
}

.slideshow-card {
    background: #fff9ef;
    border-radius: 30px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 4px solid #ffd966;
    animation: slideIn 0.4s ease;
    position: relative;
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.slideshow-card .day-tag {
    position: absolute;
    top: 25px;
    left: 0;
    background-image: url('images/day.png');
    background-size: 100%;
    background-repeat: no-repeat;
    color: #5d3a1a;
    padding: 14px 28px;
    font-weight: bold;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    height: 55px;
}

.slideshow-card .photo-area {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 30px auto;
    min-height: 250px;
    max-width: 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid #ffb347;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.slideshow-card .diary-plant-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1));
}

.slideshow-card .sentence {
    background: #fff6e6;
    border-radius: 20px;
    padding: 25px 30px;
    margin-top: 20px;
    font-size: 1.4rem;
    line-height: 1.8;
    color: #5d4a2e;
    border: 2px solid #ffe0b0;
}

.slideshow-card .sentence-highlight {
    background: linear-gradient(135deg, #fff3cc, #ffe082);
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: bold;
    color: #5d4a2e;
    display: inline-block;
    margin: 2px;
}

.slideshow-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.3);
}

.slideshow-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #6fbf4c, #5da63e);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(111, 191, 76, 0.4);
}

.slideshow-nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(111, 191, 76, 0.6);
}

.slideshow-nav-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.slideshow-nav-btn .nav-text {
    font-size: 0.9rem;
}

.slideshow-dots {
    display: flex;
    gap: 12px;
}

.slideshow-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slideshow-dot:hover {
    background: rgba(255, 255, 255, 0.5);
}

.slideshow-dot.active {
    background: #6fbf4c;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(111, 191, 76, 0.5);
}

@media (max-width: 700px) {
    .slideshow-header {
        padding: 10px 15px;
    }
    
    .slideshow-page-indicator {
        font-size: 1rem;
        padding: 6px 15px;
    }
    
    .slideshow-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .slideshow-content {
        padding: 15px;
    }
    
    .slideshow-card {
        padding: 25px 15px;
        border-radius: 20px;
    }
    
    .slideshow-card .day-tag {
        font-size: 1rem;
        min-width: 90px;
        height: 38px;
        padding: 8px 15px;
    }
    
    .slideshow-card .photo-area {
        padding: 20px;
        min-height: 180px;
        max-width: 80%;
    }
    
    .slideshow-card .diary-plant-img {
        height: 150px;
    }
    
    .slideshow-card .sentence {
        font-size: 1.1rem;
        padding: 15px 20px;
    }
    
    .slideshow-navigation {
        padding: 15px 20px;
    }
    
    .slideshow-nav-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .slideshow-nav-btn .nav-text {
        display: none;
    }
    
    .slideshow-dots {
        gap: 8px;
    }
    
    .slideshow-dot {
        width: 10px;
        height: 10px;
    }
}