* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg: #0a0c14;
    --line: rgba(240, 246, 252, 0.1);
    --line-strong: rgba(240, 246, 252, 0.18);
    --txt: #e6edf3;
    --mut: #9aa4af;
    --dim: #7d8590;
    --acc: #6366f1;
    --acc-soft: rgba(99, 102, 241, 0.12);
    --acc-line: rgba(99, 102, 241, 0.45);
    --panel: rgba(240, 246, 252, 0.03);
}
html { background: var(--bg); scrollbar-gutter: stable; }
body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--txt);
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.75;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(99, 102, 241, 0.35); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(240, 246, 252, 0.14); border-radius: 999px; border: 2px solid var(--bg); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.ic {
    width: 1em; height: 1em; vertical-align: -0.155em;
    display: inline-block; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}

.bg-glow {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(ellipse 70% 42% at 50% 108%, rgba(99, 102, 241, 0.13), transparent 70%);
}

.lab-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    height: 58px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 clamp(16px, 4vw, 36px);
    background: rgba(10, 12, 20, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.lab-logo { display: flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 600; color: var(--txt); letter-spacing: 0.01em; }
.lab-logo img { width: 24px; height: 24px; border-radius: 6px; }
.lab-logo em { font-style: normal; color: var(--mut); font-weight: 400; }
.lab-nav { display: flex; align-items: center; gap: 4px; }
.lab-nav a {
    color: var(--mut); font-size: 13px; padding: 6px 13px; border-radius: 8px;
    transition: color 0.18s ease, background 0.18s ease;
}
.lab-nav a:hover { color: var(--txt); background: rgba(240, 246, 252, 0.06); }
.lab-nav a.active { color: var(--txt); background: rgba(240, 246, 252, 0.09); }

.lab-main { max-width: 980px; margin: 0 auto; padding: 128px clamp(18px, 5vw, 36px) 72px; }

.lab-hero { text-align: center; padding: 20px 0 64px; }
.lab-hero .kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12.5px; color: var(--mut); letter-spacing: 0.12em;
}
.lab-hero .kicker .dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--acc);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
}
.lab-hero h1 {
    margin-top: 22px;
    font-size: clamp(2rem, 5.6vw, 3.4rem);
    font-weight: 300;
    color: #f0f6fc;
    line-height: 1.28;
    letter-spacing: 0.01em;
}
.lab-hero h1 b { font-weight: 500; color: var(--acc); }
.lab-hero .sub {
    margin: 18px auto 0; max-width: 480px;
    font-size: 15px; color: var(--mut); font-weight: 300;
}
.hero-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 24px; border-radius: 10px; font-size: 14px; font-weight: 500;
    cursor: pointer; border: 1px solid transparent;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn.primary { background: var(--acc); color: #fff; }
.btn.primary:hover { background: #7378f3; }
.btn.ghost { background: transparent; color: var(--txt); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: rgba(240, 246, 252, 0.4); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 56px 0 20px; }
.section-head h2 { font-size: 17px; font-weight: 600; color: var(--txt); }
.section-head span { font-size: 12.5px; color: var(--dim); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; }
.tool-card {
    display: flex; flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px; padding: 20px;
    transition: border-color 0.18s ease;
}
.tool-card:hover { border-color: var(--acc-line); }
.t-ico {
    width: 36px; height: 36px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--acc-soft); color: #a5acfb;
    font-size: 16px; margin-bottom: 16px;
}
.tool-card h3 { font-size: 15px; font-weight: 600; color: var(--txt); }
.tool-card p { font-size: 13px; color: var(--mut); margin-top: 6px; flex: 1; }
.t-meta { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.t-tag {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; padding: 2px 9px; border-radius: 999px;
    color: var(--dim); border: 1px solid var(--line);
}
.t-tag.live { color: #7ee2a8; border-color: rgba(126, 226, 168, 0.25); }
.t-tag.live .live-dot { width: 5px; height: 5px; border-radius: 50%; background: #7ee2a8; }
.tool-card.soon { opacity: 0.45; pointer-events: none; }

.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.why-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px; padding: 22px;
}
.why-card .w-ico {
    width: 34px; height: 34px; border-radius: 9px; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--acc-soft); color: #a5acfb; font-size: 15px;
}
.why-card h3 { font-size: 14.5px; font-weight: 600; color: var(--txt); }
.why-card p { font-size: 13px; color: var(--mut); margin-top: 6px; }

.back-line { margin-bottom: 20px; }
.back-line a { color: var(--dim); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; transition: color 0.18s ease; }
.back-line a:hover { color: var(--txt); }

.tool-wrap { display: grid; grid-template-columns: 360px 1fr; gap: 14px; align-items: start; }
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px; padding: 22px;
}
.page-title h1 { font-size: 21px; font-weight: 600; color: #f0f6fc; }
.page-title p { font-size: 13px; color: var(--mut); margin-top: 4px; }

.dropzone {
    margin-top: 20px;
    border: 1.5px dashed rgba(240, 246, 252, 0.2);
    border-radius: 10px; padding: 34px 16px; text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--acc-line); background: var(--acc-soft); }
.dropzone .ic { font-size: 26px; color: var(--mut); }
.dropzone.drag .ic, .dropzone:hover .ic { color: #a5acfb; }
.dropzone .dz-main { color: var(--txt); font-size: 13.5px; margin-top: 10px; }
.dropzone .dz-sub { color: var(--dim); font-size: 12px; margin-top: 3px; }

.file-chip {
    display: none; align-items: center; gap: 9px;
    margin-top: 12px; padding: 9px 12px;
    background: rgba(240, 246, 252, 0.04); border: 1px solid var(--line);
    border-radius: 9px; font-size: 12.5px; color: var(--txt);
}
.file-chip.show { display: flex; }
.file-chip .ic { color: #a5acfb; font-size: 15px; }
.file-chip .fc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .fc-dur { color: var(--dim); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.file-chip .fc-x { cursor: pointer; color: var(--dim); display: flex; padding: 2px; border-radius: 5px; }
.file-chip .fc-x:hover { color: #f87171; }

.lab-field { margin-top: 16px; }
.lab-field label { display: block; font-size: 12.5px; color: var(--mut); margin-bottom: 7px; }
select {
    width: 100%; padding: 9px 11px; border-radius: 9px;
    background: rgba(10, 12, 20, 0.8); border: 1px solid var(--line-strong);
    color: var(--txt); font-size: 13.5px; outline: none; font-family: inherit;
    transition: border-color 0.18s ease;
}
select:focus-visible { border-color: var(--acc-line); }
select option { background: #10131d; }

.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin-top: 18px; padding: 11px 18px;
    background: var(--acc); color: #fff; font-weight: 500; font-size: 14px;
    border: none; border-radius: 10px; cursor: pointer;
    transition: background 0.18s ease, opacity 0.18s ease;
}
.btn-primary:hover:not(:disabled) { background: #7378f3; }
.btn-primary:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin-top: 10px; padding: 10px 18px;
    background: transparent;
    color: var(--mut); font-weight: 400; font-size: 13.5px;
    border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}
.btn-ghost:hover:not(:disabled) { color: var(--txt); border-color: rgba(240, 246, 252, 0.4); }
.btn-ghost:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-ghost.rec { border-color: rgba(248, 113, 113, 0.45); color: #fca5a5; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }

.result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.result-head h2 { font-size: 15.5px; font-weight: 600; color: var(--txt); }
.res-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.res-actions button {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 13px; font-size: 12.5px; border-radius: 8px;
    background: transparent; border: 1px solid var(--line-strong);
    color: var(--mut); cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}
.res-actions button:hover:not(:disabled) { color: var(--txt); border-color: rgba(240, 246, 252, 0.4); }
.res-actions button:disabled { opacity: 0.35; cursor: not-allowed; }

.seg-list { max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin-top: 16px; }
.seg {
    display: flex; gap: 14px; padding: 8px 13px;
    background: rgba(240, 246, 252, 0.025); border: 1px solid rgba(240, 246, 252, 0.05);
    border-radius: 8px; font-size: 14px;
}
.seg .ts {
    color: #a5acfb; font-size: 11.5px; white-space: nowrap; padding-top: 3px;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; min-width: 88px;
}
.seg .tx { color: var(--txt); word-break: break-word; }

.empty { text-align: center; color: var(--dim); padding: 72px 10px; font-size: 13px; }
.empty .ic { font-size: 32px; color: #30363d; margin-bottom: 10px; display: block; }

.status-line { margin-top: 16px; font-size: 12.5px; color: var(--mut); min-height: 19px; }
.status-line.err { color: #fca5a5; }
.status-line.ok { color: #7ee2a8; }
.status-line .bar { height: 3px; border-radius: 999px; background: rgba(240, 246, 252, 0.08); overflow: hidden; margin-top: 8px; display: none; }
.status-line .bar.show { display: block; }
.status-line .bar i { display: block; height: 100%; width: 0%; border-radius: 999px; background: var(--acc); transition: width 0.25s ease; }
.hint { font-size: 12px; color: var(--dim); margin-top: 14px; }

.lab-footer {
    border-top: 1px solid var(--line);
    padding: 28px 20px 40px; text-align: center;
    color: var(--dim); font-size: 12.5px;
}
.lab-footer a { color: var(--mut); }
.lab-footer a:hover { color: var(--txt); }
.lab-footer .sep { margin: 0 10px; opacity: 0.35; }

#labBoot {
    position: fixed; inset: 0; z-index: 3000;
    background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
#labBoot.hide { opacity: 0; transform: scale(1.04); pointer-events: none; }
#labBoot .boot-rings { position: relative; width: 56px; height: 56px; }
#labBoot .boot-rings i { position: absolute; border-radius: 50%; }
#labBoot .boot-rings i:nth-child(1) {
    width: 56px; height: 56px;
    border: 2.5px solid rgba(99, 102, 241, 0.15); border-top-color: var(--acc);
    animation: labBootSpin 1.1s linear infinite;
}
#labBoot .boot-rings i:nth-child(2) {
    width: 36px; height: 36px; top: 10px; left: 10px;
    border: 2.5px solid rgba(240, 246, 252, 0.1); border-bottom-color: rgba(240, 246, 252, 0.55);
    animation: labBootSpin 1.5s linear infinite reverse;
}
@keyframes labBootSpin { to { transform: rotate(360deg); } }
#labBoot .boot-dots { display: grid; grid-template-columns: repeat(8, 5px); gap: 7px; }
#labBoot .boot-dots i {
    width: 5px; height: 5px; border-radius: 1.5px; background: rgba(240, 246, 252, 0.5);
    opacity: 0.3; transform: scale(0.72);
    animation: labBootDot 1.4s ease-in-out infinite;
    animation-delay: calc(var(--i) * 42ms);
}
#labBoot .boot-dots i:nth-child(4n+1) { background: var(--acc); }
@keyframes labBootDot { 45% { opacity: 1; transform: scale(1); } }
#labBoot .boot-domain {
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 17px; font-weight: 500; letter-spacing: 0.2em; color: var(--mut);
    text-indent: 0.2em;
}
#labBoot .boot-bar { width: 190px; height: 3px; border-radius: 999px; background: rgba(240, 246, 252, 0.08); overflow: hidden; }
#labBoot .boot-bar i { display: block; width: 0%; height: 100%; border-radius: 999px; background: var(--acc); transition: width 0.3s ease; }
#labBoot .boot-bar.idle i { width: 36%; animation: labBootSlide 1.2s ease-in-out infinite; }
@keyframes labBootSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(300%); } }
#labBoot .boot-pct { font-size: 12px; color: #a5acfb; font-family: ui-monospace, Consolas, monospace; min-height: 17px; }
#labBoot .boot-sub { font-size: 12px; color: var(--dim); }

@media (prefers-reduced-motion: reduce) {
    #labBoot .boot-dots i, #labBoot .boot-rings i, .t-tag .live-dot { animation: none !important; }
}
@media (max-width: 880px) {
    .tool-wrap { grid-template-columns: 1fr; }
    .seg-list { max-height: none; }
}
@media (max-width: 640px) {
    .lab-main { padding: 96px 16px 48px; }
    .lab-hero { padding: 4px 0 44px; }
    .tool-grid { grid-template-columns: 1fr; }
    .panel { padding: 18px; }
    .seg .ts { min-width: 70px; }
    .hero-cta .btn { width: 100%; justify-content: center; }
}
