/* =========================================================
   以旧换新系列 · 单列「控制台 + Bento」UI
   ========================================================= */
.tr-page {
    --tr-ink: #0b2230;
    --tr-mut: #5d7684;
    --tr-card: #ffffff;
    --tr-bg: #f3f9fb;
    --tr-line: rgba(13, 74, 92, .13);
    --tr-1: #0ea5a4;
    --tr-2: #2563eb;
    --tr-3: #7c3aed;
    --tr-hot: #ef4444;
    --tr-amber: #f59e0b;
    --tr-green: #16a34a;
    color: var(--tr-ink);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

[data-theme="dark"] .tr-page {
    --tr-ink: #e6f4f7;
    --tr-mut: #93aeb9;
    --tr-card: #101c26;
    --tr-bg: #0a141b;
    --tr-line: rgba(148, 190, 205, .18);
}

/* ---------- 顶部控制台 ---------- */
.tr-console {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 34px 30px 30px;
    color: #fff;
    background: radial-gradient(130% 150% at 8% 0%, #0f766e 0%, #0b3b57 46%, #131a34 100%);
    box-shadow: 0 30px 60px -34px rgba(6, 45, 66, .8);
}

.tr-console-in { position: relative; z-index: 2; }

.tr-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(52px);
    opacity: .55;
    mix-blend-mode: screen;
    pointer-events: none;
}

.tr-orb.a {
    width: 300px;
    height: 300px;
    right: -70px;
    top: -110px;
    background: #22d3ee;
    animation: trFloat 10s ease-in-out infinite;
}

.tr-orb.b {
    width: 240px;
    height: 240px;
    left: 6%;
    bottom: -140px;
    background: #8b5cf6;
    animation: trFloat 12s ease-in-out infinite reverse;
}

.tr-orb.c {
    width: 180px;
    height: 180px;
    right: 22%;
    bottom: -110px;
    background: #f59e0b;
    opacity: .35;
    animation: trFloat 9s ease-in-out infinite;
}

@keyframes trFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-18px, 22px, 0) scale(1.06); }
}

.tr-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(6px);
    font-size: 11.5px;
    letter-spacing: .5px;
}

.tr-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .22);
}

.tr-console h1 {
    margin: 16px 0 10px;
    font-size: clamp(24px, 4.6vw, 40px);
    line-height: 1.24;
    font-weight: 800;
    letter-spacing: -.6px;
}

.tr-console h1 span {
    background: linear-gradient(100deg, #a5f3fc, #c4b5fd 60%, #fde68a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tr-console p {
    max-width: 720px;
    margin: 0;
    font-size: 13.5px;
    line-height: 1.85;
    color: rgba(255, 255, 255, .78);
}

.tr-console-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.tr-console-stats > div {
    min-width: 118px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .07);
    backdrop-filter: blur(8px);
}

.tr-console-stats b {
    display: block;
    font-size: 19px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.tr-console-stats span {
    font-size: 11px;
    color: rgba(255, 255, 255, .66);
}

/* ---------- 输入面板 ---------- */
.tr-panel {
    padding: 22px;
    border: 1px solid var(--tr-line);
    border-radius: 24px;
    background: var(--tr-card);
    box-shadow: 0 24px 50px -40px rgba(9, 50, 70, .55);
}

.tr-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tr-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 7px;
    border: 1px solid var(--tr-line);
    border-radius: 999px;
    background: var(--tr-bg);
    font-size: 11.5px;
    color: var(--tr-mut);
}

.tr-step b {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tr-1), var(--tr-2));
    color: #fff;
    font-size: 10.5px;
}

.tr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tr-chip {
    cursor: pointer;
    padding: 7px 13px;
    border: 1px solid var(--tr-line);
    border-radius: 999px;
    background: var(--tr-card);
    color: var(--tr-mut);
    font-size: 12px;
    transition: .16s;
}

.tr-chip:hover {
    color: var(--tr-2);
    border-color: var(--tr-2);
    transform: translateY(-1px);
}

.tr-chip.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(120deg, var(--tr-1), var(--tr-2));
    font-weight: 600;
    box-shadow: 0 10px 22px -14px rgba(37, 99, 235, .8);
}

.tr-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 14px;
}

.tr-field { min-width: 0; }

.tr-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tr-mut);
}

.tr-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 46px;
    border: 1px solid var(--tr-line);
    border-radius: 13px;
    background: var(--tr-bg);
    transition: border-color .16s, box-shadow .16s, background .16s;
}

.tr-input-wrap:focus-within {
    border-color: var(--tr-1);
    background: var(--tr-card);
    box-shadow: 0 0 0 4px rgba(14, 165, 164, .14);
}

.tr-input,
.tr-select {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--tr-ink);
    font-size: 14px;
    font-family: inherit;
    -moz-appearance: textfield;
}

.tr-input::-webkit-outer-spin-button,
.tr-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.tr-select { cursor: pointer; }

.tr-unit {
    flex: 0 0 auto;
    font-size: 11.5px;
    color: var(--tr-mut);
    white-space: nowrap;
}

.tr-help {
    margin: 6px 0 0;
    font-size: 11px;
    line-height: 1.6;
    color: var(--tr-mut);
}

.tr-cta {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 15px 18px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    background: linear-gradient(120deg, #0ea5a4, #2563eb 55%, #7c3aed);
    box-shadow: 0 18px 34px -18px rgba(37, 99, 235, .75);
    overflow: hidden;
    transition: transform .16s, box-shadow .16s;
}

.tr-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px -18px rgba(37, 99, 235, .85);
}

.tr-cta:active { transform: translateY(0); }

.tr-cta::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .48) 48%, transparent 64%);
    transform: translateX(-130%);
    animation: trShine 3.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes trShine {
    0%, 55% { transform: translateX(-130%); }
    85%, 100% { transform: translateX(130%); }
}

.tr-cta--ghost {
    margin-top: 12px;
    color: var(--tr-2);
    background: var(--tr-card);
    border: 1px dashed var(--tr-line);
    box-shadow: none;
    font-weight: 600;
}

.tr-cta--ghost:hover { box-shadow: none; border-color: var(--tr-2); }
.tr-cta--ghost::after { display: none; }

/* ---------- Bento 结果 ---------- */
.tr-bento {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.tr-tile {
    position: relative;
    grid-column: span 3;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--tr-line);
    border-radius: 22px;
    background: var(--tr-card);
    overflow: hidden;
    box-shadow: 0 24px 48px -40px rgba(9, 50, 70, .6);
    animation: trRise .5s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes trRise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.tr-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(140deg, rgba(14, 165, 164, .45), transparent 42%, rgba(124, 58, 237, .34));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.tr-tile--hero {
    grid-column: span 4;
    color: #fff;
    border-color: transparent;
    background:
        radial-gradient(120% 150% at 100% 0%, rgba(124, 58, 237, .55), transparent 55%),
        linear-gradient(135deg, #083344, #0b3b57 52%, #171a3c);
}

.tr-tile--hero::before { opacity: .8; }

.tr-tile--hero.is-bad {
    background:
        radial-gradient(120% 150% at 100% 0%, rgba(239, 68, 68, .5), transparent 55%),
        linear-gradient(135deg, #3b0d0d, #4c1d1d 60%, #1f1020);
}

.tr-tile--verdict {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    background: linear-gradient(140deg, rgba(14, 165, 164, .12), rgba(37, 99, 235, .05));
}

.tr-tile--kpi { grid-column: span 2; text-align: center; }

.tr-tile--wide { grid-column: span 6; }

.tr-tile--note {
    grid-column: span 6;
    background: linear-gradient(135deg, rgba(245, 158, 11, .1), transparent 70%);
    font-size: 12.5px;
    line-height: 1.85;
    color: var(--tr-mut);
}

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

.tr-hero-label {
    font-size: 12px;
    letter-spacing: .4px;
    color: rgba(255, 255, 255, .72);
}

.tr-hero-tag {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .1);
    font-size: 10.5px;
    color: rgba(255, 255, 255, .86);
}

.tr-hero-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 6px;
}

.tr-hero-main { min-width: 0; flex: 1; }

.tr-hero-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
}

.tr-tile--verdict.is-good {
    background: linear-gradient(140deg, rgba(22, 163, 74, .14), rgba(37, 99, 235, .05));
}

.tr-tile--verdict.is-warn {
    background: linear-gradient(140deg, rgba(245, 158, 11, .16), rgba(239, 68, 68, .05));
}

.tr-tile--verdict.is-bad {
    background: linear-gradient(140deg, rgba(239, 68, 68, .15), rgba(124, 58, 237, .05));
}

.tr-hero-num {
    font-size: clamp(36px, 7vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.4px;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(100deg, #ffffff, #a5f3fc 52%, #ddd6fe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tr-hero-unit {
    margin-left: 6px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, .72);
    letter-spacing: 0;
}

.tr-hero-sub {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.72;
    color: rgba(255, 255, 255, .72);
}

.tr-ring {
    --c: #22d3ee;
    --p: 0%;
    position: relative;
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: conic-gradient(var(--c) var(--p), rgba(255, 255, 255, .16) 0);
    display: grid;
    place-items: center;
}

.tr-ring::after {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: #0d2f45;
}

.tr-ring-in {
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 1.2;
}

.tr-ring-in b {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.tr-ring-in span {
    display: block;
    margin-top: 2px;
    font-size: 9.5px;
    color: rgba(255, 255, 255, .68);
}

/* verdict */
.tr-vd-ico { font-size: 22px; line-height: 1; }
.tr-vd-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    color: var(--tr-1);
}
.tr-vd-text {
    font-size: 12.5px;
    line-height: 1.78;
    color: var(--tr-ink);
}
.tr-vd-text em {
    font-style: normal;
    font-weight: 800;
    color: var(--tr-2);
}

/* KPI */
.tr-kpi-v {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.5px;
    font-variant-numeric: tabular-nums;
}
.tr-kpi-k {
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--tr-mut);
}
.tr-kpi-s {
    margin-top: 4px;
    font-size: 10.5px;
    color: var(--tr-mut);
}

/* 区块标题 */
.tr-tile-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
}
.tr-tile-head span {
    font-size: 11px;
    font-weight: 400;
    color: var(--tr-mut);
}

/* 对比条 */
.tr-bars { display: grid; gap: 12px; }

.tr-bar-row {
    display: grid;
    grid-template-columns: 92px 1fr auto;
    align-items: center;
    gap: 10px;
}

.tr-bar-name {
    font-size: 11.5px;
    color: var(--tr-mut);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tr-bar-track {
    height: 12px;
    border-radius: 999px;
    background: var(--tr-bg);
    box-shadow: inset 0 0 0 1px var(--tr-line);
    overflow: hidden;
}

.tr-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    transform-origin: left center;
    animation: trGrow .85s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes trGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.tr-bar-fill.t1 { background: linear-gradient(90deg, #2dd4bf, #0ea5a4); }
.tr-bar-fill.t2 { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.tr-bar-fill.t3 { background: linear-gradient(90deg, #c4b5fd, #7c3aed); }
.tr-bar-fill.t4 { background: linear-gradient(90deg, #fcd34d, #f59e0b); }
.tr-bar-fill.t0 { background: linear-gradient(90deg, #cbd5e1, #94a3b8); }

.tr-bar-val {
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 表格适配 */
.tr-tile .hc-table-wrap { margin-top: 0; border-color: var(--tr-line); }
.tr-tile .hc-table th { background: var(--tr-bg); }

/* 提示 */
.tr-hint {
    margin: 12px 0 0;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--tr-mut);
    text-align: center;
}

/* AI 结果 */
.tr-page .hc-ai-result { margin-top: 12px; }

/* ---------- 顶部提示条 ---------- */
.detail-wrap .st-tip {
    display: block;
    margin: 0 0 18px;
    padding: 13px 16px;
    border: 1px solid var(--st-tip-line, rgba(13, 74, 92, .14));
    border-left: 4px solid var(--st-tip-accent, #0ea5a4);
    border-radius: 14px;
    background: var(--st-tip-bg, rgba(14, 165, 164, .08));
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--st-tip-ink, #0b2230);
}

.detail-wrap .st-tip b {
    font-weight: 700;
    color: var(--st-tip-accent, #0ea5a4);
}

.detail-wrap .st-tip.is-warn {
    --st-tip-accent: #d97706;
    --st-tip-bg: rgba(245, 158, 11, .1);
    --st-tip-line: rgba(245, 158, 11, .26);
}

.detail-wrap .st-tip.is-bad {
    --st-tip-accent: #dc2626;
    --st-tip-bg: rgba(239, 68, 68, .09);
    --st-tip-line: rgba(239, 68, 68, .24);
}

[data-theme="dark"] .detail-wrap .st-tip {
    --st-tip-ink: #dbeaf0;
    --st-tip-line: rgba(148, 190, 205, .2);
    --st-tip-bg: rgba(14, 165, 164, .12);
}

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
    .tr-tile--hero { grid-column: span 6; }
    .tr-tile--verdict { grid-column: span 6; }
    .tr-tile--kpi { grid-column: span 3; }
}

@media (max-width: 560px) {
    .tr-console { padding: 26px 20px 24px; border-radius: 22px; }
    .tr-panel { padding: 16px; border-radius: 20px; }
    .tr-tile { padding: 15px; border-radius: 18px; }
    .tr-tile--kpi { grid-column: span 6; }
    .tr-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tr-form .tr-field--full { grid-column: span 2; }
    .tr-hero-num { font-size: 34px; }
    .tr-ring { flex-basis: 78px; width: 78px; height: 78px; }
    .tr-ring-in b { font-size: 13px; }
    .tr-bar-row { grid-template-columns: 78px 1fr auto; gap: 8px; }
    .tr-console-stats > div { flex: 1 1 40%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .tr-orb, .tr-cta::after, .tr-tile, .tr-bar-fill { animation: none !important; }
}
