/* ============ CSS Variables ============ */
:root {
    --bg-primary: #0b0b1a;
    --bg-secondary: #12122a;
    --bg-card: #181835;
    --bg-input: #0f0f24;
    --border: #2a2a50;
    --border-focus: #4a4a80;
    --text-primary: #e8e8f0;
    --text-secondary: #9090b0;
    --text-muted: #606080;
    --accent-red: #e63946;
    --accent-red-bg: rgba(230, 57, 70, 0.12);
    --accent-yellow: #f4a261;
    --accent-yellow-bg: rgba(244, 162, 97, 0.12);
    --accent-green: #2ec4b6;
    --accent-green-bg: rgba(46, 196, 182, 0.12);
    --accent-blue: #457b9d;
    --accent-gold: #d4a853;
    --accent-gold-light: #f0d78c;
    --gradient-btn: linear-gradient(135deg, #dc2626, #f97316);
    --gradient-btn-hover: linear-gradient(135deg, #b91c1c, #ea580c);
    --gradient-header: linear-gradient(135deg, #e63946, #f4a261);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --radius: 14px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============ Container ============ */
.container { max-width: 1240px; margin: 0 auto; padding: 24px 20px 40px; }

/* ============ Layer 1: Trust Badges ============ */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(46, 196, 182, 0.1);
    border: 1px solid rgba(46, 196, 182, 0.3);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-green);
    letter-spacing: 0.3px;
}
.trust-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--accent-green);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
}

/* ============ Header ============ */
.header { text-align: center; padding: 20px 0 8px; }
.header h1 {
    font-size: 30px;
    font-weight: 800;
    background: var(--gradient-header);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}
.header .subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 6px; letter-spacing: 0.3px; }

.header-cta {
    margin-top: 12px;
    display: inline-block;
}
.header-cta-text {
    display: inline-block;
    padding: 6px 20px;
    background: rgba(230, 57, 70, 0.08);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-red);
    letter-spacing: 0.5px;
}

/* ============ Main Layout ============ */
.main { display: flex; gap: 20px; margin-top: 24px; }

.panel {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}
.panel:hover { border-color: var(--border-focus); }

.panel-title {
    font-size: 15px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.panel-title .icon { font-size: 18px; }

/* ============ Image Upload Zone ============ */
.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius-sm);
    padding: 40px 20px; text-align: center; cursor: pointer;
    transition: all var(--transition); background: var(--bg-input);
    min-height: 220px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent-red); background: var(--accent-red-bg); }
.upload-zone .upload-icon { font-size: 48px; opacity: 0.6; }
.upload-zone .upload-text { font-size: 14px; color: var(--text-secondary); }
.upload-zone .upload-hint { font-size: 12px; color: var(--text-muted); }

.upload-zone.has-image { border-style: solid; border-color: var(--accent-green); background: var(--accent-green-bg); padding: 16px; }

.upload-preview { display: none; width: 100%; }
.upload-preview.show { display: block; }
.upload-preview img { max-width: 100%; max-height: 260px; border-radius: var(--radius-sm); object-fit: contain; display: block; margin: 0 auto; }
.upload-preview .file-name { font-size: 12px; color: var(--text-secondary); text-align: center; margin-top: 8px; word-break: break-all; }

.upload-remove { display: none; margin-top: 10px; font-size: 12px; color: var(--accent-red); cursor: pointer; text-align: center; }
.upload-remove.show { display: block; }
.upload-remove:hover { text-decoration: underline; }

/* ============ Text Input ============ */
.text-input-area { display: flex; flex-direction: column; gap: 8px; }
.text-input-area textarea {
    width: 100%; min-height: 220px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px 16px; color: var(--text-primary); font-size: 14px;
    font-family: inherit; line-height: 1.7; resize: vertical;
    transition: border-color var(--transition); outline: none;
}
.text-input-area textarea:focus { border-color: var(--border-focus); }
.text-input-area textarea::placeholder { color: var(--text-muted); }
.text-input-area .char-count { font-size: 12px; color: var(--text-muted); text-align: right; }

/* ============ Detect Button ============ */
.action-bar { text-align: center; margin-top: 28px; margin-bottom: 8px; }

.btn-detect {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 16px 56px; font-size: 17px; font-weight: 700; color: #fff;
    background: var(--gradient-btn); border: none; border-radius: 50px;
    cursor: pointer; box-shadow: 0 4px 20px rgba(220, 38, 38, 0.35);
    transition: all var(--transition); letter-spacing: 0.5px;
}
.btn-detect:hover { background: var(--gradient-btn-hover); box-shadow: 0 6px 28px rgba(220, 38, 38, 0.5); transform: translateY(-1px); }
.btn-detect:active { transform: translateY(0); }
.btn-detect:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-detect .btn-icon { font-size: 20px; }

/* ============ Progress Bar ============ */
.progress-container { display: none; max-width: 500px; margin: 20px auto 0; }
.progress-container.show { display: block; }
.progress-bar { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--gradient-btn); border-radius: 3px; transition: width 0.5s ease; }
.progress-text { text-align: center; font-size: 13px; color: var(--text-secondary); margin-top: 8px; }

/* ============ Layer 4: Progress Upgrade Nudge ============ */
.progress-upgrade-nudge {
    display: none;
    margin-top: 14px;
    padding: 10px 16px;
    background: rgba(212, 168, 83, 0.08);
    border: 1px solid rgba(212, 168, 83, 0.25);
    border-radius: var(--radius-sm);
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--accent-gold-light);
    animation: nudge-pulse 2s ease-in-out infinite;
}
.progress-upgrade-nudge.show { display: flex; }
.nudge-icon { font-size: 16px; }
.nudge-btn {
    margin-left: auto;
    padding: 5px 14px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: #1a1a35;
    border: none;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition);
    white-space: nowrap;
}
.nudge-btn:hover { transform: scale(1.05); }

@keyframes nudge-pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

/* ============ Results Area ============ */
.results { display: none; margin-top: 32px; }
.results.show { display: block; }

.score-card {
    background: var(--bg-secondary); border-radius: var(--radius);
    padding: 32px 24px; border: 1px solid var(--border);
    text-align: center; margin-bottom: 20px;
}
.score-label { font-size: 14px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.score-value { font-size: 96px; font-weight: 900; line-height: 1; transition: color 0.5s ease; }
.score-value.risk-high { color: var(--accent-red); }
.score-value.risk-medium { color: var(--accent-yellow); }
.score-value.risk-low { color: var(--accent-green); }
.score-verdict { font-size: 16px; font-weight: 600; margin-top: 8px; }
.score-verdict.risk-high { color: var(--accent-red); }
.score-verdict.risk-medium { color: var(--accent-yellow); }
.score-verdict.risk-low { color: var(--accent-green); }

/* ============ Detail Cards ============ */
.detail-section {
    background: var(--bg-secondary); border-radius: var(--radius);
    padding: 24px; border: 1px solid var(--border); margin-bottom: 16px;
}
.detail-section h3 {
    font-size: 16px; font-weight: 700; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
    padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.detail-section h3 .badge {
    font-size: 11px; font-weight: 600; padding: 3px 10px;
    border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-red { background: var(--accent-red-bg); color: var(--accent-red); }
.badge-yellow { background: var(--accent-yellow-bg); color: var(--accent-yellow); }
.badge-green { background: var(--accent-green-bg); color: var(--accent-green); }
.empty-result { color: var(--text-muted); font-size: 14px; padding: 12px 0; text-align: center; }

/* ============ Risk Items ============ */
.risk-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius-sm);
    margin-bottom: 8px; font-size: 14px;
}
.risk-item:last-child { margin-bottom: 0; }
.risk-item.risk-high { background: var(--accent-red-bg); border-left: 3px solid var(--accent-red); }
.risk-item.risk-medium { background: var(--accent-yellow-bg); border-left: 3px solid var(--accent-yellow); }
.risk-item.risk-low { background: var(--accent-green-bg); border-left: 3px solid var(--accent-green); }
.risk-item .risk-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.risk-item.risk-high .risk-icon { color: var(--accent-red); }
.risk-item.risk-medium .risk-icon { color: var(--accent-yellow); }
.risk-item.risk-low .risk-icon { color: var(--accent-green); }
.risk-item .risk-content { flex: 1; }
.risk-item .risk-label { font-weight: 600; margin-bottom: 2px; }
.risk-item .risk-detail { font-size: 12px; color: var(--text-secondary); }

/* ============ Confidence Meter ============ */
.confidence-bar {
    display: inline-block; width: 80px; height: 6px;
    background: var(--border); border-radius: 3px;
    margin-left: 8px; vertical-align: middle; overflow: hidden;
}
.confidence-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.confidence-fill.risk-high { background: var(--accent-red); }
.confidence-fill.risk-medium { background: var(--accent-yellow); }
.confidence-fill.risk-low { background: var(--accent-green); }

/* ============ T07: Pro Overlay ============ */
.pro-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 26, 53, 0.82);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: var(--radius);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: proOverlayIn 0.4s ease;
}
.pro-overlay-inner { text-align: center; }
.pro-overlay-badge {
    display: inline-block;
    padding: 8px 22px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: #1a1a35;
    font-size: 16px;
    font-weight: 800;
    border-radius: 50px;
    letter-spacing: 1px;
    margin-bottom: 12px;
    animation: proPulse 2s ease-in-out infinite;
}
@keyframes proPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 168, 83, 0.4); }
    50% { transform: scale(1.04); box-shadow: 0 0 20px 4px rgba(212, 168, 83, 0.25); }
}
.pro-overlay-date { color: var(--accent-gold-light); font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.pro-overlay-hint { color: var(--text-muted); font-size: 12px; }

@keyframes proOverlayIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ T13: Quick Experience Card Entrance ============ */
.qe-card {
    /* existing flex/shrink/basis kept above; add entrance animation */
    opacity: 0;
    transform: translateY(18px);
    animation: qeCardIn 0.35s ease forwards;
}
/* Stagger: each card appears 80ms after the previous */
.qe-card:nth-child(1) { animation-delay: 0.0s; }
.qe-card:nth-child(2) { animation-delay: 0.08s; }
.qe-card:nth-child(3) { animation-delay: 0.16s; }
/* Total: 0.16 + 0.35 = 0.51s ≤ 0.5s envelope */

@keyframes qeCardIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ============ T12: Random Detect Button ============ */
.qe-random-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid rgba(230, 57, 70, 0.3);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-red);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.qe-random-btn:hover { background: rgba(230, 57, 70, 0.18); transform: scale(1.04); }
.qe-random-btn:active { transform: scale(0.97); }
.qe-random-btn .random-icon { font-size: 15px; }

/* ============ Layer 2: Share Section ============ */
.share-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}
.share-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; }
.share-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.share-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border: 1px solid var(--border);
    border-radius: 50px; background: var(--bg-card);
    color: var(--text-primary); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
}
.share-btn:hover { border-color: var(--border-focus); background: var(--bg-input); transform: translateY(-1px); }
.share-btn-icon { font-size: 16px; }
.share-btn-wechat:hover { border-color: #07c160; color: #07c160; }
.share-btn-weibo:hover { border-color: #e6162d; color: #e6162d; }
.share-btn-copy-link:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.share-hint { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* ============ Action Buttons ============ */
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.btn-action {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 12px 28px; font-size: 14px; font-weight: 600;
    border: 1px solid var(--border); border-radius: 50px;
    cursor: pointer; transition: all var(--transition);
    background: var(--bg-card); color: var(--text-primary);
}
.btn-action:hover { border-color: var(--border-focus); background: var(--bg-input); }
.btn-action.btn-primary { background: var(--gradient-btn); border: none; color: #fff; box-shadow: 0 2px 12px rgba(220, 38, 38, 0.3); }
.btn-action.btn-primary:hover { background: var(--gradient-btn-hover); }

/* ============ Disclaimer ============ */
.disclaimer { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 28px; padding: 12px; }

/* ============ Toast ============ */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border); padding: 12px 24px;
    border-radius: 50px; font-size: 14px; font-weight: 600;
    z-index: 9999; opacity: 0; transition: opacity 0.3s ease;
    pointer-events: none; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; }
/* T11: Char count warning/danger */
.char-count.warning { color: var(--accent-yellow) !important; font-weight: 700; }
.char-count.danger { color: var(--accent-red) !important; font-weight: 700; animation: charFlash 0.6s ease-in-out infinite; }

@keyframes charFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* T10: Error toast variant */
.toast.toast-error { border-color: var(--accent-red); background: var(--accent-red-bg); color: var(--accent-red); }

/* ============ Layer 4: Upgrade Card ============ */
.upgrade-card { display: none; margin-top: 28px; }
.upgrade-card.show { display: block; }

.upgrade-card-inner {
    background: linear-gradient(135deg, #1a1a35 0%, #1f1a2e 50%, #1a1a35 100%);
    border: 2px solid var(--accent-gold); border-radius: var(--radius);
    overflow: hidden; box-shadow: 0 0 30px rgba(212, 168, 83, 0.15);
    position: relative;
}
.upgrade-card-inner::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light), var(--accent-gold));
}

.upgrade-header {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 24px 0; flex-wrap: wrap;
}
.upgrade-badge {
    font-size: 11px; font-weight: 800; padding: 4px 12px;
    border-radius: 4px; background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: #1a1a35; letter-spacing: 1px;
}
.upgrade-title { font-size: 16px; font-weight: 700; color: var(--accent-gold-light); }
.upgrade-timer {
    margin-left: auto; font-size: 12px; color: var(--accent-red);
    font-weight: 600; animation: timer-blink 1s ease-in-out infinite;
}
#timerCount { font-weight: 800; font-size: 14px; }

@keyframes timer-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.upgrade-body { padding: 16px 24px 24px; }

.upgrade-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.upgrade-table th, .upgrade-table td {
    padding: 10px 12px; font-size: 13px; text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.upgrade-table th { font-weight: 700; color: var(--text-primary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.upgrade-table td { color: var(--text-secondary); }
.upgrade-table td:first-child { text-align: left; color: var(--text-primary); font-weight: 600; }
.upgrade-table .col-free { color: var(--text-muted); }
.upgrade-table .col-pro { color: var(--accent-gold-light); }
.upgrade-table strong { color: var(--accent-gold-light); }

.upgrade-cta-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px; background: rgba(212, 168, 83, 0.08);
    border-radius: var(--radius-sm); border: 1px dashed rgba(212, 168, 83, 0.3);
    gap: 16px; flex-wrap: wrap;
}
.upgrade-cta-highlight { font-size: 13px; color: var(--accent-gold-light); }
.upgrade-qr { display: flex; align-items: center; gap: 12px; }
.upgrade-qr img { border-radius: 6px; display: block; }
.upgrade-qr-text { font-size: 13px; color: var(--accent-gold-light); font-weight: 600; line-height: 1.6; }

/* ============ CV Loading ============ */
.cv-loading { display: none; margin-top: 10px; font-size: 13px; color: var(--accent-yellow); align-items: center; justify-content: center; gap: 8px; }
.cv-loading.show { display: flex; }
.cv-loading-dots {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid var(--accent-yellow); border-top-color: transparent;
    border-radius: 50%; animation: cv-spin 0.8s linear infinite;
}
@keyframes cv-spin { to { transform: rotate(360deg); } }

/* ============ Quick Experience ============ */
.quick-experience { margin-top: 20px; padding: 20px 0 8px; }
.qe-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.qe-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.qe-hint { font-size: 12px; color: var(--text-muted); }
.qe-cards {
    display: flex; gap: 16px; overflow-x: auto;
    padding: 4px 0 8px; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.qe-cards::-webkit-scrollbar { display: none; }

.qe-card {
    flex: 0 0 260px; background: var(--bg-card);
    border: 2px solid var(--border); border-radius: var(--radius);
    overflow: hidden; cursor: pointer; transition: all 0.25s ease;
    scroll-snap-align: start; position: relative;
}
.qe-card:hover { border-color: var(--accent-red); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(230, 57, 70, 0.25); }
.qe-card:active { transform: scale(0.97); }
.qe-card.qe-active { border-color: var(--accent-red); box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.4); }

.qe-card-img { width: 100%; height: 140px; overflow: hidden; background: var(--bg-input); }
.qe-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.qe-card-badge {
    position: absolute; top: 10px; right: 10px;
    font-size: 11px; font-weight: 700; padding: 4px 10px;
    border-radius: 20px; letter-spacing: 0.5px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.qe-card-badge.badge-red { background: rgba(230, 57, 70, 0.9); color: #fff; }
.qe-card-badge.badge-green { background: rgba(46, 196, 182, 0.9); color: #fff; }
.qe-card-badge.badge-yellow { background: rgba(244, 162, 97, 0.9); color: #fff; }

.qe-card-label { padding: 10px 14px 4px; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.qe-card-try { padding: 2px 14px 12px; font-size: 13px; font-weight: 600; color: var(--accent-red); }

/* ============ SEO Section ============ */
.seo-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.seo-heading { font-size: 22px; font-weight: 800; color: var(--text-primary); text-align: center; margin-bottom: 24px; letter-spacing: -0.3px; }
.seo-divider { height: 1px; background: var(--border); margin: 40px 0; }

/* ============ Layer 3: Inspired / Use Cases ============ */
.inspired-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.inspired-card {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px 18px; text-align: center;
    transition: border-color var(--transition), transform var(--transition);
}
.inspired-card:hover { border-color: var(--border-focus); transform: translateY(-2px); }
.inspired-icon { font-size: 32px; margin-bottom: 10px; }
.inspired-card h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.inspired-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.7; }

/* ============ Key Features ============ */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px 22px; text-align: center;
    transition: border-color var(--transition), transform var(--transition);
}
.feature-card:hover { border-color: var(--border-focus); transform: translateY(-2px); }
.feature-icon { font-size: 36px; margin-bottom: 12px; }
.feature-card h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ============ FAQ Accordion ============ */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden;
    transition: border-color var(--transition);
}
.faq-item:hover { border-color: var(--border-focus); }
.faq-question {
    font-size: 15px; font-weight: 700; color: var(--text-primary);
    padding: 16px 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    user-select: none; transition: color var(--transition);
}
.faq-question:hover { color: var(--accent-yellow); }
.faq-question::after {
    content: '+'; font-size: 20px; font-weight: 300;
    color: var(--text-muted); transition: transform 0.25s ease;
}
.faq-item.open .faq-question::after { content: '\2212'; transform: rotate(180deg); }
.faq-answer {
    font-size: 14px; color: var(--text-secondary); line-height: 1.8;
    padding: 0 18px; max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}
.faq-item.open .faq-answer { max-height: 300px; padding: 0 18px 16px; }

/* ============ Trusted ============ */
.trusted-card {
    background: rgba(230, 57, 70, 0.08); border: 1px solid rgba(230, 57, 70, 0.25);
    border-radius: var(--radius); padding: 20px 22px;
    display: flex; gap: 16px; align-items: flex-start; margin-bottom: 28px;
}
.trusted-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.trusted-title { font-size: 15px; font-weight: 700; color: var(--accent-red); margin-bottom: 6px; }
.trusted-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

.trusted-stats { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-number {
    font-size: 32px; font-weight: 900;
    background: var(--gradient-header);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; color: transparent;
}
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ============ Layer 3: User Reviews ============ */
.reviews-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.review-card {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 20px;
    transition: border-color var(--transition);
}
.review-card:hover { border-color: var(--border-focus); }
.review-stars { color: var(--accent-yellow); font-size: 16px; margin-bottom: 10px; letter-spacing: 2px; }
.review-text { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 10px; font-style: italic; }
.review-author { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ============ Layer 5: Product Matrix ============ */
.matrix-grid { display: flex; flex-direction: column; gap: 12px; }
.matrix-card {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 22px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: var(--radius);
    text-decoration: none; color: inherit;
    transition: all var(--transition);
}
.matrix-card:hover { border-color: var(--accent-blue); transform: translateX(4px); background: rgba(69, 123, 157, 0.06); }
.matrix-icon { font-size: 28px; flex-shrink: 0; }
.matrix-info { flex: 1; }
.matrix-name { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.matrix-desc { font-size: 12px; color: var(--text-secondary); }
.matrix-arrow { font-size: 18px; color: var(--text-muted); transition: color var(--transition); }
.matrix-card:hover .matrix-arrow { color: var(--accent-blue); }

/* ============ Footer ============ */
.footer {
    margin-top: 48px; padding: 24px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 12px; }
.footer-links a { font-size: 13px; color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.footer-links a:hover { color: var(--text-primary); }
.footer-copy { font-size: 12px; color: var(--text-muted); }

/* ============ Layer 2: Floating Share Button ============ */
.floating-share {
    position: fixed; bottom: 80px; right: 24px;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--gradient-btn); border: none;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
    cursor: pointer; z-index: 999;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    opacity: 0; pointer-events: none;
    animation: float-in 0.5s ease forwards;
    animation-delay: 3s;
}
.floating-share.show { opacity: 1; pointer-events: auto; }
.floating-share:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(220, 38, 38, 0.5); }
.floating-share span { font-size: 22px; }

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

/* ============ T01: OpenCV Degradation Warning ============ */
.upload-disabled { pointer-events: none; opacity: 0.5; }

.cv-degradation-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(244, 162, 97, 0.15);
    border: 1px solid rgba(244, 162, 97, 0.4);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--accent-yellow);
    flex-wrap: wrap;
}
.cv-degradation-warning span { flex: 1; min-width: 200px; }

.cv-retry-btn {
    padding: 6px 18px;
    background: var(--accent-yellow);
    color: #1a1a35;
    border: none;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity var(--transition);
}
.cv-retry-btn:hover { opacity: 0.85; }
.cv-retry-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ T04: Compression Hint ============ */
.compression-hint {
    display: none;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .container { width: 100%; padding: 16px; }
    .header h1 { font-size: 24px; }
    .trust-badges { gap: 8px; }
    .trust-badge { padding: 5px 12px; font-size: 12px; }
    .main { flex-direction: column; gap: 16px; }
    .panel { width: 100%; padding: 18px; }
    .upload-zone { min-height: 180px; padding: 30px 16px; }
    .text-input-area textarea { min-height: 160px; }
    .btn-detect { padding: 14px 40px; font-size: 16px; width: 100%; justify-content: center; }
    .score-value { font-size: 72px; }
    .result-actions { flex-direction: column; }
    .btn-action { width: 100%; justify-content: center; }
    /* T02: Example cards vertical stacking */
    .qe-cards { flex-direction: column; gap: 12px; }
    .qe-card { flex: 1 1 auto; width: 100%; }
    .qe-card-img { height: 160px; }
    /* T02: Report cards full width */
    .detail-section { width: 100%; }
    .inspired-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: 1fr; gap: 12px; }
    .reviews-grid { grid-template-columns: 1fr; }
    .trusted-stats { gap: 24px; }
    .stat-number { font-size: 26px; }
    /* T02: Upgrade card full width, comparison table vertical stack */
    .upgrade-card { width: 100%; }
    .upgrade-table, .upgrade-table thead, .upgrade-table tbody, .upgrade-table th, .upgrade-table td, .upgrade-table tr { display: block; }
    .upgrade-table thead tr { position: absolute; top: -9999px; left: -9999px; }
    .upgrade-table tr { border-bottom: 1px solid rgba(255,255,255,0.08); padding: 8px 0; }
    .upgrade-table td { border: none; padding: 4px 12px; text-align: right; font-size: 12px; }
    .upgrade-table td:first-child { text-align: left; padding-top: 8px; }
    .upgrade-table td::before { content: attr(data-label); float: left; font-weight: 700; color: var(--text-primary); text-transform: uppercase; letter-spacing: 0.5px; font-size: 11px; }
    .upgrade-cta-row { flex-direction: column; text-align: center; }
    .upgrade-qr { flex-direction: column; }
    .seo-heading { font-size: 19px; }
    .progress-upgrade-nudge { flex-wrap: wrap; }
    .floating-share { bottom: 20px; right: 16px; width: 46px; height: 46px; }
    .cv-degradation-warning { flex-direction: column; align-items: flex-start; }
    .cv-degradation-warning span { min-width: auto; }
    .cv-retry-btn { align-self: flex-end; }
}

@media (max-width: 480px) {
    .header h1 { font-size: 21px; }
    .panel { padding: 14px; }
    .score-value { font-size: 56px; }
    .detail-section { padding: 16px; }
    .qe-card { flex: 0 0 180px; }
    .qe-card-img { height: 100px; }
    .qe-card-label { font-size: 13px; }
    .qe-card-try { font-size: 12px; }
    .qe-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    .qe-title { font-size: 14px; }
    .inspired-grid { grid-template-columns: 1fr; }
    .share-buttons { flex-direction: column; }
    .share-btn { width: 100%; justify-content: center; }
    /* T02: Touch target minimum 44x44px */
    button, .btn-detect, .btn-action, .share-btn, .qe-card, .faq-question, .trust-badge,
    .cv-retry-btn, .nudge-btn, .upload-zone, .floating-share, .matrix-card {
        min-height: 44px;
        min-width: 44px;
    }
    /* T02: Prevent iOS Safari auto-zoom */
    .btn-detect, .btn-action, .share-btn, button { font-size: 16px; }
    .text-input-area textarea { font-size: 16px; }
    /* T02: Fix iOS Safari 100vh */
    body { min-height: 100dvh; }
    /* T02: Image preview max-width */
    .upload-preview img { max-width: 100%; }
}
