:root {
    --blue: #2a67fe;
    --blue-hover: #1f53e6;
    --accent: #3a7afe;
    --text: #333;
    --muted: #7a889f;
    --line: #d7d7d7;
    --table-border: #ebedf5;
    --table-header: #f5f7ff;
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
    min-height: 100vh;
    background: #f4f6fb;
    color: var(--text);
}

.layout {
    display: grid;
    grid-template-columns: 220px auto;
    grid-template-rows: 60px auto;
    grid-template-areas:
        "topbar topbar"
        "sidebar content";
    min-height: 100vh;
}

.topbar {
    grid-area: topbar;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    color: #fff;
}

.brand {
    font-size: 24px;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
}

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

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.sidebar {
    grid-area: sidebar;
    background: #fff;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 20px;
}

.nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: block;
    padding: 14px 32px;
    font-size: 16px;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: var(--blue);
}

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

.content {
    grid-area: content;
    padding: 20px 24px 40px;
}

.section-header {
    margin-bottom: 20px;
}

.detail-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.detail-top h2 {
    font-size: 18px;
    font-weight: 600;
    color: #0d1a39;
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    margin-left: 8px;
}

.tag-primary {
    background: rgba(42, 103, 254, 0.12);
    color: var(--blue);
}

.tag-danger {
    background: rgba(255, 87, 87, 0.12);
    color: #ff5553;
}

.actions {
    display: flex;
    gap: 12px;
}

.btn {
    height: 34px;
    padding: 0 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-hover);
}

.btn-outline {
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--line);
}

.btn-outline:hover {
    color: var(--blue);
    border-color: var(--blue);
}

.divider {
    height: 1px;
    background: var(--line);
    margin-top: 16px;
}

.charts {
    display: grid;
    gap: 20px;
}

.chart-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--table-border);
    padding: 18px 20px 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #0d1a39;
    margin-bottom: 14px;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-pager {
    display: inline-flex;
    gap: 8px;
}

.pager-btn {
    width: 32px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
    color: #333;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pager-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.chart-header select {
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--line);
    padding: 0 12px;
    font-size: 13px;
    color: #333;
    background: #fff;
    min-width: 120px;
}

.chart-actions {
    display: flex;
    gap: 12px;
}

.chart-actions button {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
}

.chart-actions button:hover {
    color: var(--blue);
}

.chart-placeholder {
    height: 600px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f3f6ff 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
}

/* 图表容器样式 */
.chart-card canvas {
    width: 100% !important;
    height: 600px !important;
}

.table-card {
    margin-top: 24px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--table-border);
    padding: 18px 20px 24px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: #0d1a39;
}

.tabs {
    display: inline-flex;
    background: #eff3ff;
    border-radius: 6px;
    overflow: hidden;
}

.tab {
    border: none;
    background: transparent;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
}

.tab.active {
    background: #fff;
    color: var(--blue);
    border: 1px solid rgba(42, 103, 254, 0.3);
    border-radius: 6px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: var(--table-header);
}

th,
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--table-border);
    text-align: left;
    color: var(--text);
    white-space: nowrap;
}

/* 策略结果列允许换行显示两行 */
th:nth-child(14),
td:nth-child(14) {
    white-space: normal;
    min-width: 120px;
}

tbody tr:hover {
    background: #f9fbff;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
}

.pager {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pager button {
    min-width: 36px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
}

.pager button:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.pager button.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

.pager input {
    width: 48px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--line);
    text-align: center;
}

.analysis-card {
    margin-top: 24px;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--table-border);
    background: #fff;
}

.analysis-card header {
    font-size: 14px;
    font-weight: 600;
    color: #0d1a39;
    margin-bottom: 16px;
}

.analysis-content {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text);
    display: grid;
    gap: 12px;
}

.analysis-log-card {
    margin-top: 24px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--table-border);
    padding: 18px 20px 24px;
}

.analysis-log-header {
    margin-bottom: 16px;
}

.analysis-log-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #0d1a39;
}

.analysis-log-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analysis-log-content textarea {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 18px;
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    resize: vertical;
    line-height: 1.6;
}

.analysis-log-content textarea:focus {
    outline: none;
    border-color: var(--blue);
}

.analysis-log-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.analysis-log-actions .btn {
    min-width: 80px;
}


