/* Apple-inspired design with 呼吸感 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e7;
    display: inline-block;
}



/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 30px 0 40px 0;
    padding: 0 20px;
}

.nav-link {
    display: inline-block;
    padding: 12px 24px;
    background: #f0f0f0;
    color: #515154;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

.nav-link.active {
    background: #007aff;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.nav-link.active:hover {
    background: #0056cc;
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

/* Input Section */
.input-section {
    margin-bottom: 40px;
}

.input-section label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: #515154;
    margin-bottom: 12px;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fafafa;
}

textarea:focus {
    outline: none;
    border-color: #007aff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Form Groups */
.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: #515154;
    margin-bottom: 12px;
}

/* File Upload */
input[type="file"] {
    width: 100%;
    padding: 16px;
    border: 2px dashed #e5e5e7;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: #007aff;
    background: #f0f8ff;
}

input[type="file"]:focus {
    outline: none;
    border-color: #007aff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Image Preview */
.image-preview {
    margin-top: 16px;
    text-align: center;
    padding: 16px;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    background: #fafafa;
}

.image-preview img {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Nutrition Form */
.nutrition-form {
    margin-bottom: 40px;
}



/* Error Messages */
.error {
    color: #ff3b30;
    background: #ffe5e5;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #ff3b30;
    margin-top: 16px;
}

/* Option Sections */
.option-section {
    margin-bottom: 35px;
}

.section-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: #515154;
    margin-bottom: 16px;
}

.option-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 36px;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.9rem;
}

.option-item:hover {
    background: #e8f4fd;
    border-color: #007aff;
}

.option-item input[type="radio"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    accent-color: #007aff;
}

.option-item span {
    font-size: 0.95rem;
    font-weight: 400;
    color: #1d1d1f;
}

.option-item:has(input:checked) {
    background: #007aff;
    border-color: #007aff;
    color: white;
}

.option-item:has(input:checked) span {
    color: white;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.submit-btn:hover {
    background: #0056cc;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.3);
}

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

/* Coffee Button Section */
.coffee-section {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.coffee-section img {
    width: 200px;
    height: auto;
    transition: transform 0.3s ease;
}

.coffee-section img:hover {
    transform: scale(1.05);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5e7;
    border-top: 3px solid #007aff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Output Section */
.output-section {
    margin-top: 40px;
}

.option-section {
    margin-top: 40px;
}

.option-section h3 {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e5e7;
}

.option-box {
    background: #f8f9fa;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.option-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid #e5e5e7;
}

.option-label {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 1rem;
}

.option-content {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: #1d1d1f;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Encouragement page specific styles */
.analysis-result {
    margin-top: 30px;
}

.analysis-section {
    background: #f8f9fa;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.analysis-section h3 {
    margin: 0 0 15px 0;
    color: #1d1d1f;
    font-size: 1.1rem;
    font-weight: 600;
}

.analysis-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #1d1d1f;
}

.encouragement-section h3 {
    margin: 0 0 15px 0;
    color: #1d1d1f;
    font-size: 1.1rem;
    font-weight: 600;
}

.encouragement-type {
    background: #e8f4fd;
    border: 1px solid #007AFF;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #007AFF;
    font-size: 1rem;
}

.encouragement-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.encouragement-option-box {
    background: #f8f9fa;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.encouragement-option-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.encouragement-content {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: #1d1d1f;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #fff;
}

.output-box {
    background: #f8f9fa;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid #e5e5e7;
}

.output-label {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 1rem;
}

.copy-btn {
    padding: 6px 12px;
    background: transparent;
    color: #007aff;
    border: 1px solid #007aff;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #007aff;
    color: white;
}

.output-content {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: #1d1d1f;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Content Container Styles */
.content-container {
    margin-bottom: 30px;
}

.content-box {
    background: #fff;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e7;
}

.content-label {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 1rem;
}

.content-content {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: #1d1d1f;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Quiz Page Styles */
.regen-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e5e5e7;
}

.day-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.day-selector label {
    font-weight: 500;
    color: #515154;
    white-space: nowrap;
}

.day-selector select {
    padding: 10px 15px;
    border: 2px solid #e5e5e7;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    min-width: 120px;
}

.regen-btn {
    padding: 10px 20px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.regen-btn:hover {
    background: #0056cc;
    transform: translateY(-1px);
}

.quiz-output {
    margin-top: 30px;
}

.quiz-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 20px;
}

.quiz-option {
    font-size: 1rem;
    color: #1d1d1f;
    margin-bottom: 15px;
    line-height: 1.5;
}

.answer-prefix {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 15px;
}

.answer-explanation {
    font-size: 1rem;
    color: #1d1d1f;
    line-height: 1.6;
}

/* Response Page Styles */
.response-output {
    margin-top: 30px;
}

.response-section {
    margin-bottom: 30px;
}

.output-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.output-box {
    background: #fff;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e7;
}

.output-label {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 1rem;
}

.output-content {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: #1d1d1f;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Coffee Button Styles */
.coffee-section {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
}

/* Version Footer */
.version-footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #e5e5e7;
}

.version-text {
    font-size: 0.8rem;
    color: #86868b;
    font-weight: 400;
}

.coffee-btn {
    display: inline-block;
    transition: transform 0.3s ease;
}

.coffee-btn:hover {
    transform: scale(1.05);
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
        margin: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .option-grid {
        grid-template-columns: 1fr;
    }
    
    .option-row {
        gap: 6px;
    }
    
    .option-item {
        padding: 6px 10px;
        font-size: 0.9rem;
        min-height: 36px;
    }
    
    .option-item span {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .option-row {
        flex-wrap: nowrap;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }
    
    .option-item {
        padding: 5px 8px;
        font-size: 0.8rem;
        min-height: 32px;
        flex-shrink: 0;
    }
    
    .option-item span {
        font-size: 0.8rem;
    }
}

/* Admin Access Styles */
.admin-access {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-access input[type="password"] {
    padding: 8px 12px;
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 120px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.admin-access input[type="password"]:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.admin-access button {
    padding: 8px 16px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-access button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.admin-btn {
    padding: 8px 16px;
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.admin-btn:hover {
    background: #d70015;
    transform: translateY(-1px);
}

.admin-status {
    font-size: 0.9rem;
    color: #007aff;
    font-weight: 500;
}

.admin-controls {
    margin-top: 10px;
}

/* Quiz Section Styles */
.quiz-section {
    text-align: center;
    margin-bottom: 30px;
}

.quiz-section h2 {
    font-size: 1.8rem;
    font-weight: 400;
    color: #1d1d1f;
    margin-bottom: 20px;
}

/* Responsive Admin Access */
@media (max-width: 480px) {
    .admin-access {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .admin-access input[type="password"] {
        width: 100px;
        font-size: 0.8rem;
    }
    
    .admin-access button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .admin-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        margin-left: 0;
        margin-top: 5px;
    }
}
