/* ============================================
   智能审计访谈助手 v2.0 - 样式表
   优化: 对比度/移动端/动效/专业视觉
   ============================================ */

:root {
    --primary: #3b5bdb;
    --primary-light: #e7ecfc;
    --primary-dark: #2b4acb;
    --success: #0ca678;
    --success-light: #e6f9f0;
    --warning: #e8a317;
    --danger: #e03131;
    --bg: #f0f2f8;
    --bg-card: #ffffff;
    --text: #212529;
    --text-secondary: #495057;
    --text-muted: #868e96;
    --border: #dee2e6;
    --border-light: #f1f3f5;
    --sidebar-width: 180px;
    --header-height: 54px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
}

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

/* 防止 Vue 编译前闪烁 */
[v-cloak] { display: none; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* --- 顶部栏 --- */
.app-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), #5c7cfa);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.header-left h1 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
}

.version-tag { margin-left: 2px; }
.header-actions { display: flex; gap: 8px; }

/* --- 主体布局 --- */
.app-body {
    display: flex;
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

/* --- 侧边栏 --- */
.app-sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 12px 8px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    color: var(--text-secondary);
    user-select: none;
}

.nav-item:hover { background: var(--bg); color: var(--text); }

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-icon { font-size: 18px; width: 22px; text-align: center; }
.nav-divider { height: 1px; background: var(--border-light); margin: 8px 12px; }

/* --- 内容区 --- */
.app-main { flex: 1; overflow-y: auto; }
.page { padding: 24px 32px; max-width: 1200px; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h2 { font-size: 20px; font-weight: 700; }

/* --- 空状态 --- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-icon { font-size: 52px; margin-bottom: 12px; opacity: 0.5; }
.empty-hint { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* --- 访谈卡片 --- */
.interview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.interview-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.interview-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-title { font-size: 15px; font-weight: 600; color: var(--text); }

.card-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.card-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    margin-top: 10px;
}

.card-time { font-size: 12px; color: var(--text-muted); }

/* --- 对话页 --- */
.chat-page {
    padding: 0 !important;
    height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    max-width: none;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    flex-shrink: 0;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-header-left { display: flex; align-items: center; gap: 8px; }
.chat-header-left h3 { font-size: 15px; font-weight: 600; }
.chat-header-right { display: flex; gap: 6px; flex-wrap: wrap; }

/* 进度条迷你 */
.progress-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.progress-mini .progress-bar {
    width: 0;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.5s ease;
    min-width: 60px;
    position: relative;
}

.progress-mini .progress-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 2px;
    z-index: -1;
    width: 60px;
}

.progress-text { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.chat-body { flex: 1; display: flex; overflow: hidden; }

/* 左侧面板 */
.chat-sidebar {
    width: 300px;
    border-right: 1px solid var(--border);
    background: #fff;
    overflow-y: auto;
    padding: 16px;
    flex-shrink: 0;
}

.info-section { margin-bottom: 18px; }

.info-section h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-section p { font-size: 13px; line-height: 1.6; color: var(--text); }

.question-list { display: flex; flex-direction: column; gap: 4px; }

.question-item {
    display: flex;
    gap: 8px;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    transition: all 0.15s;
    cursor: default;
}

.question-item.current {
    background: #fff3e0;
    color: #e65100;
    font-weight: 600;
}

.question-item.covered {
    color: var(--text-muted);
    opacity: 0.5;
}

.q-num {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.q-num.done { background: var(--success-light); color: var(--success); }
.question-item.current .q-num { background: #ffe0b2; color: #e65100; }
.q-text { flex: 1; }

.control-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.control-tag { font-size: 11px !important; }

.coverage-stat {
    margin-top: 8px;
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

/* --- 对话消息 --- */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    min-width: 0;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 40px;
    text-align: center;
}

.chat-empty .empty-icon { font-size: 48px; margin-bottom: 12px; }

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: msgIn 0.25s ease-out;
}

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

.msg-interviewer { align-self: flex-start; }
.msg-interviewee { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.avatar-interviewer { background: #e7ecfc; }
.avatar-interviewee { background: #ffe8cc; }

.msg-content { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.msg-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word;
    white-space: pre-wrap;
}

.msg-interviewer .msg-bubble {
    background: #fff;
    color: var(--text);
    border-top-left-radius: 3px;
    box-shadow: var(--shadow);
}

.msg-interviewee .msg-bubble {
    background: var(--primary);
    color: #fff;
    border-top-right-radius: 3px;
}

.conclude-bubble {
    border: 1px dashed var(--success) !important;
    background: var(--success-light) !important;
    color: var(--text) !important;
}

.msg-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 0 4px;
    flex-wrap: wrap;
}

.msg-time { font-size: 11px; color: var(--text-muted); }
.msg-analysis { font-size: 11px; color: var(--primary); cursor: help; }

.msg-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    line-height: 1.6;
}

.msg-badge.probe { background: #fff3bf; color: #8b6914; }
.msg-badge.deep { background: #ffe3e3; color: #a61e1e; }
.msg-badge.greeting { background: #d3f9d8; color: #2b8a3e; }

/* 打字动画 */
.loading-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 13px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* 输入区 */
.chat-input-area {
    padding: 10px 20px 14px;
    background: #fff;
    border-top: 1px solid var(--border);
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-row .el-textarea { flex: 1; }
.input-row .el-button { height: 40px; flex-shrink: 0; }

/* 监控提示条 */
.monitor-bar {
    padding: 8px 16px;
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
    font-size: 13px;
    color: #8d6e00;
    text-align: center;
    flex-shrink: 0;
}

/* 访谈结束栏 */
.chat-ended-bar {
    padding: 10px 20px;
    background: var(--success-light);
    border-top: 1px solid #b2dfdb;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #2e7d32;
}

/* --- 报告页 --- */
.report-page { max-width: 900px; }

.report-content {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 44px;
    line-height: 1.85;
    font-size: 14px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.report-content h1 {
    font-size: 22px;
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--primary);
    color: var(--text);
}

.report-content h2 {
    font-size: 17px;
    margin: 28px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
    color: var(--primary-dark);
    font-weight: 700;
}

.report-content h3 { font-size: 15px; margin: 18px 0 8px; font-weight: 600; }
.report-content p { margin-bottom: 8px; }
.report-content ul, .report-content ol { padding-left: 24px; margin-bottom: 12px; }
.report-content li { margin-bottom: 4px; }

.report-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 13px;
}

.report-content th, .report-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}

.report-content th { background: var(--bg); font-weight: 600; }

.report-content blockquote {
    border-left: 3px solid var(--primary);
    padding: 8px 16px;
    margin: 12px 0;
    background: var(--primary-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.report-content strong { color: #c92a2a; }

.report-meta {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 14px;
}

.report-meta a { color: var(--primary); text-decoration: none; }
.report-meta a:hover { text-decoration: underline; }

/* --- 设置页 --- */
.settings-page { max-width: 700px; }

.settings-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.settings-card h3 { font-size: 16px; margin-bottom: 4px; font-weight: 700; }
.settings-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.config-form .el-form-item { margin-bottom: 18px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.test-alert { margin-top: 16px; }
.toggle-eye { cursor: pointer; user-select: none; font-size: 16px; }

.quick-configs { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-configs .el-button.active {
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* --- 对话框 --- */
.el-dialog { border-radius: 14px !important; }
.el-dialog__header { padding: 18px 24px 10px !important; }
.el-dialog__body { padding: 6px 24px 18px !important; }

/* --- 滚动条 --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #adb5bd; }

/* --- 响应式 --- */
@media (max-width: 1024px) {
    .chat-sidebar { width: 240px; }
    .chat-header-right .el-button span { display: none; }
}

@media (max-width: 768px) {
    .app-sidebar { width: 56px; padding: 8px 4px; }
    .nav-text { display: none; }
    .nav-item { justify-content: center; padding: 10px; }
    .chat-sidebar { display: none; }
    .page { padding: 14px; }
    .message { max-width: 92%; }
    .report-content { padding: 20px; }
}

/* --- 打印样式（报告导出） --- */
@media print {
    .app-header, .app-sidebar, .chat-header, .page-header,
    .report-meta, .chat-input-area { display: none !important; }
    .app-body, .app-main { margin: 0; height: auto; overflow: visible; }
    .report-content { border: none; box-shadow: none; padding: 0; }
}
