/* ============================================================
   QQ 游戏 AI 频道智能匹配 Demo - 样式
   布局：顶栏 + 主列（输入 / 场景 / 分析+推荐）+ 右侧运营面板
   风格：腾讯系产品感 + 轻科技感（白 / 浅灰 + 蓝色强调）
   ============================================================ */

:root {
    --color-primary: #1677FF;
    --color-primary-dark: #0B5CFF;
    --color-bg: #F5F7FA;
    --color-card: #FFFFFF;
    --color-text: #1F2329;
    --color-text-2: #646A73;
    --color-border: #E5E6EB;
    --color-success: #00B578;
    --color-warning: #FF7D00;
    --radius-card: 12px;
    --radius-btn: 8px;
    --shadow: 0 1px 2px rgba(31, 35, 41, 0.04);
    --transition: 200ms ease;
}

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

body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ==================== 顶部导航 ==================== */
.topbar {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
}
.topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
    width: 32px; height: 32px;
    background: #E8F1FF;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.brand-logo-img {
    width: 30px; height: 30px;
    object-fit: contain;
    background: none;
    border-radius: 6px;
    display: block;
}
.brand-name { font-size: 16px; font-weight: 700; }
.brand-badge {
    font-size: 12px;
    color: var(--color-primary);
    background: rgba(22, 119, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.ai-status {
    font-size: 13px;
    color: var(--color-text-2);
}
.ai-status.llm { color: var(--color-text); font-weight: 500; }

/* ==================== 整体布局 ==================== */
.layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}
.col-main { min-width: 0; }
.col-side { display: flex; flex-direction: column; gap: 16px; }

.page-header { margin-bottom: 16px; }
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--color-text-2); margin-top: 2px; }

/* ==================== 卡片 ==================== */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.side-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.side-link {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: var(--color-primary);
    cursor: pointer;
}
.side-empty {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-2);
    padding: 18px 0;
    line-height: 1.8;
}
.side-empty small { font-size: 12px; color: #9A9EA6; }

/* ==================== 输入卡片 ==================== */
.input-card { padding: 16px 18px 12px; margin-bottom: 12px; }
#userInput {
    width: 100%;
    height: 110px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    resize: none;
    line-height: 1.7;
}
#userInput::placeholder { color: #B5BABF; }
#userInput:focus { outline: none; }
#userInput.input-error { background: #FFF8F0; border-radius: 8px; }

.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #F0F1F3;
    padding-top: 10px;
}
.input-footer-right { display: flex; align-items: center; gap: 14px; }
.char-count { font-size: 12px; color: #9A9EA6; font-variant-numeric: tabular-nums; }
.btn-text {
    border: none;
    background: none;
    font-size: 13px;
    color: var(--color-text-2);
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
}
.btn-text:hover { color: var(--color-primary); }

/* ==================== 热门场景 ==================== */
.scene-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.scene-label { font-size: 13px; color: var(--color-text-2); flex-shrink: 0; }
.examples-list { display: flex; flex-wrap: wrap; gap: 8px; }
.example-chip {
    font-size: 12px;
    color: var(--color-text-2);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all var(--transition);
}
.example-chip:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(22, 119, 255, 0.04);
}

/* ==================== 按钮 ==================== */
.btn {
    height: 40px;
    padding: 0 22px;
    border: none;
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-primary:disabled { background: #9FC2FF; cursor: not-allowed; }
.btn-secondary {
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 10px; }

/* ==================== 分析 + 推荐 双栏 ==================== */
.main-2col {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

/* AI 分析过程：纵向步骤 */
.steps { display: flex; flex-direction: column; gap: 4px; }
.step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 8px;
    transition: background var(--transition);
}
.step-dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    background: #F0F1F3;
    color: #B5BABF;
    flex-shrink: 0;
    transition: all var(--transition);
}
.step-text { font-size: 13px; color: #B5BABF; flex-shrink: 0; transition: color var(--transition); }
.step-value {
    font-size: 12px;
    color: var(--color-text-2);
    margin-left: auto;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.step.active { background: rgba(22, 119, 255, 0.05); }
.step.active .step-dot { background: var(--color-primary); color: #fff; }
.step.active .step-text { color: var(--color-primary); font-weight: 600; }
.step.done .step-dot { background: var(--color-success); color: #fff; }
.step.done .step-text { color: var(--color-text); }

.step-status {
    margin-top: 12px;
    font-size: 12px;
    color: var(--color-text-2);
    background: #F9FAFB;
    border-radius: 8px;
    padding: 8px 12px;
}
.step-status .tag {
    display: inline-block;
    background: rgba(22, 119, 255, 0.08);
    color: var(--color-primary);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    margin: 0 2px;
}

/* AI 用户画像 */
.profile {
    margin-top: 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 14px 16px;
}
.profile-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.profile-engine { font-size: 11px; font-weight: 400; color: var(--color-text-2); margin-left: 6px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-item { display: flex; flex-direction: column; gap: 1px; }
.profile-key { font-size: 11px; color: var(--color-text-2); }
.profile-value { font-size: 13px; font-weight: 600; }
.profile-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.profile-tag {
    font-size: 11px;
    color: var(--color-primary);
    background: rgba(22, 119, 255, 0.08);
    border-radius: 4px;
    padding: 2px 8px;
}

/* ==================== 推荐结果 ==================== */
.top-channel {
    background: #F4F8FF;
    border: 1px solid #E3EEFF;
    border-radius: 10px;
    padding: 16px 18px;
}
.top-channel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.top-channel-badge {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--color-primary);
    border-radius: 4px;
    padding: 3px 10px;
}
.top-channel-score { display: flex; align-items: baseline; gap: 6px; }
.score-label { font-size: 12px; color: var(--color-text-2); }
.score-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.top-channel-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.channel-source { font-size: 11px; font-weight: 400; color: var(--color-text-2); }
.channel-source b { color: var(--color-text); font-weight: 600; }
.top-channel-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.top-channel-tag {
    font-size: 11px;
    color: var(--color-text-2);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 2px 8px;
}
.tag-low { color: var(--color-warning) !important; background: rgba(255, 125, 0, 0.1) !important; border-color: rgba(255,125,0,0.25) !important; }
.top-channel-reason { font-size: 13px; color: var(--color-text-2); line-height: 1.7; }
.reason-label { font-weight: 600; color: var(--color-text); }
.score-bar {
    height: 5px;
    background: #E3EEFF;
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}
.score-fill {
    height: 100%;
    width: 0;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 600ms ease;
}
.score-level-row { margin-top: 8px; font-size: 12px; color: var(--color-text-2); }
.score-level {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    padding: 1px 8px;
}
.score-level.strong { color: var(--color-success); background: rgba(0, 181, 120, 0.1); }
.score-level.normal { color: var(--color-warning); background: rgba(255, 125, 0, 0.1); }

/* 次推荐频道 */
.runner-up {
    margin-top: 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.runner-up-name { font-size: 14px; font-weight: 600; }
.runner-up-tags { font-size: 11px; color: var(--color-text-2); margin-top: 2px; }
.runner-up-right { text-align: right; flex-shrink: 0; }
.runner-up-score { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.runner-up-source { font-size: 11px; color: #9A9EA6; }

/* 更多备选频道 */
.more-channels { margin-top: 8px; }
.more-channels summary {
    font-size: 12px;
    color: var(--color-text-2);
    cursor: pointer;
    text-align: center;
    padding: 6px;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    list-style: none;
}
.more-channels summary:hover { color: var(--color-primary); border-color: var(--color-primary); }
.more-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-2);
    padding: 6px 4px;
    border-bottom: 1px solid #F0F1F3;
}
.more-item b { color: var(--color-text); font-variant-numeric: tabular-nums; }

/* 匹配依据 */
.score-detail {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.score-detail-item {
    font-size: 11px;
    color: var(--color-text-2);
    background: #F9FAFB;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 5px 10px;
    font-variant-numeric: tabular-nums;
}

/* 用户反馈（结果卡片内） */
.feedback-inline {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #F0F1F3;
}
.feedback-question { font-size: 13px; font-weight: 600; }
.feedback-btns { display: flex; gap: 10px; margin-top: 10px; }

.badcase-form {
    margin-top: 4px;
    background: #FFF8F0;
    border: 1px solid rgba(255, 125, 0, 0.25);
    border-radius: 10px;
    padding: 14px 16px;
}
.badcase-title { font-size: 13px; font-weight: 600; color: var(--color-warning); margin-bottom: 8px; }
.badcase-option {
    display: block;
    font-size: 13px;
    padding: 4px 0;
    cursor: pointer;
}
.badcase-option input { margin-right: 8px; accent-color: var(--color-primary); }
.badcase-form .btn { margin-top: 10px; }

.feedback-done {
    font-size: 13px;
    color: var(--color-success);
    background: rgba(0, 181, 120, 0.06);
    border: 1px solid rgba(0, 181, 120, 0.25);
    border-radius: 8px;
    padding: 10px 14px;
}

/* 无结果状态 */
.no-result {
    border: 1px dashed var(--color-border);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
}
.no-result-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.no-result-desc { font-size: 13px; color: var(--color-text-2); margin-bottom: 12px; }
.no-result-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 12px;
    color: var(--color-text-2);
}
.no-result-meta b { color: var(--color-text); }

/* ==================== AI Discovery ==================== */
.discovery-log {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.discovery-log-line {
    font-size: 11px;
    color: var(--color-text-2);
    background: #F9FAFB;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 5px 10px;
}
.discovery-log-line b { color: var(--color-text); }

.engine-notice {
    margin-top: 10px;
    font-size: 12px;
    color: var(--color-warning);
    background: #FFF8F0;
    border: 1px solid rgba(255, 125, 0, 0.25);
    border-radius: 8px;
    padding: 8px 12px;
}

/* 频道扩充记录（边栏） */
.expansion-notice {
    font-size: 12px;
    color: var(--color-success);
    margin-bottom: 10px;
}
.expansion-channel {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.expansion-name { font-size: 14px; font-weight: 600; }
.badge-ai {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(22, 119, 255, 0.08);
    border-radius: 4px;
    padding: 2px 6px;
}
.evidence-row { font-size: 12px; color: var(--color-text-2); padding: 2px 0; }
.evidence-row b { color: var(--color-text); }
.evidence-toggle {
    border: none;
    background: none;
    font-size: 12px;
    color: var(--color-primary);
    cursor: pointer;
    padding: 6px 0 0;
    font-family: inherit;
}
.evidence-sources { margin-top: 6px; border-top: 1px dashed var(--color-border); padding-top: 6px; }
.evidence-source-item {
    font-size: 11px;
    color: var(--color-text-2);
    padding: 2px 0 2px 12px;
    position: relative;
}
.evidence-source-item::before {
    content: '·';
    position: absolute;
    left: 2px;
    color: var(--color-primary);
    font-weight: 700;
}

/* 人工审核栏 */
.review-bar {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.review-btns { display: flex; gap: 10px; }
.review-btns .btn { flex: 1; }
.badge-pending {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-warning);
    background: rgba(255, 125, 0, 0.08);
    border-radius: 4px;
    padding: 2px 8px;
}
.badge-approved {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-success);
    background: rgba(0, 181, 120, 0.08);
    border-radius: 4px;
    padding: 3px 10px;
}

/* Discovery 统计（边栏） */
.discovery-stats { display: flex; flex-direction: column; gap: 8px; }
.discovery-stats .ds-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--color-text-2);
}
.discovery-stats .ds-row b { color: var(--color-text); font-variant-numeric: tabular-nums; }

/* Bad Case 面板（边栏） */
.badcase-item {
    font-size: 12px;
    color: var(--color-text-2);
    padding: 8px 10px;
    background: #FFF8F0;
    border-radius: 8px;
    margin-bottom: 6px;
    line-height: 1.6;
}
.badcase-item b { color: var(--color-text); }

/* Demo 评估（边栏） */
.tag-sim {
    font-size: 10px;
    color: var(--color-warning);
    background: rgba(255, 125, 0, 0.08);
    border-radius: 4px;
    padding: 2px 6px;
}
.eval-metrics { display: flex; gap: 24px; }
.eval-item { display: flex; flex-direction: column; }
.eval-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.eval-accent { color: var(--color-primary); }
.eval-key { font-size: 11px; color: var(--color-text-2); }
.eval-badcase {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-2);
}
.eval-badcase-item b { color: var(--color-warning); }
.eval-local { margin-top: 8px; font-size: 11px; color: var(--color-text-2); }

/* ==================== 页脚 ==================== */
.page-footer {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 32px;
    font-size: 12px;
    color: #9A9EA6;
    display: flex;
    justify-content: space-between;
}
.footer-links { color: var(--color-text-2); }

/* ==================== 设置抽屉 ==================== */
.drawer-mask {
    position: fixed;
    inset: 0;
    background: rgba(31, 35, 41, 0.35);
    z-index: 90;
    animation: fadeIn 200ms ease;
}
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 92vw;
    background: var(--color-card);
    border-left: 1px solid var(--color-border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 250ms ease;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.drawer-title { font-size: 16px; font-weight: 600; }
.drawer-close {
    border: none;
    background: none;
    font-size: 14px;
    color: var(--color-text-2);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.drawer-close:hover { background: #F0F1F3; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-footer { padding: 16px 20px; border-top: 1px solid var(--color-border); }
.drawer-footer .btn { width: 100%; }

.form-item { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.form-control {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 13px;
    color: var(--color-text);
    background: var(--color-card);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}
.form-radio {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-btn);
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color var(--transition);
}
.form-radio:hover { border-color: var(--color-primary); }
.form-radio input { margin-top: 3px; accent-color: var(--color-primary); }
.form-radio small { color: var(--color-text-2); font-size: 12px; }
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}
.form-check input { accent-color: var(--color-primary); }
.form-hint { font-size: 12px; color: var(--color-warning); margin-top: 6px; }

.test-result {
    margin-top: 10px;
    font-size: 13px;
    border-radius: 8px;
    padding: 10px 14px;
    line-height: 1.8;
}
.test-result.ok { color: var(--color-success); background: rgba(0, 181, 120, 0.06); border: 1px solid rgba(0, 181, 120, 0.25); }
.test-result.fail { color: #D4380D; background: #FFF2EE; border: 1px solid rgba(212, 56, 13, 0.2); }
.test-result.testing { color: var(--color-text-2); background: #F9FAFB; border: 1px solid var(--color-border); }

/* ==================== 入场动画（轻量） ==================== */
.fade-in { animation: fadeIn 250ms ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .layout { grid-template-columns: 1fr; }
    .col-side { flex-direction: row; flex-wrap: wrap; }
    .col-side .card { flex: 1 1 300px; }
}
@media (max-width: 768px) {
    .layout { padding: 16px 14px 32px; }
    .main-2col { grid-template-columns: 1fr; }
    .page-footer { flex-direction: column; gap: 4px; }
    .input-footer { flex-wrap: wrap; gap: 8px; }
}
