:root {
    --bg: #f3f6fb;
    --ink: #172033;
    --muted: #66758a;
    --line: #e3eaf3;
    --blue: #1f6feb;
    --blue-dark: #1558c0;
    --red: #c0392b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.bar {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.bar-inner,
.shell {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
}

.bar-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--blue);
    font-weight: 700;
}

.bar strong { font-size: 18px; }

.shell { padding: 28px 0 56px; }

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.release,
.panel,
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(23, 32, 51, 0.04);
}

.release { padding: 22px 22px 16px; position: relative; overflow: hidden; }
.release::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}
.release.win::before { background: #1f6feb; }
.release.pda::before { background: #0f9f6e; }

.release-head, .actions, .top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pill, .tag {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.pill { background: #eef4ff; color: #1f6feb; }
.release.pda .pill { background: #e8f8f1; color: #0b7a54; }
.tag { background: #f4f7fb; color: #66758a; font-weight: 600; }
.tag.force { background: #fff1f0; color: var(--red); }

.version {
    margin: 18px 0 4px;
    font-size: 40px;
    line-height: 1;
    letter-spacing: -0.03em;
}

.meta, .hint { color: var(--muted); font-size: 13px; line-height: 1.6; }
.notes {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f7f9fc;
    font-size: 14px;
}

.link-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    font-size: 13px;
}
.link-row span { color: var(--muted); }
.link-row a {
    color: #245a8a;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.link-row a:hover { text-decoration: underline; }

.panel { padding: 22px; }
.panel-title h2, .panel h2 { margin: 0 0 4px; font-size: 18px; }
.panel-title p { margin: 0 0 18px; }

label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 650; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input, select, textarea {
    width: 100%;
    margin-top: 6px;
    padding: 12px 12px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #fbfcfe;
    font: inherit;
    font-weight: 400;
}
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(31, 111, 235, 0.15);
    border-color: var(--blue);
    background: #fff;
}
input.invalid, select.invalid, textarea.invalid { border-color: var(--red); background: #fff8f8; }
.field-error { min-height: 18px; margin-top: 4px; color: var(--red); font-size: 12px; font-weight: 500; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; margin: 0; }
.label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 650; }
.choice {
    display: flex;
    align-items: stretch;
    height: 48px;
    padding: 4px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #f4f7fb;
}
.row input[name="version"] {
    height: 48px;
    margin-top: 6px;
    padding: 0 12px;
}
.choice-btn {
    flex: 1;
    height: auto;
    margin: 0;
    padding: 0 12px;
    border-radius: 8px;
    background: transparent;
    color: #344054;
    box-shadow: none;
    line-height: 1;
}
.choice-btn:hover { background: transparent; color: var(--ink); }
.choice-btn.on, .choice-btn.on:hover { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(23, 32, 51, 0.08); }
.file-pick {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    padding: 8px;
    border: 1px dashed #c5d2e3;
    border-radius: 12px;
    background: #fbfcfe;
    cursor: pointer;
}
.file-pick input { display: none; }
.file-btn {
    flex: none;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #d5deea;
    font-size: 13px;
    font-weight: 650;
}
.file-name { color: var(--muted); font-size: 13px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick:hover { border-color: var(--blue); background: #f5f9ff; }
.file-pick.invalid { border-color: var(--red); background: #fff8f8; }

button {
    border: 0;
    border-radius: 10px;
    padding: 11px 18px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
button:hover { background: var(--blue-dark); }
button.ghost { background: #fff; color: #344054; border: 1px solid #d5deea; }
.actions { margin-top: 8px; }
.actions .hint { margin: 0; }
button:disabled { opacity: 0.6; cursor: not-allowed; }
.panel.is-uploading .choice,
.panel.is-uploading .file-pick,
.panel.is-uploading input,
.panel.is-uploading textarea,
.panel.is-uploading .check { pointer-events: none; }

.upload-box {
    margin: 4px 0 16px;
    padding: 14px 14px 12px;
    border: 1px solid #d5e4f7;
    border-radius: 12px;
    background: #f5f9ff;
}
.upload-box[hidden] { display: none; }
.upload-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.upload-status { font-size: 14px; }
.upload-percent {
    font-variant-numeric: tabular-nums;
    color: var(--blue);
    font-weight: 700;
}
.upload-track {
    height: 10px;
    margin: 10px 0 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e3edf8;
}
.upload-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1f6feb, #5b9bff);
    transition: width 0.2s linear;
}
.upload-box.waiting .upload-bar {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.28) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.28) 50%,
        rgba(255, 255, 255, 0.28) 75%,
        transparent 75%
    );
    background-size: 16px 16px;
    animation: upload-move 0.8s linear infinite;
}
@keyframes upload-move {
    to { background-position: 16px 0; }
}
.upload-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}
.upload-tip { margin: 8px 0 0; font-size: 13px; line-height: 1.5; }
.upload-cancel { margin-top: 10px; }
.upload-box.fail {
    background: #fff8f8;
    border-color: #f0c8c8;
}
.upload-box.fail .upload-percent,
.upload-box.fail .upload-status { color: var(--red); }
.upload-box.fail .upload-bar { background: #e57373; }
.upload-box.ok {
    background: #f3fbf6;
    border-color: #cfeedd;
}
.upload-box.ok .upload-percent,
.upload-box.ok .upload-status { color: #1e7a46; }

.banner { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; }
.banner.ok { background: #e8f6ee; color: #1e7a46; }
.banner.err { background: #fff5f5; color: var(--red); }

.login-wrap { width: min(460px, calc(100% - 32px)); margin: 12vh auto; }
.login-wrap h1 { margin: 6px 0 0; font-size: 28px; }
.sub { margin: 8px 0 18px; color: var(--muted); }
.card { padding: 22px; }

@media (max-width: 760px) {
    .grid, .row, .actions, .bar-inner { grid-template-columns: 1fr; }
    .actions, .bar-inner { display: flex; flex-direction: column; align-items: stretch; }
    .bar-inner { padding: 14px 0; }
}
