/* ============================================================
   DeepStock 每日简报 - 报纸杂志风格排版
   参考：华尔街见闻 / 财新，DeepStock 设计系统
   ============================================================ */

body.briefing-body {
    background: #f5f4f0;
    min-height: 100vh;
}

/* ── 报纸报头 ── */
.briefing-masthead {
    text-align: center;
    padding: 32px 20px 20px;
    border-bottom: 3px double #1a1a1a;
    margin-bottom: 20px;
    position: relative;
    background: #fff;
}

.briefing-masthead::before {
    content: '';
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #1a1a1a;
}

.briefing-masthead-date {
    font-size: 12px;
    color: #888;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.briefing-masthead-title {
    font-family: var(--font-display, 'Georgia', serif);
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.15em;
    margin: 0 0 8px;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 10px;
}

.briefing-masthead-meta {
    font-size: 12px;
    color: #888;
    letter-spacing: 0.08em;
}

.briefing-masthead-meta::before,
.briefing-masthead-meta::after {
    content: '—';
    margin: 0 8px;
}

/* ── 工具栏 ── */
.briefing-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.briefing-control {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.briefing-control-search {
    flex: 1;
    min-width: 180px;
}

.briefing-control span {
    font-weight: 600;
    white-space: nowrap;
    color: #333;
}

.briefing-control input[type="date"],
.briefing-control input[type="text"],
.briefing-control select {
    padding: 6px 10px;
    border: 1.5px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    font-family: var(--font-body);
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s;
}

.briefing-control input[type="text"]:focus,
.briefing-control input[type="date"]:focus,
.briefing-control select:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(26,26,26,0.08);
}

.briefing-buttons {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

/* ── 搜索结果提示 ── */
.briefing-search-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #fffbe6;
    border: 1px solid #f0d060;
    border-radius: 3px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #5a4a00;
}

/* ── Banner ── */
.briefing-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1a1a1a;
    color: #fff;
    margin-bottom: 16px;
}

.briefing-banner strong {
    font-family: var(--font-display, 'Georgia', serif);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.briefing-meta {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

.briefing-status {
    padding: 4px 14px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255,255,255,0.12);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
    font-family: monospace;
}

/* ── 卡片网格 ── */
.briefing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.briefing-grid-wide {
    grid-template-columns: 1fr 1fr;
}

/* 单卡片时占满整行 */
.briefing-grid-wide:has(article:only-child) {
    grid-template-columns: 1fr;
}

.briefing-card {
    background: #fff;
    border: 1px solid #ddd;
    overflow: hidden;
}

.briefing-card h2 {
    font-family: var(--font-display, 'Georgia', serif);
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 10px 16px 8px;
    border-bottom: 2px solid #1a1a1a;
    margin: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: #fafafa;
}

/* ── 摘要（报纸头版风格） ── */
.briefing-summary-card {
    grid-column: 1 / 3;
}

.briefing-summary {
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.9;
    color: #333;
    white-space: pre-wrap;
}

.briefing-summary:empty::before {
    content: '暂无摘要内容';
    color: #999;
    font-style: italic;
}

/* ── 操作日志 ── */
.briefing-log {
    padding: 12px 16px;
    font-size: 11px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    color: #666;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.briefing-log::-webkit-scrollbar { width: 4px; }
.briefing-log::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ── 指标看板 ── */
.briefing-sections {
    padding: 12px 16px;
}

.briefing-section-inner {
    margin-bottom: 16px;
}

.briefing-section-inner:last-child {
    margin-bottom: 0;
}

.briefing-section-inner h3 {
    font-family: var(--font-display, 'Georgia', serif);
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1.5px solid #1a1a1a;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.briefing-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 4px;
    border-bottom: 1px dotted #eee;
    gap: 12px;
}

.briefing-item:last-child {
    border-bottom: none;
}

.briefing-item:hover {
    background: #fafafa;
}

.briefing-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    flex-shrink: 0;
}

.briefing-item-meta {
    font-size: 11px;
    color: #777;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.5;
}

.briefing-item-meta:empty {
    display: none;
}

/* ── 新闻分栏 ── */
.briefing-news-tabs {
    display: flex;
    gap: 0;
    padding: 8px 16px 0;
    border-bottom: 2px solid #eee;
}

.briefing-news-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
}

.briefing-news-tab:hover {
    color: #333;
}

.briefing-news-tab.active {
    color: #1a1a1a;
    border-bottom-color: #1a1a1a;
}

.briefing-news {
    padding: 12px 16px;
}

.briefing-news-group {
    margin-bottom: 16px;
}

.briefing-news-group:last-child {
    margin-bottom: 0;
}

.briefing-news-group h3 {
    font-family: var(--font-display, 'Georgia', serif);
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1.5px solid #444;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.briefing-news-item {
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 2px;
    margin-bottom: 6px;
    border-left: 3px solid #ddd;
    transition: all 0.15s;
}

.briefing-news-item:last-child {
    margin-bottom: 0;
}

.briefing-news-item:hover {
    background: #f0f0ee;
    border-left-color: #1a1a1a;
}

.briefing-news-title {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    margin-bottom: 3px;
    line-height: 1.4;
}

/* 搜索 highlight */
.briefing-news-title mark,
.briefing-news-summary mark,
.briefing-news-core mark,
.briefing-news-reason mark {
    background: #fff176;
    color: #333;
    padding: 0 2px;
    border-radius: 2px;
}

.briefing-news-summary {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.briefing-news-summary:empty {
    display: none;
}

/* ── 市场影响标签 ── */
.briefing-impact-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.impact-bullish {
    background: #ffeaea;
    color: #c0392b;      /* A股红涨 */
}

.impact-bearish {
    background: #e8f5e9;
    color: #27ae60;      /* A股绿跌 */
}

.impact-neutral {
    background: #f5f5f5;
    color: #888;
}

/* ── 重要度评分标签 ── */
.briefing-score-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    margin-right: 5px;
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}

.score-high {
    background: #fff3e0;
    color: #e65100;
}

.score-mid {
    background: #fff8e1;
    color: #f57f17;
}

.score-low {
    background: #e8f5e9;
    color: #388e3c;
}

.score-noise {
    background: #f5f5f5;
    color: #9e9e9e;
}

/* ── 标签数组 ── */
.briefing-news-tags {
    margin-bottom: 4px;
}

.briefing-tag {
    display: inline-block;
    font-size: 11px;
    padding: 1px 6px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 2px;
    margin-right: 4px;
    margin-bottom: 3px;
}

/* ── LLM摘要分割线 ── */
.briefing-news-llm-divider {
    height: 1px;
    background: linear-gradient(to right, #e0e0e0, transparent);
    margin: 8px 0;
    position: relative;
}

/* ── 核心摘要（LLM生成） ── */
.briefing-news-core {
    font-size: 13px;
    color: #1a1a1a;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 4px;
}

/* ── 影响理由 ── */
.briefing-news-reason {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    margin-top: 3px;
}

/* ── 完整简报 ── */
.briefing-full-text {
    padding: 16px 20px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    color: #444;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 350px;
    overflow-y: auto;
    margin: 0;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.briefing-full-text::-webkit-scrollbar { width: 4px; }
.briefing-full-text::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ── 历史列表 ── */
.briefing-history-list {
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 16px;
}

.briefing-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px dotted #eee;
    cursor: pointer;
    transition: background 0.1s;
}

.briefing-history-item:last-child {
    border-bottom: none;
}

.briefing-history-item:hover {
    background: #fafafa;
}

.briefing-history-date {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
}

.briefing-history-meta {
    font-size: 12px;
    color: #888;
}

/* ── 按钮 ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.15s;
    border: 1.5px solid transparent;
    white-space: nowrap;
    text-decoration: none;
}

.btn-outline {
    background: #fff;
    border-color: #ccc;
    color: #333;
}

.btn-outline:hover {
    background: #f5f5f5;
    border-color: #999;
}

.btn-primary {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

.btn-primary:hover {
    background: #333;
    border-color: #333;
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 10px; font-size: 11px; }

/* ── 响应式 ── */
@media (max-width: 1024px) {
    .briefing-grid,
    .briefing-grid-wide {
        grid-template-columns: 1fr;
    }
    .briefing-summary-card {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .briefing-masthead-title {
        font-size: 26px;
    }
    .briefing-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .briefing-control-search {
        min-width: unset;
    }
    .briefing-buttons {
        margin-left: 0;
        justify-content: flex-end;
    }
    .briefing-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ── 日志弹窗 ── */
.briefing-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.briefing-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.briefing-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}
.briefing-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}
.briefing-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
}
.briefing-modal-close:hover { color: #333; }
.briefing-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}
.briefing-logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.briefing-logs-table th {
    background: #f5f5f5;
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}
.briefing-logs-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.briefing-logs-table tr:hover td {
    background: #fafafa;
}

/* ============================================================
   🌙 夜间蓝调 — 每日简报覆盖样式
   ============================================================ */
[data-theme="night"] body.briefing-body,
[data-theme="night"] .briefing-body {
    background: #0C0C0D !important;
}

[data-theme="night"] .briefing-masthead {
    background: rgba(255,255,255,0.03) !important;
    backdrop-filter: blur(16px);
    border-bottom: 3px double rgba(2,235,253,0.3) !important;
}
[data-theme="night"] .briefing-masthead::before {
    background: linear-gradient(90deg, #005ED3, #02EBFD) !important;
}
[data-theme="night"] .briefing-masthead-title {
    color: #D4E4FF !important;
    border-bottom-color: rgba(2,235,253,0.3) !important;
}
[data-theme="night"] .briefing-masthead-date,
[data-theme="night"] .briefing-masthead-meta {
    color: rgba(2,235,253,0.5) !important;
}

[data-theme="night"] .briefing-toolbar {
    background: rgba(255,255,255,0.03) !important;
    backdrop-filter: blur(16px);
    border-color: rgba(2,235,253,0.14) !important;
}
[data-theme="night"] .briefing-control span { color: #9CA3AF !important; }
[data-theme="night"] .briefing-control input,
[data-theme="night"] .briefing-control select {
    background: rgba(255,255,255,0.06) !important;
    border-color: rgba(2,235,253,0.2) !important;
    color: #EAEAEC !important;
}
[data-theme="night"] .briefing-control input:focus,
[data-theme="night"] .briefing-control select:focus {
    border-color: #02EBFD !important;
    box-shadow: 0 0 0 2px rgba(2,235,253,0.12) !important;
}

[data-theme="night"] .briefing-banner {
    background: linear-gradient(135deg, #060810, #0A1628) !important;
    border: 1px solid rgba(2,235,253,0.2);
}

[data-theme="night"] .briefing-card {
    background: rgba(255,255,255,0.04) !important;
    backdrop-filter: blur(16px);
    border-color: rgba(2,235,253,0.14) !important;
}
[data-theme="night"] .briefing-card h2 {
    background: rgba(2,235,253,0.07) !important;
    color: #02EBFD !important;
    border-bottom-color: rgba(2,235,253,0.2) !important;
}

[data-theme="night"] .briefing-summary { color: #C8CDD6 !important; }
[data-theme="night"] .briefing-section-inner h3 {
    color: #02EBFD !important;
    border-bottom-color: rgba(2,235,253,0.3) !important;
}
[data-theme="night"] .briefing-item { border-bottom-color: rgba(2,235,253,0.07) !important; }
[data-theme="night"] .briefing-item:hover { background: rgba(2,235,253,0.04) !important; }
[data-theme="night"] .briefing-item-title { color: #EAEAEC !important; }
[data-theme="night"] .briefing-item-meta { color: #6B7280 !important; }

[data-theme="night"] .briefing-news-item {
    background: rgba(255,255,255,0.03) !important;
    border-left-color: rgba(2,235,253,0.2) !important;
}
[data-theme="night"] .briefing-news-item:hover {
    background: rgba(2,235,253,0.06) !important;
    border-left-color: #02EBFD !important;
}
[data-theme="night"] .briefing-news-title { color: #EAEAEC !important; }
[data-theme="night"] .briefing-news-summary { color: #6B7280 !important; }
[data-theme="night"] .briefing-news-core { color: #C8CDD6 !important; }
[data-theme="night"] .briefing-news-reason { color: #6B7280 !important; }
[data-theme="night"] .briefing-news-group h3 {
    color: #02EBFD !important;
    border-bottom-color: rgba(2,235,253,0.25) !important;
}
[data-theme="night"] .briefing-news-tabs { border-bottom-color: rgba(2,235,253,0.12) !important; }
[data-theme="night"] .briefing-news-tab { color: #6B7280 !important; }
[data-theme="night"] .briefing-news-tab:hover { color: #EAEAEC !important; }
[data-theme="night"] .briefing-news-tab.active {
    color: #02EBFD !important;
    border-bottom-color: #02EBFD !important;
}

[data-theme="night"] .briefing-tag {
    background: rgba(2,235,253,0.1) !important;
    color: #02EBFD !important;
}
[data-theme="night"] .briefing-news-llm-divider {
    background: linear-gradient(to right, rgba(2,235,253,0.2), transparent) !important;
}
[data-theme="night"] .briefing-news-title mark,
[data-theme="night"] .briefing-news-summary mark,
[data-theme="night"] .briefing-news-core mark,
[data-theme="night"] .briefing-news-reason mark {
    background: rgba(2,235,253,0.2) !important;
    color: #02EBFD !important;
}

[data-theme="night"] .briefing-full-text {
    background: rgba(255,255,255,0.03) !important;
    color: #9CA3AF !important;
    border-top-color: rgba(2,235,253,0.1) !important;
}
[data-theme="night"] .briefing-log {
    background: rgba(255,255,255,0.03) !important;
    color: #6B7280 !important;
    border-top-color: rgba(2,235,253,0.1) !important;
}

[data-theme="night"] .briefing-history-list {
    background: rgba(255,255,255,0.03) !important;
    border-color: rgba(2,235,253,0.14) !important;
}
[data-theme="night"] .briefing-history-item { border-bottom-color: rgba(2,235,253,0.07) !important; }
[data-theme="night"] .briefing-history-item:hover { background: rgba(2,235,253,0.04) !important; }
[data-theme="night"] .briefing-history-date { color: #EAEAEC !important; }
[data-theme="night"] .briefing-history-meta { color: #6B7280 !important; }

/* 夜间briefing按钮 */
[data-theme="night"] .briefing-body .btn-outline {
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(2,235,253,0.2) !important;
    color: #9CA3AF !important;
}
[data-theme="night"] .briefing-body .btn-outline:hover {
    background: rgba(2,235,253,0.08) !important;
    border-color: #02EBFD !important;
    color: #02EBFD !important;
}
[data-theme="night"] .briefing-body .btn-primary {
    background: linear-gradient(99deg, #005ED3 25%, #02EBFD 100%) !important;
    border-color: transparent !important;
}

/* 夜间模态弹窗 */
[data-theme="night"] .briefing-modal-content {
    background: #111216 !important;
    border: 1px solid rgba(2,235,253,0.14);
}
[data-theme="night"] .briefing-modal-header {
    background: rgba(2,235,253,0.05) !important;
    border-bottom-color: rgba(2,235,253,0.12) !important;
}
[data-theme="night"] .briefing-modal-header h3 { color: #EAEAEC !important; }
[data-theme="night"] .briefing-modal-close { color: #6B7280 !important; }
[data-theme="night"] .briefing-modal-close:hover { color: #02EBFD !important; }

[data-theme="night"] .briefing-logs-table th {
    background: rgba(2,235,253,0.07) !important;
    color: #9CA3AF !important;
    border-bottom-color: rgba(2,235,253,0.12) !important;
}
[data-theme="night"] .briefing-logs-table td { border-bottom-color: rgba(255,255,255,0.04) !important; color: #C8CDD6 !important; }
[data-theme="night"] .briefing-logs-table tr:hover td { background: rgba(2,235,253,0.04) !important; }

[data-theme="night"] .briefing-search-banner {
    background: rgba(2,235,253,0.06) !important;
    border-color: rgba(2,235,253,0.2) !important;
    color: #9CA3AF !important;
}

/* ── briefing 页面主题切换器 ── */
.briefing-theme-switcher {
    position: absolute;
    top: 12px;
    right: 16px;
    display: flex;
    align-items: center;
    z-index: 10;
}
[data-theme="night"] .briefing-theme-switcher .theme-select {
    background-color: rgba(2,235,253,0.1) !important;
    border-color: rgba(2,235,253,0.25) !important;
}

/* ── 生成进度条 ── */
.briefing-progress-section {
    padding: 12px 20px;
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 16px;
}
.briefing-progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.briefing-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1a1a1a, #444);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}
.briefing-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}
[data-theme="night"] .briefing-progress-section {
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(2,235,253,0.14) !important;
}
[data-theme="night"] .briefing-progress-bar-wrap {
    background: rgba(255,255,255,0.08) !important;
}
[data-theme="night"] .briefing-progress-bar {
    background: linear-gradient(90deg, #005ED3, #02EBFD) !important;
}
[data-theme="night"] .briefing-progress-meta {
    color: #9CA3AF !important;
}

