/* ============================================================
   AI 智能话术检核 — 独立 Demo 页面
   全新设计：渐变光晕 + 毛玻璃卡片 + 微交互
   不依赖任何外部样式
   ============================================================ */

:root {
    --bg:       #0b0f1a;
    --bg2:      #111827;
    --surface:  #1a2035;
    --surface2: #1f2842;
    --border:   #2a3352;
    --border2:  #364063;
    --text:     #e8ecf4;
    --text2:    #8b95b2;
    --accent:   #7c5cfc;
    --accent2:  #a78bfa;
    --cyan:     #22d3ee;
    --green:    #34d399;
    --orange:   #fb923c;
    --red:      #f87171;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== Background glow ===== */
body::before {
    content: '';
    position: fixed;
    top: -200px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124,92,252,0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    bottom: -200px;
    left: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(34,211,238,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ===== Back bar ===== */
.back-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 10px 16px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    color: #fff; font-size: 14px; font-weight: 500;
    text-decoration: none; padding: 6px 14px;
    background: rgba(255,255,255,0.15); border-radius: 6px;
    transition: background 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.3); }
.back-btn svg { flex-shrink: 0; }

/* ===== App ===== */
.app {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 20px 60px;
    position: relative;
    z-index: 1;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 32px 0 40px;
}
.hero-icon {
    width: 64px; height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff;
    box-shadow: 0 8px 32px rgba(124,92,252,0.3), 0 0 0 1px rgba(124,92,252,0.2);
    position: relative;
}
.hero-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    z-index: -1;
    opacity: 0.3;
    filter: blur(8px);
}
.hero h1 {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 30%, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}
.hero p {
    font-size: 15px;
    color: var(--text2);
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto;
}
.hero-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.hero-tag {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(124,92,252,0.1);
    border: 1px solid rgba(124,92,252,0.2);
    color: var(--accent2);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ===== Steps bar ===== */
.steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 24px;
    overflow-x: auto;
}
.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.step-num {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text2);
    transition: all 0.3s;
    flex-shrink: 0;
}
.step-num.done {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}
.step-num.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(124,92,252,0.2);
}
.step-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    transition: all 0.3s;
}
.step-text.done { color: var(--green); }
.step-text.active { color: var(--text); font-weight: 600; }
.step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 12px;
    border-radius: 1px;
    transition: all 0.3s;
    flex-shrink: 0;
}
.step-line.done { background: var(--green); }

/* ===== Scoreboard ===== */
.scoreboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.score-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.score-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 14px 14px 0 0;
}
.score-card:nth-child(1)::before { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.score-card:nth-child(2)::before { background: var(--green); }
.score-card:nth-child(3)::before { background: var(--orange); }
.score-label {
    font-size: 11px;
    color: var(--text2);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.score-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

/* ===== Card ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 20px;
    position: relative;
}
.card-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}
.card-sub {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ===== Scenario cards ===== */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.scenario-card {
    background: var(--surface2);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}
.scenario-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124,92,252,0.05), rgba(34,211,238,0.03));
    opacity: 0;
    transition: opacity 0.25s;
}
.scenario-card:hover { border-color: rgba(124,92,252,0.35); transform: translateY(-2px); }
.scenario-card:hover::before { opacity: 1; }
.scenario-card.selected { border-color: var(--accent); background: rgba(124,92,252,0.06); }
.sc-icon {
    font-size: 26px;
    margin-bottom: 8px;
    position: relative;
}
.scenario-card:nth-child(1) .sc-icon { color: var(--accent2); }
.scenario-card:nth-child(2) .sc-icon { color: var(--cyan); }
.scenario-card:nth-child(3) .sc-icon { color: var(--green); }
.scenario-card:nth-child(4) .sc-icon { color: var(--orange); }
.sc-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    position: relative;
}
.sc-desc {
    font-size: 12px;
    color: var(--text2);
    line-height: 1.5;
    position: relative;
}

/* ===== Question blocks ===== */
.dq-item {
    margin-bottom: 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.dq-header {
    background: linear-gradient(135deg, var(--accent), #6d28d9);
    color: #fff;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dq-header .dq-num {
    background: rgba(255,255,255,0.2);
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.dq-body { padding: 16px; }
.dq-question {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 14px;
    padding: 12px;
    background: rgba(124,92,252,0.06);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}
.dq-standards { font-size: 13px; }
.dq-standards-title {
    font-size: 12px;
    color: var(--orange);
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.dq-dim { margin-bottom: 10px; }
.dq-dim-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 4px;
}
.dq-checklist { list-style: none; padding: 0; }
.dq-checklist li {
    padding: 5px 0 5px 18px;
    position: relative;
    font-size: 13px;
    color: var(--text2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.5;
}
.dq-checklist li::before {
    content: '✓';
    position: absolute;
    left: 0; top: 5px;
    color: var(--accent2);
    font-weight: 700;
    font-size: 11px;
}
.dq-checklist li .dq-ppoint { flex: 1; }
.dq-checklist li .dq-pscore {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent2);
    background: rgba(124,92,252,0.1);
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
    margin-left: 8px;
}

/* Tips */
.dq-tips {
    background: rgba(251,146,60,0.06);
    border: 1px solid rgba(251,146,60,0.15);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 14px;
}
.dq-tips-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--orange);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dq-tips-list { list-style: none; padding: 0; margin: 0; }
.dq-tips-list li {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.8;
    padding: 3px 0 3px 4px;
}

/* ===== Buttons ===== */
.btn-row { display: flex; gap: 12px; margin-top: 20px; }
.btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #6d28d9);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124,92,252,0.25);
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(124,92,252,0.35); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

/* ===== Live text ===== */
.live-text {
    width: 100%;
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--surface2);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 16px;
    transition: border-color 0.3s;
    outline: none;
    cursor: text;
}
.live-text:focus, .live-text.recording { border-color: var(--orange); }
.cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: var(--orange);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    vertical-align: text-bottom;
}
@keyframes blink { 50% { opacity: 0; } }

/* Record */
.record-area { text-align: center; padding: 8px 0; }
.record-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.record-btn {
    width: 56px; height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--orange), #ea580c);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(251,146,60,0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.record-btn:active { transform: scale(0.92); }
.record-btn.recording {
    background: linear-gradient(135deg, var(--red), #dc2626);
    box-shadow: 0 0 0 0 rgba(248,113,113,0.4);
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0.4); }
    50% { box-shadow: 0 0 0 14px rgba(248,113,113,0); }
}
.record-label {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text2);
    font-weight: 500;
    min-height: 20px;
}
.record-label.recording { color: var(--red); font-weight: 600; }
.timer {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
    min-height: 24px;
}
.edit-btn {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.edit-btn:hover { border-color: var(--accent); color: var(--accent2); }

/* ===== AI Status ===== */
.ai-status {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(124,92,252,0.06);
    border: 1px solid rgba(124,92,252,0.15);
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
}
.ai-status.show { display: flex; }
.ai-spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Verdict ===== */
.verdict {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.verdict.good {
    background: rgba(52,211,153,0.06);
    border: 1px solid rgba(52,211,153,0.15);
}
.verdict.ok {
    background: rgba(251,146,60,0.06);
    border: 1px solid rgba(251,146,60,0.15);
}
.v-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.v-text { font-size: 13px; line-height: 1.6; color: var(--text2); }

/* Strengths / Weaknesses */
.comp-item {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
}
.comp-item.good {
    background: rgba(52,211,153,0.05);
    border-left: 3px solid var(--green);
}
.comp-item.bad {
    background: rgba(248,113,113,0.05);
    border-left: 3px solid var(--red);
}
.comp-item .c-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
}
.comp-item.good .c-label { color: var(--green); }
.comp-item.bad .c-label { color: var(--red); }
.comp-item .c-text { font-size: 13px; line-height: 1.6; color: var(--text2); }

/* Suggestions */
.suggestion-item {
    padding: 10px 12px;
    background: rgba(124,92,252,0.05);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.6;
    border-left: 3px solid var(--accent);
    color: var(--text2);
}

/* Criteria detail */
.criteria-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text);
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.criteria-item {
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface2);
    cursor: default;
    transition: box-shadow 0.2s;
}
.criteria-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.criteria-item.full  { border-left: 4px solid var(--green); }
.criteria-item.part  { border-left: 4px solid var(--orange); }
.criteria-item.zero  { border-left: 4px solid var(--red); }

.cd-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
}
.cd-point {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cd-status-icon { font-size: 13px; }
.cd-status-icon.scored    { color: var(--green); }
.cd-status-icon.partial   { color: var(--orange); }
.cd-status-icon.unscored  { color: var(--red); }
.cd-score {
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
    margin-left: 12px;
}
.cd-score.full  { color: var(--green); }
.cd-score.part  { color: var(--orange); }
.cd-score.zero  { color: var(--red); }

.cd-bottom {
    display: none;
    padding: 0 14px 12px;
    background: rgba(0,0,0,0.15);
}
.criteria-item.open .cd-bottom { display: block; }
.cd-reason {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.7;
    padding: 8px 10px;
    background: var(--surface);
    border-radius: 6px;
    border-left: 3px solid var(--border);
}
.cd-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.cd-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease-out;
}
.cd-progress-fill.full  { background: var(--green); }
.cd-progress-fill.part  { background: var(--orange); }
.cd-progress-fill.zero  { background: var(--red); }

/* Fade */
.fade-in { animation: fadeIn 0.4s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Footer */
.footer {
    text-align: center;
    padding: 48px 20px 28px;
    font-size: 12px;
    color: var(--text2);
    line-height: 1.8;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}
.footer a { color: var(--accent2); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 600px) {
    .app { padding: 56px 12px 40px; }
    .hero h1 { font-size: 26px; }
    .hero-icon { width: 56px; height: 56px; font-size: 24px; border-radius: 15px; }
    .scenario-grid { grid-template-columns: 1fr; }
    .scoreboard { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .score-value { font-size: 24px; }
    .card { padding: 20px 16px; }
    .btn-row { flex-direction: column; }
    .steps-bar { padding: 14px 8px; }
    .step-line { width: 28px; margin: 0 8px; }
    .step-text { font-size: 12px; }
}
