:root {
    --bg: #0b0f17;
    --surface: #141b29;
    --surface-light: #1e2738;
    --border: #2d3a52;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #c9a227;
    --accent-hover: #d4b43a;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: radial-gradient(circle at top left, #141b29 0%, #0b0f17 60%);
    color: var(--text);
    line-height: 1.6;
}

.app {
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 1rem;
}

.header {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #c9a227, #8b6c18);
    border-radius: 50%;
    color: #0b0f17;
}

.logo-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text);
}

.btn svg {
    width: 1rem;
    height: 1rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--surface-light);
    border-color: var(--accent);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #8b6c18);
    color: #0b0f17;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #a17f1c);
}

.btn-danger {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.25);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.main {
    flex: 1;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.intro-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.intro-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #8b6c18);
}

.case-badge {
    display: inline-block;
    background: rgba(201, 162, 39, 0.15);
    color: var(--accent);
    border: 1px solid rgba(201, 162, 39, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.case-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.case-summary {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.case-meta span {
    background: var(--surface-light);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text);
}

.clues-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.clues-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.clues-list li {
    background: var(--surface-light);
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 3px solid var(--accent);
}

.section-header {
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.2rem;
    color: var(--accent);
}

.section-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.suspects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.suspect-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.suspect-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.suspect-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.3);
}

.suspect-avatar-small {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #334155, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.suspect-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.suspect-occupation {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.suspect-relation {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.suspect-actions {
    display: flex;
    gap: 0.5rem;
}

.suspect-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 0.45rem 0;
    font-size: 0.8rem;
}

.interrogation-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    height: 420px;
    box-shadow: var(--shadow);
}

.interrogation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.suspect-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b6c18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0b0f17;
    font-size: 1.25rem;
}

.interrogation-header h3 {
    font-size: 1.1rem;
}

.interrogation-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.accuse-btn {
    margin-left: auto;
}

.voice-call-btn {
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.voice-call-btn.active {
    border-color: var(--success);
    color: var(--success);
}

.voice-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.2s ease;
}

.voice-call-btn.active .voice-indicator {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.mic-btn {
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--surface-light);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.mic-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mic-btn:not(:disabled):hover {
    color: var(--accent);
    border-color: var(--accent);
}

.mic-btn.recording {
    background: rgba(220, 38, 38, 0.2);
    color: var(--danger);
    border-color: var(--danger);
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.mic-btn svg {
    width: 1.2rem;
    height: 1.2rem;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.empty-chat {
    margin: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: var(--surface-light);
}

.message.user .message-avatar {
    background: var(--accent);
    color: #0b0f17;
}

.message-content {
    background: var(--surface-light);
    padding: 0.7rem 1rem;
    border-radius: 12px;
    border-top-left-radius: 4px;
    max-width: 80%;
    font-size: 0.9rem;
}

.message.user {
    flex-direction: row-reverse;
}

.message.user .message-content {
    background: rgba(201, 162, 39, 0.15);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 12px;
    border-top-right-radius: 4px;
}

.input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.input-area textarea {
    flex: 1;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    color: var(--text);
    font-size: 0.95rem;
    resize: none;
    outline: none;
    max-height: 120px;
}

.input-area textarea:focus {
    border-color: var(--accent);
}

.send-btn, .stop-btn {
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.send-btn {
    background: var(--accent);
    color: #0b0f17;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stop-btn {
    background: var(--danger);
    color: #fff;
}

.send-btn svg, .stop-btn svg {
    width: 1.2rem;
    height: 1.2rem;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.2s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.result-detail {
    background: var(--surface-light);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9rem;
    line-height: 1.8;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: var(--text);
    font-size: 0.95rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    z-index: 200;
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 15, 23, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 150;
    gap: 1rem;
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .suspects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .interrogation-header h3 {
        font-size: 1rem;
    }

    .accuse-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}
