/* ===========================
   话术纠错 - 应用样式
   =========================== */

.app-container {
    min-height: 100vh;
    background: var(--gradient-hero);
    padding: 90px 0 0;
    display: flex;
    flex-direction: column;
}

/* --- 控制栏 --- */
.app-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(11,17,32,0.8);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
}

.app-timer {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    min-width: 120px;
}

.app-timer.active {
    background: var(--gradient-brand-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* --- 按钮 --- */
.app-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    white-space: nowrap;
    font-family: inherit;
}

.app-btn-primary {
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,140,66,0.3);
}
.app-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255,140,66,0.45);
}

.app-btn-secondary {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
}
.app-btn-secondary:hover {
    background: rgba(255,255,255,0.14);
}

.app-btn-warning {
    background: #FFD000;
    color: #1A1A2E;
}
.app-btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,208,0,0.3);
}

.app-btn-danger {
    background: linear-gradient(135deg, #E74C3C, #FF6B6B);
    color: #fff;
    box-shadow: 0 4px 16px rgba(231,76,60,0.3);
}
.app-btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(231,76,60,0.45);
}

.app-btn-accent {
    background: linear-gradient(135deg, #9B59B6, #B56FFF);
    color: #fff;
    box-shadow: 0 4px 16px rgba(155,89,182,0.3);
}
.app-btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(155,89,182,0.45);
}

.app-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.app-btn-icon:hover {
    background: rgba(255,255,255,0.14);
}

/* --- 统计栏 --- */
.app-stats-bar {
    display: flex;
    gap: 0;
    padding: 12px 24px;
    background: rgba(11,17,32,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
}

.app-stat {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    min-width: 80px;
    position: relative;
}

.app-stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 1px; height: 32px;
    background: rgba(255,255,255,0.06);
}

.app-stat-num {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.app-stat-label {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

/* --- 主内容区 --- */
.app-main {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 0;
    flex: 1;
    min-height: 0;
}

/* --- 面板头 --- */
.app-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.app-panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}

.app-legend {
    display: flex;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

.legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* --- 字幕区 --- */
.app-subtitle-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}

.app-subtitle-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

.app-subtitle-scroll::-webkit-scrollbar {
    width: 6px;
}
.app-subtitle-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.app-subtitle-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.app-subtitle-container {
    color: rgba(255,255,255,0.85);
    font-size: 17px;
    line-height: 2;
    min-height: 100%;
}

.subtitle-line {
    padding: 4px 0;
    transition: opacity 0.3s ease;
}

.subtitle-line.old {
    opacity: 0.35;
}

.subtitle-line.interim-line {
    opacity: 0.5;
    font-style: italic;
}

.subtitle-line.hint {
    color: rgba(255,255,255,0.3);
    text-align: center;
    padding: 60px 0;
    font-size: 16px;
}

/* 高亮样式 */
.subtitle-line .vague,
.feedback-item .vague {
    background: rgba(69,160,32,0.15);
    border-bottom: 2px solid #45A020;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

.subtitle-line .filler,
.feedback-item .filler {
    background: rgba(255,208,0,0.15);
    border-bottom: 2px solid #FFD000;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

.subtitle-line .hedge,
.feedback-item .hedge {
    background: rgba(229,0,126,0.15);
    border-bottom: 2px solid #E5007E;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* --- 反馈区 --- */
.app-feedback-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(11,17,32,0.4);
}

.app-feedback-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-feedback-content::-webkit-scrollbar {
    width: 6px;
}
.app-feedback-content::-webkit-scrollbar-track {
    background: transparent;
}
.app-feedback-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.feedback-item {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    animation: slideIn 0.3s ease;
    border-left: 3px solid transparent;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.75);
}

.feedback-item.type-vague {
    border-left-color: #45A020;
    background: rgba(69,160,32,0.06);
}
.feedback-item.type-filler {
    border-left-color: #FFD000;
    background: rgba(255,208,0,0.06);
}
.feedback-item.type-hedge {
    border-left-color: #E5007E;
    background: rgba(229,0,126,0.06);
}
.feedback-item.type-good {
    border-left-color: #4F6BFF;
    background: rgba(79,107,255,0.06);
    color: rgba(255,255,255,0.9);
}
.feedback-item.type-ai {
    border-left-color: var(--color-primary);
    background: rgba(255,140,66,0.06);
    color: rgba(255,255,255,0.9);
}

.feedback-item.hint {
    border-left-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.3);
    text-align: center;
    padding: 40px 14px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 弹窗 --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-card-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.modal-close {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--color-bg-soft);
    font-size: 22px;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover {
    background: #fee;
    color: #e74c3c;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* --- 设置表单 --- */
.settings-group {
    margin-bottom: 20px;
}

.settings-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.settings-group input,
.settings-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: var(--color-bg-soft);
    color: var(--color-text);
    transition: var(--transition);
}

.settings-group input:focus,
.settings-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255,140,66,0.1);
}

.settings-note {
    padding: 16px;
    background: var(--color-bg-soft);
    border-radius: 10px;
    margin-bottom: 20px;
}

.settings-note p {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 4px;
}

.settings-group.hidden {
    display: none;
}

/* --- 报告样式 --- */
#report-body {
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.8;
}

#report-body h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-text);
}

#report-body h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 20px 0 8px;
    color: var(--color-text);
}

#report-body strong {
    font-weight: 700;
    color: var(--color-text);
}

#report-body code {
    background: var(--color-bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--color-primary);
}

#report-body blockquote {
    border-left: 3px solid var(--color-primary);
    padding: 8px 16px;
    margin: 8px 0;
    background: var(--color-bg-soft);
    border-radius: 0 8px 8px 0;
    color: var(--color-text-muted);
}

#report-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

#report-body th,
#report-body td {
    border: 1px solid var(--color-border);
    padding: 8px 12px;
    text-align: left;
    font-size: 14px;
}

#report-body th {
    background: var(--color-bg-soft);
    font-weight: 700;
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(11,17,32,0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    pointer-events: none;
    white-space: nowrap;
}

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

.toast.success {
    border-left: 3px solid #2ECC71;
}

.toast.error {
    border-left: 3px solid #E74C3C;
}

/* --- 工具类 --- */
.hidden {
    display: none !important;
}

/* --- 响应式 --- */
@media (max-width: 1024px) {
    .app-main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .app-subtitle-panel {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        min-height: 300px;
    }

    .app-feedback-panel {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .app-control-bar {
        padding: 12px 16px;
    }

    .app-timer {
        font-size: 24px;
        min-width: 80px;
    }

    .app-btn {
        padding: 8px 14px;
        font-size: 14px;
    }

    .app-stats-bar {
        padding: 8px 12px;
        gap: 4px;
    }

    .app-stat {
        padding: 6px 8px;
        min-width: 64px;
    }

    .app-stat-num {
        font-size: 18px;
    }

    .app-stat-label {
        font-size: 11px;
    }

    .app-panel-header {
        padding: 10px 16px;
    }

    .app-legend {
        gap: 8px;
    }

    .app-subtitle-scroll {
        padding: 16px;
    }

    .app-subtitle-container {
        font-size: 15px;
    }

    .app-feedback-content {
        padding: 12px;
    }

    .feedback-item {
        font-size: 13px;
        padding: 8px 12px;
    }
}
