body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-align: center; margin: 0; padding: 0; background-color: #f5f5f5; }
.app-header { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 15px 0; background: white; }
.app-icon { width: 45px; height: 45px; border-radius: 10px; object-fit: cover; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.app-header h1 { margin: 0; font-size: 1.6rem; color: #333; }

.tab-nav { display: flex; background: white; border-bottom: 1px solid #ffe082; position: sticky; top: 0; z-index: 1000; }
.tab-btn { flex: 1; padding: 15px; border: none; background: none; font-size: 1rem; font-weight: bold; color: #888; cursor: pointer; }
.tab-btn.active { color: #ff9800; border-bottom: 3px solid #ff9800; }

.container { max-width: 500px; margin: auto; background: white; padding: 20px; display: flex; flex-direction: column; min-height: 80vh; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.step-label { display: inline-block; background: #ff9800; color: white; padding: 2px 10px; border-radius: 5px; font-size: 0.8rem; font-weight: bold; margin-bottom: 10px; text-align: left; float: left; }
.clear { clear: both; }

/* 畫布與按鈕 */
#canvas-container { position: relative; width: 100%; margin-top: 5px; min-height: 250px; border: 2px dashed #ccc; border-radius: 12px; overflow: hidden; background-color: #fafafa; }
canvas { width: 100%; height: auto; display: block; cursor: crosshair; }
.btn-group { display: flex; gap: 10px; justify-content: center; margin-bottom: 15px; }
.btn-action {
    flex: 1;
    padding: 12px 10px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95rem;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-gallery { background: #4CAF50; }
.btn-camera { background: #2196F3; }

.step2-btns { display: flex; gap: 5px; }
.btn-reset, .btn-skip { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; border: 1px solid #ddd; cursor: pointer; }
.btn-reset { background: #f0f0f0; color: #666; }
.btn-skip { background: #fff3e0; color: #e65100; border-color: #ffe0b2; }

.active-step-hint { background: #fff3e0; border: 1.5px solid #ff9800; padding: 10px; border-radius: 10px; margin: 5px 0 10px 0; font-weight: bold; color: #e65100; font-size: 0.9rem; text-align: center; }

.fan-container { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 10px; margin-bottom: 15px; }
.fan-box { aspect-ratio: 1; border-radius: 6px; border: 1px solid #ccc; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: bold; color: white; text-shadow: 1px 1px 2px rgba(0,0,0,0.6); cursor: pointer; }
.fan-box.analyze-highlight { border: 4px solid #FF3D00 !important; transform: scale(1.1); box-shadow: 0 0 10px rgba(255,61,0,0.5); z-index: 5; }
.fan-box.suggest-highlight { 
    border: 4px solid #4CAF50 !important; 
    transform: scale(1.15); /* 稍微放大一點 */
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
    z-index: 10;
    opacity: 1 !important; /* 強制不透明 */
    filter: none !important; /* 強制不灰階 */
}

.integrated-box { padding: 20px; background: #fffde7; border-radius: 15px; border: 1px solid #ffe082; text-align: left; }

/* Step 4 智慧診斷移植樣式 */
.diag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #fff; padding: 12px; border-radius: 10px; border: 1px solid #bbdefb; margin: 10px 0; }
.diag-input { width: 50px; padding: 4px; border: 1px solid #ccc; border-radius: 4px; text-align: center; font-weight: bold; }
.diag-result-bar { display: flex; justify-content: space-around; background: #e3f2fd; padding: 10px; border-radius: 8px; margin-bottom: 15px; text-align: center; border: 1px solid #adcbe3; }

/* 原有 Tab 2 相關樣式 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 0.85rem; background: rgba(255,255,255,0.5); padding: 12px; border-radius: 10px; margin-bottom: 5px; }
.form-grid > div { display: flex; align-items: center; white-space: nowrap; }
.form-grid input, .form-grid select { width: 42px; padding: 4px; border: 1px solid #ccc; border-radius: 4px; margin: 0 2px; }
.detail-box { background: rgba(255,255,255,0.7); padding: 12px; border-radius: 10px; font-size: 0.8rem; margin: 10px 0; border-left: 4px solid #ffb300; }
#detail-content input { width: 45px; padding: 4px; margin-left: 5px; }
.dosage-summary { display: flex; flex-direction: column; gap: 15px; background: #fff; padding: 15px; border-radius: 12px; border: 1px solid #ffe082; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.dosage-input-field { width: 65px; height: 30px; text-align: center; border: 2px solid #ffb300; border-radius: 8px; font-size: 1rem; font-weight: bold; color: #ef6c00; background-color: #fffde7; }
.dosage-val-box { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 80px; }
.dosage-val-box b { font-size: 1.8rem; line-height: 1.2; color: #333; }
.dosage-val-box small { font-size: 0.75rem; color: #888; margin-top: 4px; }
.plus-sign { color: #ccc; font-weight: bold; font-size: 1.5rem; margin: 0 10px; align-self: center; }
#yellow-body, #red-body { display: flex; justify-content: center; align-items: center; min-height: 85px; padding: 5px 0; }
.quick-result-card { background: white; padding: 12px; border-radius: 10px; border: 2px solid #ff9800; margin-top: 10px; display: none; }

/* Tooltip 容器 */
.info-tip {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 4px;
    color: #999;
    vertical-align: middle;
}

/* Tooltip 本體文字 */
.info-tip .tip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 10;
    bottom: 125%; /* 顯示在圖示上方 */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    line-height: 1.4;
    font-weight: normal;
    white-space: normal;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* 小箭頭 */
.info-tip .tip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* 滑鼠移入顯示 */
.info-tip:hover .tip-text {
    visibility: visible;
    opacity: 1;
}

/* 圓形問號圖示樣式 */
.info-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.2px solid #999;
    border-radius: 50%;
    font-size: 10px;
    font-style: normal;
}