:root {
    color-scheme: light;
    --bg: #f2f5f7;
    --card: #ffffff;
    --text: #17222b;
    --sub: #60717d;
    --line: #dce4e8;
    --accent: #086b63;
    --accent-strong: #07544e;
    --danger: #a72b2b;
    --danger-bg: #fff1f1;
    --shadow: 0 16px 48px rgba(22, 42, 52, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 90% 0, rgba(8, 107, 99, .12), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

header,
main {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 34px 0 22px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(28px, 5vw, 44px);
}

h2 {
    margin-bottom: 8px;
    font-size: 20px;
}

.eyebrow {
    margin-bottom: 7px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
}

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

.login {
    width: min(460px, 100%);
    margin: 7vh auto;
}

.login p {
    color: var(--sub);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.stats .card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats span {
    color: var(--sub);
    font-size: 13px;
}

.stats strong {
    font-size: 34px;
}

.release-card {
    margin-bottom: 14px;
}

.section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.upload-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--sub);
    font-size: 13px;
    font-weight: 700;
}

label.wide {
    grid-column: 1 / -1;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfc;
    color: var(--text);
    padding: 12px 13px;
    outline: none;
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8, 107, 99, .12);
}

textarea {
    resize: vertical;
}

button {
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-weight: 800;
    padding: 12px 18px;
}

button:hover {
    background: var(--accent-strong);
}

button:disabled {
    cursor: wait;
    opacity: .55;
}

button.ghost {
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
}

button.danger {
    background: var(--danger);
}

button.small {
    padding: 8px 12px;
    font-size: 12px;
}

#release-form button[type="submit"],
.login button {
    margin-top: 16px;
}

.pill {
    border-radius: 999px;
    background: #e9f4f2;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    padding: 7px 10px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 840px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 10px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--sub);
    font-size: 12px;
}

td {
    font-size: 13px;
}

.device-name {
    display: block;
    font-weight: 800;
}

.device-id {
    color: var(--sub);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 10px;
}

.state {
    display: inline-block;
    border-radius: 999px;
    background: #eef3f4;
    color: var(--sub);
    padding: 5px 8px;
    white-space: nowrap;
}

.state.online {
    background: #e8f6ee;
    color: #176b3a;
}

.state.banned {
    background: var(--danger-bg);
    color: var(--danger);
}

.message,
.error {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--sub);
}

.error {
    color: var(--danger);
}

.empty {
    color: var(--sub);
    padding: 28px 10px;
    text-align: center;
}

.hidden {
    display: none !important;
}

@media (max-width: 720px) {
    header,
    main {
        width: calc(100% - 24px);
    }

    header {
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: 14px;
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .stats,
    .form-grid,
    .upload-row {
        grid-template-columns: 1fr;
    }

    .login {
        margin-top: 3vh;
    }

    .card {
        padding: 18px;
        border-radius: 18px;
    }

    .section-heading {
        align-items: center;
    }

    input,
    textarea {
        font-size: 16px;
    }

    button {
        min-height: 44px;
    }

    .table-wrap {
        overflow: visible;
    }

    table,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    thead {
        display: none;
    }

    tbody {
        display: grid;
        gap: 12px;
    }

    tr {
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fbfcfc;
        padding: 10px 12px;
    }

    td {
        position: relative;
        border: 0;
        padding: 7px 0 7px 96px;
    }

    td::before {
        position: absolute;
        left: 0;
        top: 7px;
        color: var(--sub);
        content: attr(data-label);
        font-size: 12px;
        font-weight: 700;
    }

    td:last-child button {
        width: 100%;
    }

    .device-id {
        word-break: break-all;
    }
}
