/* 掌纹密码 - 红黑白数据看板美学 */
:root {
    --bg-main: #0a0a0a;
    --bg-card: #141414;
    --bg-elevated: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-red: #dc2626;
    --accent-red-hover: #b91c1c;
    --border-color: #27272a;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }

body { background: var(--bg-main); color: var(--text-primary); -webkit-font-smoothing: antialiased; }

.xxd-app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; overflow-x: hidden; }

.xxd-screen { display: none; padding: 24px 20px; min-height: 100vh; animation: fadeIn 0.3s ease; }
.xxd-screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Header */
.xxd-header { display: flex; align-items: center; margin-bottom: 30px; }
.xxd-back-btn { color: var(--text-secondary); text-decoration: none; font-size: 14px; position: absolute; }
.xxd-header h2 { flex: 1; text-align: center; font-size: 18px; font-weight: 600; letter-spacing: 1px; }

/* Upload Area */
.xxd-upload-area {
    background: var(--bg-card); border: 1px dashed var(--border-color);
    border-radius: 16px; height: 280px; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; margin-bottom: 30px; cursor: pointer;
}
.xxd-upload-placeholder { text-align: center; pointer-events: none; }
.xxd-icon { font-size: 40px; margin-bottom: 12px; display: block; }
.xxd-upload-placeholder p { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.xxd-subtext { font-size: 12px; color: var(--text-secondary); }
#preview-image { width: 100%; height: 100%; object-fit: cover; position: absolute; z-index: 1; opacity: 0.6; }
.xxd-scan-line {
    position: absolute; width: 100%; height: 2px; background: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red); z-index: 2; top: 0; display: none;
    animation: scan 2s linear infinite;
}
@keyframes scan { 0% { top: 0; } 50% { top: 100%; } 100% { top: 0; } }

/* Question Area */
.xxd-question-area h3 { font-size: 16px; margin-bottom: 16px; font-weight: 600; }
.xxd-quick-questions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.xxd-q-btn {
    background: var(--bg-card); border: 1px solid var(--border-color);
    color: var(--text-secondary); padding: 8px 16px; border-radius: 20px;
    font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.xxd-q-btn.selected { background: rgba(220, 38, 38, 0.1); border-color: var(--accent-red); color: var(--accent-red); }
.xxd-input-group input {
    width: 100%; background: var(--bg-card); border: 1px solid var(--border-color);
    padding: 16px; border-radius: 12px; color: var(--text-primary); font-size: 15px;
}
.xxd-input-group input:focus { outline: none; border-color: var(--accent-red); }

/* Actions */
.xxd-action-area { margin-top: 40px; text-align: center; }
.xxd-main-btn {
    width: 100%; padding: 16px; background: var(--text-primary); color: var(--bg-main);
    border: none; border-radius: 12px; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: 0.2s;
}
.xxd-main-btn:disabled { background: var(--border-color); color: var(--text-secondary); cursor: not-allowed; }
.xxd-btn-red { background: var(--accent-red); color: white; }
.xxd-outline-btn {
    width: 100%; padding: 16px; background: transparent; border: 1px solid var(--border-color);
    color: var(--text-primary); border-radius: 12px; font-size: 16px; font-weight: 600;
    cursor: pointer; margin-top: 16px;
}
.xxd-quota-tip { font-size: 12px; color: var(--text-secondary); margin-top: 12px; }
.xxd-quota-tip span.highlight { color: var(--accent-red); }

/* Loading Screen */
.xxd-loading-container {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 80vh; text-align: center;
}
.xxd-loading-spinner {
    width: 50px; height: 50px; border: 3px solid var(--border-color);
    border-top-color: var(--accent-red); border-radius: 50%;
    animation: spin 1s linear infinite; margin-bottom: 30px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.xxd-loading-container h3 { font-size: 18px; margin-bottom: 12px; letter-spacing: 2px; }
.xxd-loading-container p { color: var(--text-secondary); font-size: 14px; margin-bottom: 30px; font-family: monospace; }
.xxd-loading-progress { width: 80%; height: 2px; background: var(--border-color); overflow: hidden; }
.xxd-progress-bar { width: 0%; height: 100%; background: var(--accent-red); transition: width 0.3s; }

/* Report Screen (Data Dashboard Aesthetic) */
.xxd-report-container { background: var(--bg-main); padding-bottom: 40px; }
.xxd-report-header { margin-bottom: 30px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.xxd-r-tag { color: var(--accent-red); font-size: 10px; font-family: monospace; letter-spacing: 2px; margin-bottom: 12px; }
.xxd-r-question { font-size: 24px; font-weight: 700; line-height: 1.4; }

.xxd-report-conclusion {
    background: var(--bg-card); padding: 24px; border-radius: 12px;
    border-left: 4px solid var(--accent-red); margin-bottom: 30px;
}
.xxd-report-conclusion h3 { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.xxd-r-conclusion-text { font-size: 20px; font-weight: 600; line-height: 1.5; margin-bottom: 12px; }
.xxd-r-conclusion-text .highlight { color: var(--accent-red); }
.xxd-r-reason-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.xxd-evidence-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 20px; display: flex; justify-content: space-between; }
.xxd-e-count { color: var(--accent-red); font-family: monospace; }
.xxd-evidences-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 40px; }
.xxd-evidence-card {
    background: var(--bg-card); border: 1px solid var(--border-color); padding: 20px; border-radius: 12px;
}
.xxd-e-header { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 12px; color: var(--text-secondary); font-family: monospace; }
.xxd-e-location { color: var(--text-primary); border: 1px solid var(--border-color); padding: 2px 8px; border-radius: 4px; }
.xxd-e-feature { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--accent-red); }
.xxd-e-meaning { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.xxd-action-guide h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.xxd-advice-list { list-style: none; }
.xxd-advice-list li {
    font-size: 14px; line-height: 1.6; color: var(--text-secondary);
    padding-left: 20px; position: relative; margin-bottom: 12px;
}
.xxd-advice-list li::before { content: "›"; position: absolute; left: 0; color: var(--accent-red); font-weight: bold; }

.xxd-report-actions { margin-top: 30px; }
