/* =========================================================================
   OrangeCloud
   ========================================================================= */

:root {
    --bg: #f7f7f8;
    --surface: #ffffff;
    --surface-2: #fbfbfc;
    --text: #15181d;
    --text-2: #4b5563;
    --muted: #8a919c;
    --line: #e6e7ea;
    --line-2: #d6d8dd;
    --accent: #ea580c;
    --accent-hover: #c2410c;
    --accent-soft: #fff4ed;
    --green: #16794c;
    --green-soft: #f0f8f4;
    --red: #c02b2b;
    --red-soft: #fdf4f4;
    --warn: #8a5a12;
    --warn-soft: #fdf8ec;
    --radius: 8px;
    --radius-sm: 6px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14.5px; }

p {
    margin: 0;
}

a {
    color: var(--text);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

code {
    font-family: var(--mono);
    font-size: 12.5px;
    background: #f1f2f4;
    border-radius: 4px;
    padding: 1px 5px;
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

.main {
    padding: 24px 0 56px;
}

.icon {
    flex-shrink: 0;
    vertical-align: middle;
}

.muted { color: var(--muted); }
.text-sm { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); letter-spacing: 0.04em; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------- 按钮 */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: #f1f2f4;
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover {
    background: #e9eaee;
    color: var(--text);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--line-2);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface-2);
    border-color: #c3c6cc;
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
}

.btn-ghost:hover {
    background: #f1f2f4;
    color: var(--text);
}

.btn-danger {
    background: transparent;
    border-color: #eccaca;
    color: var(--red);
}

.btn-danger:hover {
    background: var(--red-soft);
    border-color: #e2b4b4;
    color: #a11f1f;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12.5px;
    border-radius: 5px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* ---------------------------------------------------------------- 表单 */

.field {
    margin-bottom: 16px;
}

.field > label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-2);
}

.field .hint {
    display: block;
    margin-top: 5px;
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 400;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    appearance: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

textarea {
    min-height: 88px;
    resize: vertical;
}

select {
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%238a919c' d='M5 6 0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12);
}

input[type="file"] {
    font-family: inherit;
    font-size: 13px;
    color: var(--text-2);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-2);
    cursor: pointer;
}

.check input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
}

.check-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    background: var(--surface-2);
}

.check-item {
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
}

.check-item:last-child {
    border-bottom: 0;
}

.check-item input {
    margin-top: 3px;
}

/* ---------------------------------------------------------------- 提示 */

.alert {
    padding: 10px 12px;
    margin-bottom: 16px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 13px;
}

.alert-success {
    background: var(--green-soft);
    border-color: #cfe8db;
    color: #146c43;
}

.alert-error {
    background: var(--red-soft);
    border-color: #f0cccc;
    color: #a11f1f;
}

.alert-warn {
    background: var(--warn-soft);
    border-color: #eee0bd;
    color: var(--warn);
}

.alert-info {
    background: #f4f6fa;
    border-color: #dfe3ea;
    color: #3d4a5c;
}

/* ---------------------------------------------------------------- 标记 */

.badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f1f2f4;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.7;
    white-space: nowrap;
}

.badge-orange { background: var(--accent-soft); color: var(--accent-hover); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: #f1f2f4; color: var(--muted); }
.badge-blue { background: #f1f5fb; color: #33507a; }

.meta-tag {
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-2);
}

.text-link:hover {
    color: var(--accent-hover);
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-button:hover {
    color: #fff;
}

/* ---------------------------------------------------------------- 卡片 */

.card {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.card + .card {
    margin-top: 16px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.card-head h2 {
    font-size: 15px;
}

.card-sub {
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.grid-2 > .card {
    margin-top: 0;
}

.divider {
    height: 1px;
    margin: 18px 0;
    background: var(--line);
}

.kv {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 8px 12px;
    margin: 0;
    font-size: 13px;
}

.kv dt {
    color: var(--muted);
}

.kv dd {
    margin: 0;
    color: var(--text-2);
    word-break: break-all;
}

.plain-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.plain-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.plain-list li:last-child {
    border-bottom: 0;
}

.plain-list .name {
    font-weight: 500;
    word-break: break-all;
}

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 11px 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.brand:hover {
    color: var(--text);
}

.brand-icon {
    color: var(--accent);
}

.brand-dark {
    color: #f3f4f6;
    font-size: 14px;
}

.brand-dark:hover {
    color: #fff;
}

.brand-dark .brand-icon {
    color: #fb923c;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 5px 9px;
    border-radius: 5px;
    color: var(--text-2);
    font-size: 13px;
}

.nav-link:hover {
    background: #f1f2f4;
    color: var(--text);
}

.nav-link.active {
    color: var(--text);
    font-weight: 500;
}

.footer {
    padding: 20px 0 28px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.footer p {
    margin: 0;
}

/* ---------------------------------------------------------------- 入口 */

.gate {
    max-width: 400px;
    margin: 9vh auto 0;
}

.gate-head {
    margin-bottom: 18px;
}

.gate-head h1 {
    font-size: 21px;
    font-weight: 600;
}

.gate-head p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12.5px;
}

.gate-list {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.gate-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

.gate-item:last-child {
    border-bottom: 0;
}

.gate-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.gate-icon {
    color: var(--muted);
    display: inline-flex;
}

.gate-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.gate-body strong {
    font-size: 14px;
    font-weight: 500;
}

.gate-body small {
    color: var(--muted);
    font-size: 12px;
}

.gate-arrow {
    color: #b6bac2;
}

.gate-notice {
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

/* ---------------------------------------------------------------- 登录 */

.auth-wrap {
    max-width: 370px;
    margin: 10vh auto 0;
}

.auth-head {
    margin-bottom: 16px;
}

.auth-head h1 {
    font-size: 20px;
    font-weight: 600;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 13px;
    font-size: 12.5px;
}

.auth-links a {
    color: var(--muted);
}

.auth-links a:hover {
    color: var(--accent-hover);
}

.auth-hint {
    margin-top: 13px;
    color: var(--muted);
    font-size: 12px;
}

/* ---------------------------------------------------------------- 兑换 */

.redeem-card {
    max-width: 400px;
    margin: 10vh auto 0;
}

.redeem-error {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #f0cccc;
    border-radius: var(--radius-sm);
    background: var(--red-soft);
    color: #a11f1f;
    font-size: 13px;
    line-height: 1.7;
}

.redeem-error strong {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
    font-size: 13px;
}

.cooldown-timer {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    margin-top: 8px;
    font-size: 12.5px;
    color: #a11f1f;
}

.cooldown-timer b {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
}

.code-input {
    width: 100%;
    padding: 12px 14px !important;
    text-align: center;
    font-family: var(--mono);
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.grant-list {
    margin-top: 22px;
}

.grant-title {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11.5px;
}

.grant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
}

.grant-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.grant-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 11.5px;
}

/* ---------------------------------------------------------------- 兑换结果 */

.result-banner {
    padding: 18px 20px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    background: #17191e;
    color: #eceef2;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.result-item {
    min-width: 0;
}

.result-label {
    display: block;
    margin-bottom: 4px;
    color: #9299a6;
    font-size: 11.5px;
}

.result-value {
    display: block;
    font-size: 14.5px;
    font-weight: 500;
    word-break: break-all;
}

.result-value.countdown-value {
    color: #fdba74;
    font-family: var(--mono);
    font-size: 17px;
}

.result-value.ready {
    color: #86efac;
}

.result-foot {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #9299a6;
    font-size: 11.5px;
}

.result-foot .inline-form {
    margin-left: auto;
}

.result-foot .link-button {
    margin-left: 0;
}

/* ---------------------------------------------------------------- 表格 */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

table.table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 13px;
}

table.table th {
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-align: left;
    white-space: nowrap;
}

table.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.table tbody tr:last-child td {
    border-bottom: 0;
}

table.table tbody tr:hover td {
    background: #fafafa;
}

table.table td.actions {
    white-space: nowrap;
    text-align: right;
}

table.table td.actions .btn {
    margin-left: 4px;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 180px;
}

.file-icon {
    color: #a7adb8;
    flex-shrink: 0;
}

.file-name-text {
    font-weight: 500;
    word-break: break-all;
}

.code-label {
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text);
}

/* ---------------------------------------------------------------- 分页 */

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.page-link {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12px;
}

.page-link:hover {
    border-color: var(--line-2);
    color: var(--text);
}

.page-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.page-info {
    color: var(--muted);
    font-size: 11.5px;
}

/* ---------------------------------------------------------------- 存储 */

.quota {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 13px 18px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.quota-info {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.quota-info strong {
    font-size: 15px;
    font-weight: 600;
}

.quota-bar-wrap {
    flex: 1;
    min-width: 150px;
}

.quota-bar {
    height: 5px;
    border-radius: 999px;
    background: #eef0f2;
    overflow: hidden;
}

.quota-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
}

.quota-bar > span.danger {
    background: var(--red);
}

.quota-meta {
    color: var(--muted);
    font-size: 11.5px;
}

/* ---------------------------------------------------------------- 统计 */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--line);
    overflow: hidden;
}

.stat-card {
    padding: 13px 15px;
    background: var(--surface);
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11.5px;
}

.stat-value {
    margin: 3px 0 1px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.stat-sub {
    color: var(--muted);
    font-size: 11px;
}

/* ---------------------------------------------------------------- 空状态 */

.empty-state {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
}

.empty-state h1 {
    margin: 10px 0 6px;
    color: var(--text);
    font-size: 17px;
}

.empty-state p {
    margin: 0 0 12px;
    font-size: 13px;
}

.empty-icon {
    display: flex;
    justify-content: center;
    color: #c4c8cf;
}

/* ---------------------------------------------------------------- 上传 */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 22px;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.dropzone input[type="file"] {
    display: none;
}

.upload-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.upload-item {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 12.5px;
}

.upload-item-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}

.upload-name {
    font-weight: 500;
    word-break: break-all;
}

.upload-status {
    color: var(--muted);
    white-space: nowrap;
}

.upload-status.ok { color: var(--green); }
.upload-status.err { color: var(--red); }

.upload-progress {
    height: 4px;
    border-radius: 999px;
    background: #eef0f2;
    overflow: hidden;
}

.upload-progress > span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width 0.2s ease;
}

.upload-progress-lg {
    height: 6px;
    margin-top: 14px;
}

.upload-status-line {
    min-height: 16px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.upload-status-line.is-error {
    color: var(--red);
}

[hidden] {
    display: none !important;
}

/* ---------------------------------------------------------------- 工具条 */

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.toolbar input[type="search"],
.toolbar input[type="text"] {
    max-width: 220px;
}

.form-inline {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.form-inline .field {
    margin-bottom: 0;
    min-width: 110px;
    flex: 1;
}

/* ---------------------------------------------------------------- 文件选择 */

.file-field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-field-name {
    color: var(--muted);
    font-size: 12.5px;
    word-break: break-all;
}

/* ---------------------------------------------------------------- 后台 */

.admin-body {
    background: #f5f6f7;
}

.side-toggle {
    display: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: 220px;
    padding: 14px 10px;
    background: #171a1f;
    color: #a9b0ba;
    overflow-y: auto;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 16px;
}

.side-close {
    display: none;
    color: #8b93a1;
    cursor: pointer;
}

.side-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: none;
    color: #a9b0ba;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.side-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #eceef2;
}

.side-link.active {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    box-shadow: inset 2px 0 0 var(--accent);
}

.side-foot {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side-backdrop {
    display: none;
}

.admin-main {
    margin-left: 220px;
    min-height: 100vh;
}

.admin-top {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 26px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.admin-title h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.admin-title p {
    margin: 1px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: var(--text-2);
    font-size: 12.5px;
}

.hamburger {
    display: none;
    color: var(--text-2);
    cursor: pointer;
}

.admin-content {
    padding: 20px 26px 40px;
}

.admin-content .card + .card {
    margin-top: 16px;
}

/* ---------------------------------------------------------------- 轻提示 */

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 200;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: #17191e;
    color: #f3f4f6;
    font-size: 12.5px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    #side-toggle:checked ~ .sidebar {
        transform: translateX(0);
    }

    #side-toggle:checked ~ .side-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(16, 18, 22, 0.42);
    }

    .side-close {
        display: block;
    }

    .admin-main {
        margin-left: 0;
    }

    .hamburger {
        display: block;
    }

    .admin-top {
        padding: 12px 18px;
    }

    .admin-content {
        padding: 16px 18px 32px;
    }
}

@media (max-width: 760px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 16px;
    }

    .main {
        padding: 18px 0 40px;
    }

    .topbar-inner {
        flex-wrap: wrap;
        gap: 6px;
        padding: 9px 16px;
    }

    .nav {
        width: 100%;
        gap: 0;
    }

    .nav-link {
        padding: 5px 8px;
    }

    .gate,
    .auth-wrap,
    .redeem-card {
        margin-top: 5vh;
    }

    .card {
        padding: 16px;
        border-radius: 7px;
    }

    .field-row,
    .field-row-3 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .result-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .result-banner {
        padding: 16px;
    }

    .result-value {
        font-size: 14px;
    }

    .result-value.countdown-value {
        font-size: 16px;
    }

    .result-foot {
        gap: 10px;
    }

    .result-foot .link-button {
        margin-left: 0;
    }

    .quota {
        padding: 12px 14px;
        gap: 10px;
    }

    .kv {
        grid-template-columns: 1fr;
        gap: 1px;
    }

    .kv dt {
        margin-top: 7px;
        font-size: 11.5px;
    }

    table.table {
        font-size: 12.5px;
    }

    .admin-top {
        gap: 10px;
        padding: 11px 16px;
    }

    .admin-title h1 {
        font-size: 15px;
    }

    .admin-content {
        padding: 14px 16px 28px;
    }

    .toolbar input[type="search"],
    .toolbar input[type="text"] {
        max-width: 100%;
    }

    .pagination {
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .brand-text {
        font-size: 14px;
    }

    .code-input {
        font-size: 15px;
        letter-spacing: 1px;
    }
}





