/* ============================================================
   標準化拍攝引導 + 前後對比 樣式
   ============================================================ */

/* ── 拍攝引導 ── */
.capture-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}
.capture-container video {
    width: 100%;
    border-radius: 12px;
    transform: scaleX(-1);
}
.capture-container canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    border-radius: 12px;
}
.capture-status-panel {
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 13px;
}
.capture-check {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}
.capture-check.pass { color: #16a34a; }
.capture-check.fail { color: #dc2626; }
.check-hint { font-size: 12px; color: #6b7280; }
.capture-ready {
    text-align: center;
    padding: 8px;
    margin-top: 8px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 8px;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}
.capture-progress {
    text-align: center;
    padding: 6px;
    margin-top: 8px;
    color: #f97316;
    font-size: 12px;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.capture-btn {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.capture-btn.primary {
    background: #f97316;
    color: white;
}
.capture-btn.primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}
.capture-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}
.capture-btn.secondary:hover {
    background: #e5e7eb;
}

/* ── 前後對比模式選擇 ── */
.compare-mode-selector {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}
.compare-mode-btn {
    flex: 1;
    padding: 14px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.compare-mode-btn.active {
    border-color: #f97316;
    background: #fff7ed;
}
.compare-mode-btn .mode-icon { font-size: 24px; }
.compare-mode-btn .mode-title { font-size: 14px; font-weight: 600; margin-top: 4px; }
.compare-mode-btn .mode-desc { font-size: 11px; color: #6b7280; margin-top: 2px; }

/* ── 基準照狀態 ── */
.baseline-status {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}
.baseline-status.has-baseline {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.baseline-status.no-baseline {
    background: #fefce8;
    border: 1px solid #fef08a;
}
.baseline-info { font-size: 13px; color: #374151; }
.baseline-time { font-size: 11px; color: #6b7280; margin-top: 4px; }

/* ── 對比結果 ── */
.compare-summary {
    padding: 16px;
    border-radius: 12px;
    border: 2px solid;
    text-align: center;
    margin-bottom: 16px;
}
.compare-verdict { font-size: 20px; font-weight: 700; }
.compare-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
}
.stat-improved { color: #16a34a; }
.stat-worsened { color: #dc2626; }
.stat-unchanged { color: #6b7280; }
.compare-score-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 15px;
}
.score-before { font-weight: 700; color: #6b7280; }
.score-after { font-weight: 700; color: #374151; }
.score-diff { font-weight: 700; font-size: 18px; }
.score-diff.positive { color: #16a34a; }
.score-diff.negative { color: #dc2626; }

.compare-section-title {
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0 8px;
    color: #374151;
}
.compare-metrics { display: flex; flex-direction: column; gap: 8px; }
.compare-metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
}
.metric-label { font-size: 14px; font-weight: 500; }
.metric-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}
.metric-arrow { color: #9ca3af; }
.metric-diff { font-weight: 700; }

.compare-details { display: flex; flex-direction: column; gap: 4px; }
.compare-detail-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
}
.detail-label { flex: 1; color: #6b7280; }
.detail-before, .detail-after { width: 30px; text-align: center; }
.detail-arrow { width: 20px; text-align: center; color: #d1d5db; }
.detail-diff { width: 40px; text-align: right; font-weight: 600; }

.compare-disclaimer {
    margin-top: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.5;
}

/* ── 分區毛孔 ── */
.pore-zone-grid { display: flex; flex-direction: column; gap: 8px; }
.pore-zone-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}
.pore-zone-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pore-zone-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 140px;
    font-size: 13px;
}
.zone-name { font-weight: 500; min-width: 50px; }
.zone-score { color: #374151; }
.zone-size { color: #9ca3af; font-size: 11px; }
.pore-zone-bar {
    flex: 1;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}
.pore-zone-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.pore-zone-tip {
    margin-top: 8px;
    padding: 8px;
    background: #fef3c7;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
}

/* ── 微觀膚質 ── */
.micro-texture-grid { display: flex; flex-direction: column; gap: 12px; }
.micro-item { padding: 10px; background: #f9fafb; border-radius: 10px; }
.micro-header { display: flex; align-items: center; gap: 6px; }
.micro-icon { font-size: 16px; }
.micro-label { flex: 1; font-size: 14px; font-weight: 500; }
.micro-score { font-size: 18px; font-weight: 700; }
.micro-bar { height: 4px; background: #e5e7eb; border-radius: 2px; margin: 6px 0; }
.micro-fill { height: 100%; border-radius: 2px; transition: width 0.5s; }
.micro-desc { font-size: 12px; color: #6b7280; }

/* ── 衰老預測 ── */
.aging-speed {
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}
.aging-speed.slow { background: #dcfce7; color: #16a34a; }
.aging-speed.normal { background: #f3f4f6; color: #6b7280; }
.aging-speed.fast { background: #fef3c7; color: #92400e; }
.aging-speed.very_fast { background: #fee2e2; color: #dc2626; }
.aging-legend {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 11px;
    color: #9ca3af;
}
.aging-note { font-style: italic; }


/* ── 真人照片疊加標註 ── */
.photo-overlay-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 12px auto;
    border-radius: 12px;
    overflow: hidden;
}
.overlay-photo {
    width: 100%;
    display: block;
    border-radius: 12px;
}
/* 毛孔標註點 */
.pore-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 3px 8px;
    border-radius: 12px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    pointer-events: none;
    white-space: nowrap;
}
/* 泛紅區域 */
.redness-zone {
    position: absolute;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.5);
    pointer-events: none;
}
.redness-zone.left-cheek,
.redness-zone.right-cheek {
    width: 22%;
    height: 18%;
}
.redness-zone.nose-area {
    width: 14%;
    height: 12%;
}
