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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #26a69a 0%, #00796b 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    margin-top: 20px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #e1e8ed;
}

.creator-info {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
    border-radius: 25px;
    display: inline-block;
    border: 2px solid #26a69a;
}

.creator-info p {
    margin: 0;
    color: #004d40;
    font-size: 0.95em;
    font-weight: 500;
}

.creator-name {
    font-weight: 700;
    color: #00695c;
}


header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

.calculator-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
    gap: 10px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: #ecf0f1;
    color: #2c3e50;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 24px;
    font-weight: 600;
}

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

.tab-btn.active {
    background: linear-gradient(135deg, #26a69a 0%, #00796b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(38, 166, 154, 0.4);
}

.calculator-section {
    display: none;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.calculator-section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

.calculator-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8em;
    text-align: center;
    font-weight: 400;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: 500;
    font-size: 14px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #26a69a;
    box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.1);
}

.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-right: 8px;
    transform: scale(1.2);
}

.radio-group label {
    margin-bottom: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

button {
    background: linear-gradient(135deg, #26a69a 0%, #00796b 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    margin: 20px 0;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(38, 166, 154, 0.3);
    background: linear-gradient(135deg, #2bbbad 0%, #00897b 100%);
}

button:active {
    transform: translateY(0);
}

.result {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #26a69a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.result p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.bmi-underweight { color: #00acc1; font-weight: bold; }
.bmi-normal { color: #26a69a; font-weight: bold; }
.bmi-overweight { color: #f39c12; font-weight: bold; }
.bmi-obese { color: #e74c3c; font-weight: bold; }

.explanation {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.explanation h3 {
    color: #000000;
    margin-bottom: 15px;
    font-size: 1.64em;
    font-weight: bold;
}

.explanation h4 {
    color: #000000;
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: bold;
}

.explanation p {
    color: #333333;
    line-height: 1.6;
    font-weight: normal;
    margin-top: 16px;
    margin-bottom: 16px;
}

.export-section {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.export-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.export-btn {
    background: linear-gradient(135deg, #00acc1 0%, #00838f 100%);
    margin: 0 10px;
    width: auto;
    padding: 12px 25px;
    font-size: 14px;
}

.export-btn:hover {
    background: linear-gradient(135deg, #00bcd4 0%, #00695c 100%);
    box-shadow: 0 4px 15px rgba(0, 172, 193, 0.3);
}

/* 壓力指數相關樣式 */
.stress-low {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
}

.stress-medium {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.stress-high {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.stress-severe {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: white;
}

.symptom-areas {
    background: #fff3e0;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #ff9800;
}

.symptom-areas h4 {
    color: #e65100;
    margin-bottom: 10px;
}

.symptom-areas ul {
    margin-left: 20px;
}

.symptom-areas li {
    margin-bottom: 5px;
    color: #bf360c;
}

.stress-tips {
    display: grid;
    gap: 15px;
    margin-top: 10px;
}

.tip-category {
    background: #f3e5f5;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #9c27b0;
}

.tip-category strong {
    color: #6a1b9a;
    display: block;
    margin-bottom: 8px;
}

.tip-category ul {
    margin-left: 20px;
}

.tip-category li {
    margin-bottom: 5px;
    color: #4a148c;
}

.warning-note {
    background: #ffebee;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #f44336;
}

.warning-note h4 {
    color: #c62828;
    margin-bottom: 10px;
}

.warning-note p {
    color: #b71c1c;
    margin-bottom: 10px;
}

.warning-note ul {
    margin-left: 20px;
}

.warning-note li {
    margin-bottom: 5px;
    color: #b71c1c;
    font-weight: 500;
}

/* 飲食行為相關樣式 */
.eating-poor {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.eating-fair {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.eating-good {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}

.eating-excellent {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
}

.problem-areas {
    background: #fff3e0;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #ff9800;
}

.problem-areas h4 {
    color: #e65100;
    margin-bottom: 10px;
}

.problem-areas ul {
    margin-left: 20px;
}

.problem-areas li {
    margin-bottom: 5px;
    color: #bf360c;
}

.eating-tips {
    display: grid;
    gap: 15px;
    margin-top: 10px;
}

.nutrition-note {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #4caf50;
}

.nutrition-note h4 {
    color: #2e7d32;
    margin-bottom: 10px;
}

.nutrition-note p {
    color: #1b5e20;
    margin-bottom: 8px;
}

/* FRAX骨折風險相關樣式 */
.frax-low {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
}

.frax-medium {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.frax-high {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.frax-scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.frax-scores .score-display {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.frax-scores .score-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #1976d2;
}

.frax-scores .score-label {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    line-height: 1.3;
}

.risk-factors {
    background: #fff3e0;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #ff9800;
}

.risk-factors h4 {
    color: #e65100;
    margin-bottom: 10px;
}

.risk-factors ul {
    margin-left: 20px;
}

.risk-factors li {
    margin-bottom: 5px;
    color: #bf360c;
}

.bone-tips {
    display: grid;
    gap: 15px;
    margin-top: 10px;
}

.medical-note {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #2196f3;
}

.medical-note h4 {
    color: #1565c0;
    margin-bottom: 10px;
}

.medical-note p {
    color: #0d47a1;
    margin-bottom: 8px;
}

.risk-interpretation {
    background: #f3e5f5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #9c27b0;
}

.risk-interpretation h4 {
    color: #6a1b9a;
    margin-bottom: 10px;
}

.risk-interpretation p {
    color: #4a148c;
    margin-bottom: 8px;
}

.treatment-indication {
    background: #ffebee;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #f44336;
    font-weight: bold;
    color: #c62828 !important;
}

.prevention-focus {
    background: #e8f5e8;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #4caf50;
    font-weight: bold;
    color: #2e7d32 !important;
}

footer {
    text-align: center;
    padding: 20px 0;
    color: #7f8c8d;
    border-top: 1px solid #e1e8ed;
    margin-top: 30px;
}

.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.info {
    background: #e0f2f1;
    border: 1px solid #b2dfdb;
    color: #004d40;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 2em;
    }

    .calculator-tabs {
        flex-direction: column;
        align-items: center;
    }

    .tab-btn {
        width: 200px;
        text-align: center;
    }

    .calculator-section {
        padding: 20px;
    }

    .radio-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .export-btn {
        display: block;
        margin: 10px auto;
        width: 80%;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 5px;
        padding: 10px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .calculator-section {
        padding: 15px;
    }

    .tab-btn {
        width: 150px;
        padding: 10px 15px;
        font-size: 12px;
    }
}

.progress-bar {
    background: #e1e8ed;
    border-radius: 10px;
    height: 20px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-underweight {
    background: linear-gradient(to right, #00acc1, #4dd0e1);
}

.progress-normal {
    background: linear-gradient(to right, #26a69a, #4db6ac);
}

.progress-overweight {
    background: linear-gradient(to right, #ff9800, #ffb74d);
}

.progress-obese {
    background: linear-gradient(to right, #e74c3c, #ec7063);
}

.metric-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 15px 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f4;
}

.metric-value {
    font-size: 2.5em;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
    color: #26a69a;
}

.metric-label {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.health-tip {
    background: #e0f2f1;
    border-left: 4px solid #26a69a;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
}

.health-tip h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.health-tip p {
    color: #5a6c7d;
    line-height: 1.5;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #26a69a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Body Composition Styles */
.composition-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
    flex-wrap: wrap;
}

.composition-tab-btn {
    padding: 10px 16px;
    border: 2px solid #26a69a;
    background: white;
    color: #26a69a;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    width: auto;
    margin: 0;
}

.composition-tab-btn:hover {
    background: #e0f2f1;
    transform: translateY(-1px);
}

.composition-tab-btn.active {
    background: #26a69a;
    color: white;
    box-shadow: 0 2px 8px rgba(38, 166, 154, 0.3);
}

.composition-form {
    display: none;
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.composition-form.active {
    display: block;
}

.composition-form h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4em;
    font-weight: 500;
}

/* Questionnaire Styles */
.info-section h3 {
    color: #000000;
    margin-bottom: 15px;
    font-size: 1.6em;
    font-weight: bold;
}

.info-section h4 {
    color: #000000;
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: bold;
}

.info-section p {
    color: #333333;
    line-height: 1.6;
    font-weight: normal;
    margin-top: 16px;
    margin-bottom: 16px;
}

.info-section ul {
    margin-top: 16px;
    margin-bottom: 16px;
}

.questionnaire-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 15px;
}

.questionnaire-tab-btn {
    padding: 10px 20px;
    border: 2px solid #26a69a;
    background: white;
    color: #26a69a;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    width: auto;
    margin: 0;
}

.questionnaire-tab-btn:hover {
    background: #e0f2f1;
    transform: translateY(-1px);
}

.questionnaire-tab-btn.active {
    background: #26a69a;
    color: white;
    box-shadow: 0 2px 8px rgba(38, 166, 154, 0.3);
}

.questionnaire-form {
    display: none;
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0f2f1;
}

.questionnaire-form.active {
    display: block;
    animation: fadeIn 0.4s ease-in;
}

.questionnaire-desc {
    background: #e0f2f1;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    color: #004d40;
    border-left: 4px solid #26a69a;
    font-style: italic;
}

.sppb-section, .parq-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e1e8ed;
}

.sppb-section h4, .parq-section h4 {
    color: #26a69a;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
}

.question-group {
    margin-bottom: 25px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid #26a69a;
}

.question-group p {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.5;
}

.radio-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-group-vertical label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.radio-group-vertical label:hover {
    background: #e0f2f1;
    border-color: #26a69a;
}

.radio-group-vertical input[type="radio"] {
    width: auto;
    margin: 0;
    transform: scale(1.1);
    accent-color: #26a69a;
}

.radio-group-vertical label:has(input[type="radio"]:checked) {
    background: #e0f2f1;
    border-color: #26a69a;
    color: #004d40;
    font-weight: 500;
}

.explanation-content h4 {
    color: #26a69a;
    margin: 20px 0 10px 0;
    font-size: 1.1em;
}

.explanation-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.explanation-content li {
    margin-bottom: 5px;
    line-height: 1.4;
}

/* Questionnaire Results */
.questionnaire-result {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid #26a69a;
}

.score-display {
    text-align: center;
    margin: 20px 0;
}

.score-value {
    font-size: 3em;
    font-weight: bold;
    color: #26a69a;
    display: block;
}

.score-label {
    font-size: 1.2em;
    color: #555;
    margin-top: 10px;
}

.risk-level {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
    text-align: center;
    font-size: 1.1em;
}

.risk-low {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.risk-medium {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.risk-high {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.recommendations {
    background: #e0f2f1;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #26a69a;
}

.recommendations h4 {
    color: #004d40;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.recommendations ul {
    margin-left: 20px;
}

.recommendations li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #00695c;
}

@media (max-width: 768px) {
    .questionnaire-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .questionnaire-tab-btn {
        width: 250px;
        text-align: center;
    }
    
    .radio-group-vertical label {
        font-size: 14px;
        padding: 12px;
    }
    
    .question-group {
        padding: 12px;
    }
    
    .sppb-section, .parq-section {
        padding: 15px;
    }
}