:root {
    --bg: #f4f6f3;
    --ink: #17201c;
    --muted: #69736d;
    --line: rgba(23, 32, 28, .1);
    --green: #176a50;
    --green-2: #25835f;
    --amber: #b8771b;
    --red: #b34434;
    --card: #fffefa;
    --soft: #eef4ed;
    --shadow: 0 8px 24px rgba(23, 32, 28, .08);
    --radius: 4px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(23, 106, 80, .12), transparent 260px),
        var(--bg);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.quant-app {
    width: min(100%, 680px);
    margin: 0 auto;
    padding: 0 10px 28px;
}

.hero {
    position: relative;
    overflow: hidden;
    margin: 0 -10px;
    padding: 12px 10px 16px;
    color: #f8f4e8;
    background:
        linear-gradient(140deg, rgba(14, 54, 44, .98), rgba(28, 112, 78, .96)),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 14px);
    border-radius: var(--radius);
}

.hero::after {
    content: "";
    position: absolute;
    right: -58px;
    bottom: -72px;
    width: 180px;
    height: 180px;
    border-radius: var(--radius);
    background: rgba(241, 190, 86, .16);
    transform: rotate(18deg);
}

.hero-nav,
.hero-main {
    position: relative;
    z-index: 1;
}

.hero-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.hero-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-link,
.help-icon-link {
    min-height: 32px;
    color: #f8ecd0;
    text-decoration: none;
    border: 1px solid rgba(248, 236, 208, .3);
    border-radius: var(--radius);
    padding: 6px 10px;
    background: rgba(255, 255, 255, .08);
    font-size: 12px;
}

.help-icon-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 9px 0 6px;
    border-color: rgba(242, 196, 106, .52);
    color: #1c3d33;
    background: #f2c46a;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.help-icon-link span {
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #f8ecd0;
    background: rgba(28, 61, 51, .9);
    font-size: 14px;
}

.hero-main {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.kicker {
    margin: 0 0 7px;
    color: #f2c46a;
    letter-spacing: .14em;
    font-size: 11px;
}

h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.08;
    letter-spacing: -.04em;
}

.subtitle {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    line-height: 1.65;
}

.hero-card {
    padding: 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .11);
    border: 1px solid rgba(255, 255, 255, .18);
}

.hero-card span,
.hero-card small {
    display: block;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
}

.hero-card strong {
    display: block;
    margin: 5px 0;
    font-size: 20px;
    word-break: break-all;
}

.signal-filters,
.metrics,
.tabs,
.panel,
.quant-login-lock,
.permission-notice,
.quant-help {
    margin-top: 10px;
}

.quant-login-lock {
    display: none;
}

.quant-login-lock.active {
    display: block;
}

.quant-login-lock .login-lock-card {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    padding: 22px 16px;
    place-items: center;
    gap: 14px;
    border: 1px solid rgba(201, 164, 74, .24);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top right, rgba(225, 186, 89, .22), transparent 30%),
        radial-gradient(circle at bottom left, rgba(165, 120, 36, .12), transparent 28%),
        linear-gradient(135deg, rgba(255, 251, 239, .98) 0%, rgba(249, 239, 206, .96) 52%, rgba(255, 252, 244, .98) 100%);
    box-shadow: 0 16px 36px rgba(96, 68, 18, .10);
    text-align: center;
}

.quant-login-lock.active .login-lock-card {
    display: grid;
}

.quant-login-lock .login-lock-card::after {
    content: "";
    position: absolute;
    inset: auto -34px -34px auto;
    width: 150px;
    height: 150px;
    border-radius: var(--radius);
    background: radial-gradient(circle, rgba(207, 167, 71, .22), rgba(207, 167, 71, 0));
    pointer-events: none;
}

.login-lock-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(202, 164, 72, .24);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, .72) 0%, rgba(255, 246, 217, .94) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .74), 0 12px 24px rgba(138, 103, 30, .12);
}

.login-lock-icon svg {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: #ae8026;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-lock-text {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: .04em;
    color: #8b6520;
}

.login-lock-sub {
    margin-top: 8px;
    color: rgba(104, 79, 30, .76);
    font-size: 13px;
    line-height: 1.55;
}

.permission-notice {
    display: none;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(184, 68, 52, .22);
    border-left: 4px solid var(--red);
    border-radius: var(--radius);
    color: #68251d;
    background: rgba(184, 68, 52, .08);
}

.permission-notice.active {
    display: grid;
}

.permission-notice strong {
    font-size: 14px;
}

.permission-notice span {
    color: rgba(104, 37, 29, .82);
    font-size: 12px;
    line-height: 1.55;
}

.signal-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 254, 250, .96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.signal-filters label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}

.signal-filters input,
.signal-filters select,
.signal-filters button {
    width: 100%;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 10px;
    color: var(--ink);
    background: #fff;
    font-size: 13px;
}

.signal-filters button {
    align-self: end;
    grid-column: 1 / -1;
    border: none;
    color: #fff;
    background: var(--green);
    cursor: pointer;
    font-weight: 700;
}

.metrics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(255, 254, 250, .9);
    box-shadow: 0 4px 16px rgba(23, 32, 28, .04);
    font-size: 12px;
    line-height: 1.5;
}

.panel-metrics {
    margin: 8px 0 10px;
    box-shadow: none;
}

.metric {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.metric::after {
    content: "|";
    color: rgba(105, 115, 109, .38);
    margin-left: 6px;
}

.metric:last-child::after {
    content: "";
    margin-left: 0;
}

.metric b {
    color: var(--muted);
    font-weight: 500;
}

.metric b::after {
    content: ":";
}

.metric {
    color: var(--ink);
    font-weight: 800;
}

.metric.loading {
    width: 100%;
    display: block;
    font-size: 12px;
    font-weight: 500;
}

.metric.loading::after {
    content: "";
}

.tabs {
    position: sticky;
    top: 0;
    z-index: 6;
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 254, 250, .94);
    box-shadow: var(--shadow);
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tabs button {
    flex: 0 0 auto;
    border: none;
    border-radius: var(--radius);
    padding: 9px 13px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: background .16s ease, color .16s ease;
}

.tabs button.active {
    color: #fff;
    background: var(--green);
    box-shadow: 0 6px 14px rgba(23, 106, 80, .18);
}

.tabs .tab-help {
    margin-left: auto;
    border: 1px solid rgba(23, 106, 80, .22);
    color: var(--green);
    background: #fff;
}

.panel {
    display: none;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}

.panel.active {
    display: block;
}

.panel-head {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.panel-head h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.panel-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 12px;
}

.panel-count {
    width: fit-content;
    border-radius: var(--radius);
    padding: 3px 7px;
    color: #fff;
    background: var(--amber);
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
}

.table-wrap {
    overflow-x: auto;
    margin: 0 -4px;
    padding: 0 4px 2px;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
    font-size: 12px;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--muted);
    background: var(--card);
    font-weight: 600;
}

.team {
    font-weight: 700;
}

.sub {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
}

.tag {
    display: inline-flex;
    border-radius: var(--radius);
    padding: 3px 6px;
    color: #fff;
    background: var(--green-2);
    font-size: 11px;
}

.num-pos {
    color: var(--red);
    font-weight: 700;
}

.num-neg {
    color: var(--green);
    font-weight: 700;
}

.backtest-grid {
    display: grid;
    gap: 10px;
}

.compare-card {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .7);
}

.compare-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.compare-head h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.compare-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.compare-head > span {
    height: fit-content;
    border-radius: var(--radius);
    padding: 5px 8px;
    color: #fff;
    background: var(--green);
    font-size: 12px;
    white-space: nowrap;
}

.compare-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.compare-filters label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}

.compare-filters input,
.compare-filters select,
.compare-filters button {
    width: 100%;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 8px;
    color: var(--ink);
    background: #fff;
    font-size: 12px;
}

.compare-filters button {
    align-self: end;
    color: var(--green);
    border-color: rgba(23, 106, 80, .28);
    background: rgba(23, 106, 80, .07);
    cursor: pointer;
    font-weight: 800;
}

.pick-filters,
.ticket-creator {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.pick-filters label,
.ticket-creator label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}

.pick-filters input,
.pick-filters select,
.pick-filters button,
.ticket-creator input,
.ticket-creator button {
    width: 100%;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 8px;
    color: var(--ink);
    background: #fff;
    font-size: 12px;
}

.pick-filters button,
.ticket-creator button {
    align-self: end;
    color: var(--green);
    border-color: rgba(23, 106, 80, .28);
    background: rgba(23, 106, 80, .07);
    cursor: pointer;
    font-weight: 800;
}

.ticket-creator {
    background: rgba(23, 106, 80, .06);
}

.ticket-creator .strategy-msg {
    min-height: 34px;
    justify-content: flex-start;
}

.pick-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 8px;
}

.pick-result-head strong {
    color: var(--muted);
    font-size: 12px;
}

.icon-export-button {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(23, 106, 80, .24);
    border-radius: var(--radius);
    color: var(--green);
    background: rgba(23, 106, 80, .06);
    cursor: pointer;
    font-size: 16px;
    font-weight: 900;
}

.icon-export-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-export-button:hover {
    color: #fff;
    background: var(--green);
}

.pick-result-table {
    table-layout: fixed;
}

.pick-check-col {
    width: 34px;
    text-align: center;
}

.pick-check-col input {
    width: 16px;
    height: 16px;
}

.pick-result-table th:nth-child(2),
.pick-result-table td:nth-child(2) {
    width: 112px;
    max-width: 112px;
    word-break: break-all;
}

.pick-result-table th:nth-child(3),
.pick-result-table td:nth-child(3) {
    width: 220px;
}

.ticket-panel {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.ticket-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.ticket-list {
    display: grid;
    gap: 8px;
}

.ticket-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(23, 106, 80, .16);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .72);
}

.ticket-card-main strong {
    display: block;
    font-size: 13px;
}

.ticket-card-stats,
.ticket-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ticket-card-stats span {
    border: 1px solid rgba(105, 115, 109, .16);
    border-radius: var(--radius);
    padding: 3px 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.ticket-card-actions button,
.ticket-card-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    border: 1px solid rgba(23, 106, 80, .24);
    border-radius: var(--radius);
    padding: 0 8px;
    color: var(--green);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.backtest-evaluate-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid rgba(23, 106, 80, .18);
    border-radius: var(--radius);
    background: rgba(23, 106, 80, .06);
}

.backtest-evaluate-link strong {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
}

.backtest-evaluate-link span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.backtest-evaluate-link a {
    flex: 0 0 auto;
    border-radius: var(--radius);
    padding: 8px 10px;
    color: #fff;
    background: var(--green);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

#btnExportCompareCsv {
    color: #fff;
    border-color: var(--green);
    background: var(--green);
}

.score-pill {
    display: inline-flex;
    min-width: 46px;
    justify-content: center;
    border: 1px solid rgba(105, 115, 109, .18);
    border-radius: var(--radius);
    padding: 3px 6px;
    color: var(--ink);
    background: #fff;
    font-size: 12px;
}

.score-a {
    color: var(--red);
    border-color: rgba(179, 68, 52, .24);
    background: rgba(179, 68, 52, .06);
}

.score-b {
    color: var(--amber);
    border-color: rgba(184, 119, 27, .24);
    background: rgba(184, 119, 27, .06);
}

.score-c {
    color: var(--green);
    border-color: rgba(23, 106, 80, .24);
    background: rgba(23, 106, 80, .06);
}

.score-d,
.score-样本不足 {
    color: var(--muted);
    background: rgba(105, 115, 109, .06);
}

.risk-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.risk-tag {
    display: inline-flex;
    border: 1px solid rgba(105, 115, 109, .18);
    border-radius: var(--radius);
    padding: 2px 5px;
    color: var(--muted);
    background: rgba(105, 115, 109, .06);
    font-size: 11px;
    font-weight: 800;
}

.risk-good {
    color: var(--red);
    border-color: rgba(179, 68, 52, .24);
    background: rgba(179, 68, 52, .06);
}

.risk-watch,
.risk-sample {
    color: var(--amber);
    border-color: rgba(184, 119, 27, .24);
    background: rgba(184, 119, 27, .06);
}

.risk-bad {
    color: var(--green);
    border-color: rgba(23, 106, 80, .24);
    background: rgba(23, 106, 80, .06);
}

#panel-backtests .table-wrap {
    margin: 0 -4px;
    padding: 0 4px 2px;
    overflow-x: auto;
}

#panel-backtests table {
    min-width: 760px;
    border-spacing: 0;
}

#panel-backtests thead {
    display: table-header-group;
}

#panel-backtests th {
    background: #f8faf6;
}

#panel-backtests th,
#panel-backtests td {
    padding: 9px 8px;
}

.backtest-table-row {
    cursor: pointer;
}

.backtest-table-row:hover td {
    background: rgba(23, 106, 80, .045);
}

.backtest-table-row td:first-child {
    border-left: 3px solid var(--green);
}

.backtest-table-row strong {
    display: block;
    font-size: 12px;
    line-height: 1.35;
}

.table-action-danger {
    min-width: 52px;
    height: 28px;
    border: 1px solid rgba(179, 68, 52, .24);
    border-radius: var(--radius);
    color: var(--red);
    background: rgba(179, 68, 52, .06);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.table-action-danger:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.table-action-disabled {
    color: rgba(105, 115, 109, .5);
    font-size: 12px;
}

.backtest-runner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.backtest-runner label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}

.backtest-runner input,
.backtest-runner select,
.backtest-runner button {
    width: 100%;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 9px;
    color: var(--ink);
    background: #fff;
    font-size: 12px;
}

.backtest-runner button {
    align-self: end;
    border-color: var(--green);
    color: #fff;
    background: var(--green);
    cursor: pointer;
    font-weight: 800;
}

.backtest-runner button:disabled,
.backtest-runner input:disabled,
.backtest-runner select:disabled {
    cursor: not-allowed;
    opacity: .58;
}

#backtestCreateMsg {
    align-self: center;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.status-pill {
    display: inline-flex;
    min-width: 46px;
    justify-content: center;
    border: 1px solid rgba(105, 115, 109, .22);
    border-radius: var(--radius);
    padding: 3px 6px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 800;
}

.status-running {
    color: var(--amber);
    border-color: rgba(184, 119, 27, .3);
}

.status-finished {
    color: var(--green);
    border-color: rgba(23, 106, 80, .3);
}

.status-failed {
    color: var(--red);
    border-color: rgba(179, 68, 52, .3);
}

.strategy-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: rgba(255, 255, 255, .72);
}

.strategy-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.strategy-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .72);
}

.strategy-list-toolbar strong {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
}

.strategy-list-toolbar span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.strategy-list-toolbar button {
    flex: 0 0 auto;
    height: 34px;
    border: 1px solid var(--green);
    border-radius: var(--radius);
    padding: 0 12px;
    color: #fff;
    background: var(--green);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.strategy-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 126px;
    box-shadow: 0 6px 16px rgba(23, 106, 80, .16);
}

.strategy-primary-button:hover {
    background: var(--green-2);
}

.strategy-list-toolbar button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.strategy-list-msg {
    width: fit-content;
    margin: 0 0 10px;
}

.strategy-modal {
    display: none;
}

body.strategy-modal-open {
    overflow: hidden;
}

.strategy-modal.active {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 18px;
}

.strategy-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(8, 17, 14, .46);
    backdrop-filter: blur(8px);
}

.strategy-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 820px);
    max-height: min(86vh, 760px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: 0 24px 72px rgba(8, 17, 14, .26);
}

.strategy-form {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: 0;
    background: transparent;
}

.strategy-form.active {
    display: grid;
}

.form-title,
.form-wide,
.form-actions,
.play-scope-field {
    grid-column: 1 / -1;
}

.form-title,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.form-title-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.strategy-modal-close {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(23, 32, 28, .12) !important;
    border-radius: var(--radius);
    color: var(--muted) !important;
    background: rgba(255, 255, 255, .78) !important;
    cursor: pointer;
    font-size: 22px !important;
    font-weight: 400 !important;
    line-height: 1;
}

.strategy-modal-close:hover {
    color: var(--red) !important;
    border-color: rgba(179, 68, 52, .24) !important;
    background: rgba(179, 68, 52, .06) !important;
}

.strategy-form .form-title-actions button {
    width: auto;
    min-width: 58px;
    padding: 0 10px;
}

.btn-light {
    border: 1px solid rgba(23, 106, 80, .24);
    border-radius: var(--radius);
    color: var(--green);
    background: #fff;
    cursor: pointer;
    font-weight: 700;
}

.strategy-form label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}

.strategy-form fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

.strategy-form legend {
    margin: 0 0 7px;
    padding: 0;
    color: var(--muted);
    font-size: 12px;
}

.play-scope-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.play-scope-options label {
    display: inline-flex;
    width: auto;
    min-height: 34px;
    padding: 0 12px;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: rgba(255, 255, 255, .72);
    cursor: pointer;
    font-weight: 700;
}

.play-scope-options label.is-locked {
    border-color: rgba(23, 106, 80, .26);
    color: var(--green);
    background: rgba(23, 106, 80, .08);
    cursor: not-allowed;
}

.play-scope-options label.is-locked span::after {
    content: " 主玩法";
    margin-left: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.strategy-form .play-scope-options input {
    width: auto;
    height: auto;
    margin: 0;
    border: initial;
}

.strategy-form input,
.strategy-form select,
.strategy-form textarea,
.strategy-form button {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: #fff;
    font-size: 12px;
}

.strategy-form input,
.strategy-form select {
    height: 36px;
    padding: 0 9px;
}

.strategy-form input[readonly] {
    color: var(--muted);
    background: rgba(255, 255, 255, .56);
}

.strategy-form textarea {
    min-height: 72px;
    padding: 8px 9px;
    resize: vertical;
}

.strategy-form button,
.strategy-card button {
    height: 34px;
    border: none;
    color: #fff;
    background: var(--green);
    cursor: pointer;
    font-weight: 700;
}

.form-title button {
    max-width: 88px;
    background: var(--amber);
}

.form-actions button {
    max-width: 132px;
}

.form-actions .btn-light {
    max-width: 88px;
    color: var(--green);
    border: 1px solid rgba(23, 106, 80, .24);
    background: #fff;
}

.strategy-msg {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    padding: 6px 10px;
    color: var(--muted);
    background: rgba(23, 32, 28, .05);
    font-size: 12px;
    font-weight: 700;
}

.strategy-msg:empty {
    display: none;
}

.strategy-msg.is-success {
    color: #0f4f3b;
    background: rgba(23, 106, 80, .14);
    border: 1px solid rgba(23, 106, 80, .24);
}

.strategy-msg.is-error {
    color: #8f3026;
    background: rgba(179, 68, 52, .12);
    border: 1px solid rgba(179, 68, 52, .24);
}

.strategy-msg.is-info {
    color: #7b5012;
    background: rgba(184, 119, 27, .13);
    border: 1px solid rgba(184, 119, 27, .24);
}

.check-line {
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
}

.check-line input {
    width: auto;
    height: auto;
}

.login-lock-card,
.permission-lock-card {
    display: none;
    border: 1px dashed rgba(23, 106, 80, .35);
    border-radius: var(--radius);
    padding: 12px;
    background: rgba(23, 106, 80, .08);
}

.login-lock-card {
    cursor: pointer;
}

.login-lock-card.active,
.permission-lock-card.active {
    display: grid;
    gap: 4px;
}

.strategy-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.strategy-card-actions button {
    width: auto;
    min-width: 74px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: var(--radius);
    border: 1px solid transparent;
}

.strategy-card h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
}

.strategy-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 10px;
    border-color: rgba(29, 45, 39, .12);
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 6px 18px rgba(38, 51, 45, .05);
}

.strategy-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: rgba(139, 124, 87, .45);
}

.strategy-card.is-enabled::before {
    background: var(--green);
}

.strategy-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
}

.strategy-code {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    word-break: break-all;
}

.strategy-badges,
.strategy-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.strategy-badges {
    justify-content: flex-end;
}

.strategy-badges span,
.strategy-scope span {
    border: 1px solid rgba(29, 45, 39, .12);
    border-radius: var(--radius);
    padding: 3px 6px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 700;
}

.strategy-badges .badge-on {
    color: var(--green);
    border-color: rgba(23, 106, 80, .28);
    background: transparent;
}

.strategy-badges .badge-off {
    color: #7b725d;
    border-color: rgba(139, 124, 87, .24);
    background: transparent;
}

.strategy-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    border-top: 1px solid rgba(29, 45, 39, .1);
    padding-top: 10px;
}

.strategy-detail-grid span {
    min-width: 0;
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.45;
}

.strategy-detail-grid b {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.strategy-memo {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
    margin: 0;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.5;
}

.strategy-memo b {
    color: var(--muted);
    font-size: 11px;
}

.strategy-card-actions .strategy-action-primary {
    color: #fff;
    border-color: var(--green);
    background: var(--green);
}

.strategy-card-actions .strategy-action-secondary {
    color: var(--green);
    border-color: rgba(23, 106, 80, .24);
    background: transparent;
}

.strategy-card-actions .strategy-action-danger {
    color: #9f1d1d;
    border-color: rgba(159, 29, 29, .28);
    background: transparent;
}

.strategy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
}

.empty {
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.site-footer {
    margin-top: 18px;
    padding: 18px 14px 22px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.site-footer .law-note {
    margin-bottom: 10px;
    color: #cf2f2f !important;
    line-height: 1.5;
}

.site-footer .footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.site-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
    line-height: 1.7;
}

.site-footer .footer-links a {
    color: var(--muted);
    text-decoration: none;
}

.site-footer .footer-links a:hover {
    color: var(--ink);
}

.site-footer .sep {
    margin: 0 2px;
    color: rgba(105, 115, 109, .5);
}

.site-footer .footer-meta {
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
}

.site-footer .slogan {
    margin-top: 2px;
    color: rgba(105, 115, 109, .78);
}

@media (min-width: 760px) {
    .quant-app {
        width: min(100% - 28px, 920px);
        padding-bottom: 42px;
    }

    .hero {
        margin: 12px 0 0;
        padding: 18px;
    }

    .hero-main {
        grid-template-columns: 1fr 190px;
        align-items: end;
    }

    h1 {
        font-size: 38px;
    }

    .signal-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .signal-filters button {
        grid-column: auto;
    }

    .pick-filters {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .ticket-creator {
        grid-template-columns: 1fr 120px 1.3fr;
    }

    .backtest-runner {
        grid-template-columns: 1.4fr .8fr repeat(3, 1fr) .9fr;
    }

    .strategy-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .strategy-detail-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .strategy-detail-grid span {
        grid-template-columns: 1fr;
        gap: 3px;
    }

}

@media (max-width: 640px) {
    .strategy-list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .strategy-list-toolbar button {
        width: 100%;
    }

    .strategy-modal.active {
        align-items: end;
        padding: 10px;
    }

    .strategy-modal-card {
        width: 100%;
        max-height: 88vh;
    }

    .strategy-form {
        grid-template-columns: 1fr;
    }

    .site-footer {
        padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
    }
}
