* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Microsoft YaHei", -apple-system, Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2933;
}
header {
    background: #b91c1c;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}
header h1 { font-size: 20px; margin: 0; }
header .sub { font-size: 12px; opacity: .85; }
header .logo { height: 36px; width: auto; border-radius: 6px; background: #fff; padding: 2px; }

main {
    max-width: none;
    margin: 18px 0;
    padding: 0 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 16px 18px;
}
.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 12px;
    border-left: 4px solid #b91c1c;
    padding-left: 8px;
}
.panel-title small { color: #6b7280; font-weight: 400; font-size: 12px; }

.boards { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; color: #374151; }
.boards-label { color: #6b7280; }
.boards label { cursor: pointer; display: flex; align-items: center; gap: 4px; }

.presets { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.presets-label { font-size: 13px; color: #6b7280; }
.chip {
    background: #fff7ed; border: 1px solid #fdba74; color: #c2410c;
    padding: 5px 12px; border-radius: 16px; cursor: pointer; font-size: 12px;
}
.chip:hover { background: #ffedd5; }
.chip[data-preset="clear"] { background: #f3f4f6; border-color: #d1d5db; color: #6b7280; }

.cond-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.cond-row select, .cond-row input {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
}
.cond-row select.field { min-width: 220px; }
.cond-row input { width: 110px; }
.cond-row .sep { color: #9ca3af; }
.cat-tag {
    font-size: 11px;
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 3px;
    padding: 1px 6px;
}
.del { color: #9ca3af; cursor: pointer; border: none; background: none; font-size: 16px; }
.del:hover { color: #b91c1c; }

.actions { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.btn-primary {
    background: #b91c1c; color: #fff; border: none;
    padding: 8px 22px; border-radius: 5px; cursor: pointer; font-size: 14px;
}
.btn-primary:hover { background: #991b1b; }
.btn-primary:disabled { background: #d4a0a0; cursor: not-allowed; }
.btn-ghost {
    background: #fff; border: 1px solid #d1d5db; color: #374151;
    padding: 7px 14px; border-radius: 5px; cursor: pointer; font-size: 13px;
}
.btn-ghost:hover { border-color: #b91c1c; color: #b91c1c; }
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }
.btn-link { background: none; border: none; color: #b91c1c; cursor: pointer; font-size: 13px; }
.status { font-size: 13px; color: #6b7280; }

.overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; z-index: 999;
}
.overlay-box {
    background: #fff; border-radius: 12px; padding: 32px 40px; text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.overlay-title { font-size: 18px; font-weight: 600; margin: 14px 0 8px; color: #b91c1c; }
.overlay-tip { font-size: 13px; color: #6b7280; line-height: 1.7; }
.overlay-tip b { color: #b91c1c; }
.spinner {
    width: 40px; height: 40px; margin: 0 auto; border: 4px solid #fde2e2;
    border-top-color: #b91c1c; border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
    background: #fff; border-radius: 10px; width: 90%; max-width: 960px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px; border-bottom: 1px solid #eef0f2; font-weight: 600;
}
.modal-hint { font-size: 12px; color: #9ca3af; font-weight: 400; margin-left: auto; margin-right: 14px; }
.modal-close { border: none; background: none; font-size: 18px; cursor: pointer; color: #9ca3af; }
.modal-close:hover { color: #b91c1c; }
.kline-chart { width: 100%; height: 460px; }
.code-link { color: #b91c1c; cursor: pointer; text-decoration: underline dotted; }

.biz-search {
    padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 16px;
    font-size: 13px; width: 360px; max-width: 50%;
}
.biz-search:focus { outline: none; border-color: #b91c1c; }

.table-wrap { overflow-x: auto; }
.hint { color: #9ca3af; font-size: 13px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid #eef0f2; }
td.wrap { white-space: normal; text-align: left; max-width: 340px; min-width: 160px; line-height: 1.4; color: #4b5563; }
th:nth-child(-n+2), td:nth-child(-n+2) { text-align: left; }
th { background: #f9fafb; cursor: pointer; user-select: none; position: sticky; top: 0; }
th:hover { color: #b91c1c; }
tr:hover td { background: #fafafa; }
.up { color: #dc2626; }
.down { color: #16a34a; }
.err { color: #dc2626; }
