/* ============================================================
   鱼盆趋势模型 v2.0 — 基础样式 & CSS变量
   ============================================================ */
:root {
    --color-yes-bg: #fff0f0;
    --color-yes-text: #d32f2f;
    --color-yes-border: #ef9a9a;
    --color-no-bg: #f0fff0;
    --color-no-text: #2e7d32;
    --color-no-border: #a5d6a7;
    --color-up: #d32f2f;
    --color-down: #2e7d32;
    --color-bg: #f5f5f5;
    --color-card: #ffffff;
    --color-text: #333333;
    --color-text-secondary: #666666;
    --color-border: #e0e0e0;
    --color-header-bg: #1a1a2e;
    --color-header-text: #ffffff;
    --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-header: 0 2px 12px rgba(0,0,0,0.15);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
}

/* ============================================================
   头部
   ============================================================ */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: var(--color-header-text);
    padding: 24px 32px;
    box-shadow: var(--shadow-header);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.header h1 .version {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.7;
    margin-left: 8px;
}

.header-info {
    text-align: right;
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.6;
}

.header-info .date {
    font-size: 16px;
    font-weight: 600;
    opacity: 1;
}

/* ============================================================
   主容器
   ============================================================ */
.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
}

/* ============================================================
   大势评估卡片
   ============================================================ */
.assessment-card {
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 24px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.assessment-badge {
    min-width: 140px;
    padding: 16px 24px;
    border-radius: 12px;
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.assessment-badge.bull      { background: linear-gradient(135deg, #d32f2f, #f44336); }
.assessment-badge.bias_bull { background: linear-gradient(135deg, #ff6f00, #ff9800); }
.assessment-badge.bias_bear { background: linear-gradient(135deg, #2e7d32, #4caf50); }
.assessment-badge.bear      { background: linear-gradient(135deg, #1565c0, #1976d2); }
.assessment-badge.unknown   { background: linear-gradient(135deg, #78909c, #90a4ae); }

.assessment-details {
    flex: 1;
    min-width: 200px;
}

.assessment-details .stats {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.assessment-details .stats strong {
    color: var(--color-text);
    font-size: 18px;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.bull      { background: var(--color-up); }
.progress-fill.bias_bull { background: #ff6f00; }
.progress-fill.bias_bear { background: var(--color-down); }
.progress-fill.bear      { background: #1565c0; }

.assessment-tip {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-left: auto;
    padding-left: 24px;
    border-left: 1px solid var(--color-border);
    min-width: 180px;
}

.assessment-tip .label {
    color: var(--color-text);
    font-weight: 600;
}

/* ============================================================
   数据表格
   ============================================================ */
.table-card {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

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

.table-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.table-header .count {
    font-size: 13px;
    color: var(--color-text-secondary);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

thead th:first-child { text-align: left; padding-left: 24px; }
thead th:nth-child(2) { text-align: left; }

tbody td {
    padding: 14px 16px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

tbody td:first-child { text-align: left; padding-left: 24px; font-weight: 600; }
tbody td:nth-child(2) { text-align: left; font-weight: 600; }

tbody tr:hover {
    background: #fafbfc;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* 信号颜色 (A股惯例: 红涨绿跌) */
.signal-yes {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 4px;
    background: var(--color-yes-bg);
    color: var(--color-yes-text);
    font-weight: 700;
    font-size: 13px;
    min-width: 48px;
}

.signal-no {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 4px;
    background: var(--color-no-bg);
    color: var(--color-no-text);
    font-weight: 700;
    font-size: 13px;
    min-width: 48px;
}

.signal-na {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 4px;
    background: #f5f5f5;
    color: #999;
    font-weight: 700;
    font-size: 13px;
}

/* 偏离率颜色 */
.dev-positive { color: var(--color-up); font-weight: 600; }
.dev-negative { color: var(--color-down); font-weight: 600; }
.dev-zero { color: #999; }

/* 强度排名徽章 */
.strength-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.strength-1 { background: #d32f2f; }
.strength-2 { background: #e53935; }
.strength-3 { background: #f4511e; }
.strength-4 { background: #ff9800; }
.strength-5 { background: #ffa726; }
.strength-6 { background: #66bb6a; }
.strength-7 { background: #43a047; }
.strength-8 { background: #2e7d32; }

.duration-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f5f5f5;
    font-weight: 600;
}

/* ============================================================
   底部说明
   ============================================================ */
.footer {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px 32px;
}

.disclaimer {
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.disclaimer h3 {
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 8px;
}

.disclaimer ul {
    list-style: none;
    padding: 0;
}

.disclaimer ul li {
    padding: 3px 0;
    padding-left: 16px;
    position: relative;
}

.disclaimer ul li::before {
    content: "·";
    position: absolute;
    left: 4px;
    font-weight: bold;
}

.disclaimer .warning {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    color: #f57f17;
    font-size: 12px;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
    .header { padding: 16px; }
    .header h1 { font-size: 18px; }
    .header-info { text-align: left; font-size: 12px; }
    .container { padding: 0 8px; margin-top: 12px; }
    .assessment-card { padding: 16px; flex-direction: column; }
    .assessment-badge { font-size: 22px; padding: 12px 20px; }
    .assessment-tip { border-left: none; border-top: 1px solid var(--color-border); padding-left: 0; padding-top: 12px; margin-left: 0; }

    thead th, tbody td { padding: 8px 6px; font-size: 12px; }
    thead th:first-child, tbody td:first-child { padding-left: 12px; }

    /* 在小屏幕上隐藏次要列 */
    thead th:nth-child(6), tbody td:nth-child(6) { display: none; }  /* 持续天数 */
}

@media (max-width: 480px) {
    thead th:nth-child(7), tbody td:nth-child(7) { display: none; }  /* 偏离率 */
}

/* ============================================================
   板块轮动 - 分区域展示
   ============================================================ */
.section-divider {
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border);
}

.section-divider h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.section-divider .section-sub {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-left: 8px;
}

.section-divider .section-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* 区域卡片网格 */
.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
}

.region-card {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border-top: 3px solid #90a4ae;
}

.region-card.strong_bull { border-top-color: #d32f2f; }
.region-card.bull       { border-top-color: #f4511e; }
.region-card.neutral    { border-top-color: #ffa726; }
.region-card.bear       { border-top-color: #66bb6a; }
.region-card.strong_bear{ border-top-color: #2e7d32; }

.region-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #fafafa;
    border-bottom: 1px solid var(--color-border);
}

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

.region-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.region-tag.strong_bull { background: #d32f2f; }
.region-tag.bull       { background: #f4511e; }
.region-tag.neutral    { background: #ffa726; }
.region-tag.bear       { background: #66bb6a; }
.region-tag.strong_bear{ background: #2e7d32; }
.region-tag.unknown    { background: #90a4ae; }

.region-stats {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-left: auto;
    padding-left: 12px;
}

.region-stats strong {
    color: var(--color-text);
    font-size: 14px;
}

.region-table {
    width: 100%;
    border-collapse: collapse;
}

.region-table th {
    background: #fafafa;
    padding: 8px 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
}

.region-table th:first-child {
    text-align: left;
    padding-left: 16px;
}

.region-table td {
    padding: 10px;
    text-align: center;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.region-table td:first-child {
    text-align: left;
    padding-left: 16px;
    font-weight: 600;
}

.region-table tr:last-child td {
    border-bottom: none;
}

.region-table tr:hover {
    background: #fafbfc;
}

.region-table .mini-signal {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    min-width: 36px;
}

.region-table .mini-signal.yes { background: #fff0f0; color: #d32f2f; }
.region-table .mini-signal.no  { background: #f0fff0; color: #2e7d32; }

.region-table .mini-dev.pos { color: #d32f2f; font-weight: 600; }
.region-table .mini-dev.neg { color: #2e7d32; font-weight: 600; }
.region-table .mini-dev.zero { color: #999; }

.region-empty {
    padding: 24px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* 板块表格中的区域标签 */
.region-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    background: #f0f0f0;
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}
