* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f4f7fb;
    color: #1f2937;
    min-height: 100vh;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
}

.page.auth-page {
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.page.narrow {
    width: min(960px, calc(100% - 32px));
}

.page.page-shell {
    width: 100%;
    margin: 0;
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    padding: clamp(14px, 2.2vh, 28px) 20px clamp(12px, 1.8vh, 24px);
    border-radius: 0;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.8vh, 24px);
    overflow: hidden;
    overscroll-behavior: none;
    z-index: 20;
}

.app-sidebar-head {
    display: grid;
    gap: clamp(4px, 0.9vh, 8px);
}

.app-sidebar-brand {
    color: #0f172a;
    font-size: clamp(22px, 3.2vh, 28px);
    font-weight: 800;
    text-decoration: none;
    line-height: 1.2;
}

.app-sidebar-subtitle {
    color: #64748b;
    font-size: clamp(12px, 1.6vh, 13px);
    line-height: 1.45;
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    gap: clamp(4px, 0.8vh, 8px);
}

.sidebar-menu-btn,
.sidebar-menu-link {
    width: 100%;
    justify-content: flex-start;
    padding: clamp(10px, 1.6vh, 16px) 18px;
    border-radius: 0;
    background: transparent;
    color: #0f172a;
    border: none;
    border-left: 3px solid transparent;
    font-size: clamp(13px, 1.9vh, 15px);
    line-height: 1.3;
}

.sidebar-menu-link {
    text-decoration: none;
}

.sidebar-menu-btn:hover,
.sidebar-menu-link:hover {
    transform: none;
    filter: none;
    background: #f8fafc;
    color: #0f172a;
}

.sidebar-menu-btn.active,
.sidebar-menu-link.active {
    background: #f1f5f9;
    border-left-color: #2563eb;
    color: #0f172a;
}

.sidebar-user-summary {
    display: grid;
    gap: clamp(4px, 0.7vh, 6px);
    padding: clamp(10px, 1.5vh, 14px) 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.sidebar-user-summary strong {
    color: #0f172a;
    font-size: clamp(15px, 2.2vh, 16px);
}

.sidebar-user-summary span {
    color: #64748b;
    font-size: clamp(12px, 1.7vh, 13px);
    line-height: 1.4;
    word-break: break-all;
}

.app-sidebar-footer {
    display: grid;
    gap: clamp(8px, 1.1vh, 10px);
    flex-shrink: 0;
}

.app-sidebar-footer .theme-toggle {
    width: 100%;
    height: clamp(40px, 5.8vh, 48px);
}

.app-sidebar-footer .btn-secondary,
.app-sidebar-footer .sidebar-menu-link {
    min-height: clamp(40px, 5.8vh, 48px);
    padding-top: 0;
    padding-bottom: 0;
}

.app-main {
    min-width: 0;
    margin-left: 280px;
    padding: 24px 24px 24px 28px;
}

.page-kicker {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.page-heading {
    margin: 6px 0 0;
    font-size: 32px;
    line-height: 1.2;
}

.page-heading-wrap {
    display: grid;
    gap: 2px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.content-stack {
    display: grid;
    gap: 20px;
}

.home-notice-card {
    margin-top: 4px;
    display: grid;
    gap: 10px;
}

.home-notice-card p {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
    text-align: center;
    font-weight: 600;
}

.navbar,
.card,
.auth-box,
.table-wrap,
.hero,
.stats {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.navbar {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.brand {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.theme-toggle {
    --toggle-surface: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    background: var(--toggle-surface);
    color: #0f172a;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.theme-toggle:hover {
    filter: none;
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.theme-icon {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-icon::before,
.theme-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.theme-icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-icon-moon::before {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1e293b;
}

.theme-icon-moon::after {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--toggle-surface);
    transform: translate(calc(-50% + 5px), calc(-50% - 3px));
    box-shadow: -9px 9px 0 -6px rgba(59, 130, 246, 0.55), -2px 13px 0 -7px rgba(59, 130, 246, 0.4);
}

.theme-icon-sun {
    opacity: 0;
    transform: scale(0.55) rotate(-30deg);
}

.theme-icon-sun::before {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.theme-icon-sun::after {
    width: 2px;
    height: 2px;
    border-radius: 999px;
    background: #fbbf24;
    box-shadow:
        0 -11px 0 1px #fbbf24,
        0 11px 0 1px #fbbf24,
        11px 0 0 1px #fbbf24,
        -11px 0 0 1px #fbbf24,
        8px 8px 0 1px #fbbf24,
        -8px 8px 0 1px #fbbf24,
        8px -8px 0 1px #fbbf24,
        -8px -8px 0 1px #fbbf24;
}

.nav-links a,
.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s ease;
}

.btn-primary,
button,
.nav-links a.primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-secondary,
.nav-links a.secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-success {
    background: #16a34a;
    color: #ffffff;
}

button:disabled,
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

button:hover,
.btn:hover,
.nav-links a:hover {
    transform: translateY(-1px);
    filter: brightness(0.97);
}

.hero {
    padding: 32px;
    margin-bottom: 24px;
}

.hero h1,
.auth-box h1,
.card h2,
.table-wrap h2 {
    margin-top: 0;
}

.hero-grid,
.grid-2,
.grid-3 {
    display: grid;
    gap: 20px;
}

.hero-grid {
    grid-template-columns: 1.4fr 1fr;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

[hidden] {
    display: none !important;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.table-wrap,
.stats {
    padding: 24px;
    margin-bottom: 24px;
}

.auth-box {
    width: min(460px, 100%);
    padding: 32px;
}

.auth-head {
    display: grid;
    justify-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.auth-box h1 {
    text-align: center;
    width: 100%;
    margin: 0;
}

.auth-footer {
    margin-top: 6px;
    text-align: right;
}

.auth-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.auth-actions .btn {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 34px;
}

.logo {
    width: 110px;
    height: auto;
    display: block;
    margin: 0 auto 16px;
}

form {
    display: grid;
    gap: 14px;
}

label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
}

.input-error {
    border-color: #dc2626;
}

.form-error {
    margin-top: 6px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.helper,
.muted {
    color: #64748b;
    font-size: 13px;
}

.alert {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: opacity 0.35s ease, transform 0.35s ease;
    max-width: 90%;
    width: max-content;
}

.alert.is-hiding {
    opacity: 0;
    transform: translate(-50%, -10px);
    pointer-events: none;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.price-list,
.summary-list {
    display: grid;
    gap: 12px;
}

.collapsible-card {
    padding-top: 18px;
}

.section-toggle {
    width: 100%;
    background: transparent;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 14px;
    border-radius: 0;
}

.section-toggle:hover {
    transform: none;
    filter: none;
}

.section-toggle h2 {
    margin: 0;
}

.section-toggle-icon {
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
    transform: rotate(0deg);
    transform-origin: center;
}

.section-toggle:hover .section-toggle-icon {
    color: #0f172a;
}

.section-toggle-icon.is-expanded {
    transform: rotate(90deg);
}

.section-content {
    padding-top: 4px;
}

.section-content[hidden] {
    display: none !important;
}

.price-item,
.summary-item,
.stat-item,
.key-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
}

.key-main-info {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 18px;
}

.key-code-wrap {
    min-width: 0;
    flex: 1;
}

.key-info-grid {
    flex-shrink: 0;
    display: grid;
    gap: 16px;
    align-items: stretch;
}

.key-info-grid-status {
    grid-template-columns: 220px 180px 96px;
}

.key-info-grid-simple {
    grid-template-columns: 220px 96px;
}

.key-code-text {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    word-break: break-all;
}

.key-time-wrap,
.key-duration-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
}

.key-time-wrap {
    width: 100%;
}

.key-time-label {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.status-badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

.key-time-text {
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.key-side-meta {
    width: 132px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    flex-shrink: 0;
}

.key-side-meta .inline-form,
.key-side-meta .copy-btn,
.key-side-meta .btn-danger {
    width: 100%;
}

.key-duration-text {
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.key-item.is-uncopied {
    background: #ecfdf5;
}

.key-item.is-uncopied .key-code-text,
.key-item.is-uncopied .key-time-label,
.key-item.is-uncopied .key-time-text,
.key-item.is-uncopied .key-duration-text {
    color: #16a34a;
}

.invalidated-card-item {
    background: #fef2f2;
}

.invalidated-card-item .key-code-text,
.invalidated-card-item .key-time-label,
.invalidated-card-item .key-time-text,
.invalidated-card-item .key-duration-text {
    color: #dc2626;
}

.price-values {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.price-retail,
.price-agent {
    font-size: 16px;
    font-weight: 700;
}

.price-agent {
    color: #16a34a;
}

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

.table-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.table-tools-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}

.table-search-form input {
    width: 240px;
    margin-top: 0;
}

.table-search-form select {
    margin-top: 0;
}

.table-search-form-all-cards {
    flex-wrap: nowrap;
    width: auto;
}

.table-search-form-all-cards input {
    width: 280px;
    flex: 0 0 280px;
}

.table-search-form-all-cards select {
    width: 180px;
    min-width: 180px;
    flex: 0 0 180px;
}

.table-search-form-all-cards .btn,
.table-search-form-all-cards button {
    flex-shrink: 0;
    white-space: nowrap;
}

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

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

th {
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status.pending {
    background: #fef3c7;
    color: #92400e;
}

.status.active {
    background: #dcfce7;
    color: #166534;
}

.status.banned {
    background: #fee2e2;
    color: #991b1b;
}

.card-source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.card-source-badge-paid {
    background: #dcfce7;
    color: #166534;
}

.card-source-badge-redeem {
    background: #fee2e2;
    color: #dc2626;
}

.card-source-badge-manual {
    background: #e2e8f0;
    color: #475569;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
    width: auto;
    min-width: 96px;
    margin-top: 0;
}

.copy-btn {
    white-space: nowrap;
}

.order-action-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.redeem-action-group {
    justify-content: center;
}

.redeem-card-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #ecfdf5;
}

.redeem-card-result-label {
    color: #16a34a;
    font-size: 13px;
    font-weight: 700;
}

.redeem-card-result-code {
    color: #15803d;
    font-size: 16px;
    font-weight: 800;
    word-break: break-all;
}

.order-view-btn {
    min-width: 96px;
}

.admin-orders-table {
    table-layout: fixed;
}

.admin-orders-table .col-order-id {
    width: 56px;
}

.admin-orders-table .col-order-user {
    width: 170px;
}

.admin-orders-table .col-order-amount {
    width: 110px;
}

.admin-orders-table .col-order-status {
    width: 90px;
}

.admin-orders-table .col-order-time {
    width: 132px;
}

.admin-orders-table .col-order-action {
    width: 110px;
}

.order-user-cell {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.order-user-cell strong,
.order-user-cell .muted {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-items-cell {
    display: grid;
    gap: 4px;
}

.order-action-placeholder {
    white-space: nowrap;
}

.order-edit-note {
    margin-bottom: 14px;
    color: #64748b;
    font-size: 13px;
}

.admin-order-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.key-item-editable {
    align-items: flex-start;
}

.admin-order-key-input {
    margin-top: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
}

.admin-order-key-input:disabled {
    color: #0f172a;
    background: #e2e8f0;
    cursor: default;
    opacity: 1;
}

.proof-detail-list {
    display: grid;
    gap: 16px;
}

.proof-detail-item {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 14px;
    background: #f8fafc;
}

.proof-order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.proof-image-preview {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.card-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.dashboard-switcher {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.section-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.section-inline-tabs {
    margin-bottom: 0;
    justify-content: center;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions input {
    width: 180px;
    margin-top: 0;
}

.tab-btn {
    background: #e2e8f0;
    color: #334155;
}

.tab-btn.active {
    background: #2563eb;
    color: #ffffff;
}

.tab-btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.tab-btn-danger.active {
    background: #b91c1c;
    color: #ffffff;
}

.app-sidebar .sidebar-menu-btn,
.app-sidebar .sidebar-menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 16px 18px;
}

.app-sidebar .sidebar-menu-btn:hover,
.app-sidebar .sidebar-menu-link:hover {
    transform: none;
    filter: none;
    background: #f8fafc;
    color: #0f172a;
}

.app-sidebar .sidebar-menu-btn.active,
.app-sidebar .sidebar-menu-link.active {
    background: #f1f5f9;
    border-left-color: #2563eb;
    color: #0f172a;
}

.admin-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-nav .tab-btn {
    padding: 12px 32px;
    font-size: 15px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s ease;
}

.pagination a:hover {
    background: #e2e8f0;
}

.pagination .current {
    background: #2563eb;
    color: #ffffff;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
    z-index: 1000;
}

.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    width: min(420px, 100%);
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    transform: translateY(20px);
    transition: 0.2s ease;
}

.modal-overlay.is-visible .modal-box {
    transform: translateY(0);
}

.modal-box-wide {
    width: min(680px, 100%);
    padding: 24px;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-head h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #dbe3ee;
    background: #f8fafc;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: 0.2s ease;
}

.modal-close:hover {
    background: #eef2f7;
    border-color: #cbd5e1;
    color: #0f172a;
}

.key-list {
    display: grid;
    gap: 12px;
}

.key-list[hidden],
.key-empty[hidden] {
    display: none;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.section-title h2 {
    margin-bottom: 0;
}

.empty {
    padding: 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
    color: #64748b;
}

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

.order-item-option {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.order-item-option:hover {
    border-color: #93c5fd;
}

.order-item-option.is-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.order-item-check-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.order-item-check {
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #0f172a;
    font-weight: 700;
}

.order-item-check span {
    display: block;
}

.order-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.order-qty-row input {
    width: 96px;
    margin-top: 0;
    text-align: center;
    padding: 10px 12px;
}

.order-unit-price {
    margin-top: 10px;
    color: #16a34a;
    font-size: 14px;
    font-weight: 700;
}

.order-total-box {
    border-radius: 14px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.order-pay-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.order-history-list {
    display: grid;
    gap: 16px;
}

.order-history-item {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    background: #f8fafc;
    display: grid;
    gap: 12px;
}

.order-history-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
    align-items: stretch;
}

.order-history-main {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.order-history-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.order-history-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-left: 24px;
    border-left: 1px solid #cbd5e1;
    min-width: 260px;
    gap: 14px;
}

.order-history-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.order-history-meta strong {
    font-size: 20px;
}

.order-history-amount-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.order-history-items {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.order-history-line {
    color: #334155;
    font-weight: 600;
}

.order-expand-btn {
    margin-top: 14px;
    background: #e2e8f0;
    color: #334155;
}

.order-view-keys-btn {
    min-width: 140px;
}

.order-payment-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
}

.payment-chooser {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.payment-chooser:hover {
    transform: translateY(-1px);
    filter: none;
    border-color: #94a3b8;
}

.payment-chooser-body {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-width: 0;
}

.payment-chooser-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-chooser-icon-alipay {
    background: #2f6fed;
    border-radius: 9px;
    color: #ffffff;
}

.payment-chooser-icon-wechat {
    color: #1fb855;
}

.payment-chooser-text {
    line-height: 1;
    text-align: center;
}

.payment-logo {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.payment-logo-wechat {
    width: 24px;
    height: 24px;
}

.order-linked-keys {
    margin-top: 14px;
    display: grid;
    gap: 14px;
}

.order-key-group {
    border-top: 1px dashed #cbd5e1;
    padding-top: 14px;
}

.key-list-dashed .key-item {
    border: 1px dashed #cbd5e1;
    background: #ffffff;
}

.notice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 999;
}

.notice-overlay[hidden] {
    display: none;
}

.notice-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.notice-dialog {
    min-width: min(320px, 100%);
    max-width: 420px;
    padding: 18px 22px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.page.storefront-page {
    width: 100%;
    margin: 0;
    min-height: 100vh;
    padding: 0;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.75), transparent 24%),
        linear-gradient(180deg, #f4f5f7 0%, #eef1f4 48%, #f6f7f9 100%);
}

.storefront-shell {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 48px;
    color: #475569;
}

.store-topbar,
.store-hero,
.store-section,
.store-order-card,
.store-price-card,
.store-feature-card,
.store-stat-card {
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
}

.store-topbar {
    position: static;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border-radius: 24px;
    margin-bottom: 24px;
}

.store-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    min-width: 0;
}

.store-brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.store-brand-text {
    display: grid;
    gap: 4px;
}

.store-brand-text strong {
    color: #0f172a;
    font-size: 18px;
    line-height: 1.2;
}

.store-brand-text span {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.store-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 180px;
}

.store-tag-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.store-tag-label {
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}

.store-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
}

.store-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.store-identity-card {
    min-width: 220px;
    padding: 10px 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    display: grid;
    gap: 4px;
    text-align: left;
}

.store-identity-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.store-identity-value {
    color: #0f172a;
    font-size: 18px;
    line-height: 1.2;
    word-break: break-all;
}

.store-identity-meta {
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
}

.store-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) 340px;
    gap: 24px;
    padding: 34px;
    border-radius: 32px;
    margin-bottom: 24px;
}

.store-hero-main {
    display: grid;
    gap: 18px;
    align-content: center;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: #eef2f6;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.store-hero-main h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.store-hero-main p {
    margin: 0;
    max-width: 760px;
    color: #64748b;
    font-size: 16px;
    line-height: 1.9;
}

.store-hero-actions,
.store-hero-points,
.store-order-tips {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.store-hero-points span,
.store-order-tips span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: #f6f7f8;
    border: 1px solid #e5e7eb;
    color: #667085;
    font-size: 13px;
    font-weight: 700;
}

.store-hero-side {
    display: grid;
    gap: 16px;
}

.store-stat-card {
    padding: 22px;
    border-radius: 24px;
}

.store-stat-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.store-stat-card strong {
    color: #0f172a;
    font-size: 34px;
    line-height: 1;
}

.store-section {
    padding: 28px;
    border-radius: 28px;
    margin-bottom: 24px;
}

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

.store-section-head-main {
    display: grid;
    gap: 8px;
}

.store-section-head-actions {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.store-section-head h2 {
    margin: 0;
    color: #111827;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.15;
}

.store-section-head p {
    margin: 0;
    color: #667085;
    font-size: 15px;
    line-height: 1.8;
}

.store-price-grid,
.store-feature-grid {
    display: grid;
    gap: 18px;
}

.store-price-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 230px));
    justify-content: center;
}

.store-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.store-price-card,
.store-feature-card {
    padding: 22px;
    border-radius: 24px;
}

.store-price-card {
    display: grid;
    gap: 14px;
}

.price-card-content {
    display: grid;
    gap: 12px;
}

.price-card-desc {
    color: #10b981;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 700;
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: 8px;
    text-align: center;
    word-break: break-word;
}

.store-price-tag {
    display: inline-flex;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.store-price-value {
    color: #111827;
    font-size: 34px;
    line-height: 1;
}

.store-price-card p,
.store-feature-card p {
    margin: 0;
    color: #667085;
    font-size: 14px;
    line-height: 1.85;
}

.store-feature-card h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 20px;
}

.store-pricing-form {
    display: grid;
    gap: 18px;
}

.store-service-panel {
    display: grid;
    gap: 12px;
}

.store-renewal-field {
    display: block;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.store-renewal-field input {
    margin-top: 8px;
}

.store-inline-paybar {
    display: grid;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 22px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}

.store-order-foot {
    display: grid;
    gap: 18px;
    margin: 0;
}

.store-order-history-item {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e5e7eb;
}

.storefront-page .page-kicker {
    color: #64748b;
}

.storefront-page .empty {
    border: 1px dashed #d1d5db;
    background: #f8fafc;
    color: #64748b;
}

.storefront-page .order-item-option,
.storefront-page .order-history-item,
.storefront-page .key-list-dashed .key-item,
.storefront-page .key-item,
.storefront-page .summary-item,
.storefront-page .price-item,
.storefront-page .pagination a,
.storefront-page .pagination span,
.storefront-page .payment-chooser {
    background: rgba(255, 255, 255, 0.94);
    border-color: #e5e7eb;
}

.storefront-page .order-item-option:hover {
    border-color: #86efac;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.08);
}

.storefront-page .order-item-option.is-selected {
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: #22c55e;
    box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.18), 0 16px 28px rgba(34, 197, 94, 0.14);
}

.storefront-page .order-item-option.is-selected .store-price-tag {
    background: #dcfce7;
    color: #166534;
}

.storefront-page .order-item-option.is-selected .store-price-value,
.storefront-page .order-item-option.is-selected .muted,
.storefront-page .order-item-option.is-selected .order-item-check {
    color: #166534;
}

.storefront-page .order-item-option.is-selected input {
    border-color: #86efac;
    background: #ffffff;
}

.storefront-page .order-item-check,
.storefront-page .key-code-text,
.storefront-page .order-history-line,
.storefront-page strong,
.storefront-page h2,
.storefront-page .modal-head h2,
.storefront-page .order-total-box {
    color: #111827;
}

.storefront-page .muted,
.storefront-page .key-time-label,
.storefront-page .key-time-text,
.storefront-page .key-duration-text,
.storefront-page .payment-chooser,
.storefront-page .modal-close {
    color: #64748b;
}

.storefront-page .payment-chooser-alipay {
    background: #1677ff;
    border-color: #1677ff;
    color: #ffffff;
}

.storefront-page .payment-chooser-wechat {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

.storefront-page .payment-chooser-alipay .payment-chooser-text,
.storefront-page .payment-chooser-wechat .payment-chooser-text,
.storefront-page .payment-chooser-alipay .payment-chooser-icon,
.storefront-page .payment-chooser-wechat .payment-chooser-icon {
    color: #ffffff;
}

.storefront-page .payment-chooser-alipay:hover {
    border-color: #0b63d8;
    background: #0b63d8;
}

.storefront-page .payment-chooser-wechat:hover {
    border-color: #15803d;
    background: #15803d;
}

.storefront-page .order-total-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.storefront-page .status.pending {
    background: #fef3c7;
    color: #92400e;
}

.storefront-page .status.active {
    background: #dcfce7;
    color: #166534;
}

.storefront-page .btn-primary,
.storefront-page button:not(.btn-secondary):not(.store-card-select-btn),
.storefront-page .nav-links a.primary {
    background: #111827;
    color: #ffffff;
}

.storefront-page .btn-secondary,
.storefront-page .store-card-select-btn,
.storefront-page .nav-links a.secondary {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.storefront-page .btn-success {
    background: #1f2937;
    color: #ffffff;
}

.store-pay-btn {
    gap: 10px;
    min-height: 50px;
    font-size: 15px;
    font-weight: 800;
}

.store-pay-btn-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.store-pay-btn-icon .payment-logo {
    width: 22px;
    height: 22px;
}

.store-pay-btn-wechat {
    background: #16a34a !important;
    color: #ffffff !important;
}

.store-pay-btn-wechat:hover {
    background: #15803d !important;
}

.store-pay-btn-alipay {
    background: #1677ff !important;
    color: #ffffff !important;
}

.store-pay-btn-alipay:hover {
    background: #0b63d8 !important;
}

.store-pay-btn-icon-alipay .payment-logo {
    fill: currentColor;
}

.storefront-page .payment-chooser:hover,
.storefront-page .btn:hover,
.storefront-page button:hover {
    filter: none;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.storefront-page .payment-chooser-icon-alipay {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border-radius: 10px;
}

.storefront-page .payment-chooser-icon-wechat {
    color: #ffffff;
}

@media (max-width: 860px) {
    .storefront-shell {
        width: min(100% - 20px, 1240px);
        padding-top: 14px;
    }

    .store-topbar,
    .store-hero,
    .store-section {
        border-radius: 20px;
    }

    .store-topbar {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .store-tags,
    .store-topbar-actions {
        justify-content: center;
    }

    .store-identity-card {
        width: 100%;
    }

    .store-hero {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .store-price-grid,
    .store-feature-grid {
        grid-template-columns: 1fr;
    }

    .store-price-grid {
        justify-content: stretch;
    }

    .store-section,
    .store-inline-paybar {
        padding: 20px;
    }

    .store-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .store-section-head-actions {
        justify-content: flex-start;
    }

    .store-hero-main h1 {
        font-size: 34px;
    }

    .page.page-shell {
        width: 100%;
        margin: 0;
    }

    .app-shell {
        min-height: auto;
    }

    .app-sidebar {
        position: static;
        inset: auto;
        width: auto;
        min-height: auto;
        height: auto;
        padding: 18px 14px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        overflow: visible;
    }

    .app-main {
        margin-left: 0;
        padding: 16px;
    }

    .page-heading {
        font-size: 26px;
    }

    .auth-grid,
    .hero-grid,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-direction: column;
        align-items: stretch;
    }

    .page {
        width: min(100% - 20px, 1120px);
        margin: 16px auto;
    }

    .page.page-shell {
        width: 100%;
        margin: 0;
    }

    .page.auth-page {
        min-height: calc(100vh - 32px);
    }

    .order-grid {
        grid-template-columns: 1fr;
    }

    .section-title,
    .order-history-top,
    .order-history-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .order-history-layout {
        display: grid;
        grid-template-columns: 1fr;
    }

    .order-history-side,
    .order-history-meta {
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .order-history-side {
        min-width: 0;
        padding-left: 0;
        padding-top: 16px;
        border-left: none;
        border-top: 1px solid #cbd5e1;
        width: 100%;
    }

    .section-center {
        justify-content: center;
        width: 100%;
    }

    .section-actions input {
        width: 100%;
    }

    .page-header-actions {
        justify-content: center;
        width: 100%;
        min-width: 0;
    }

    .page-header-actions .btn-success {
        min-width: 140px;
    }

    .card-tabs.section-inline-tabs {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .card-tabs.section-inline-tabs .tab-btn {
        min-width: 0;
        padding: 10px 4px;
        font-size: 12px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .order-view-keys-btn,
    .order-payment-buttons {
        margin: 0 auto;
    }

    .order-payment-buttons {
        max-width: 280px;
    }

    .table-search-form {
        width: 100%;
    }

    .table-search-form input,
    .table-search-form select {
        width: 100%;
    }

    .table-search-form-all-cards {
        flex-wrap: wrap;
    }

    .table-search-form-all-cards input,
    .table-search-form-all-cards select {
        flex: 1 1 100%;
        min-width: 0;
    }

    .sidebar-menu-btn,
    .sidebar-menu-link {
        justify-content: flex-start;
    }

    .proof-order-row {
        align-items: stretch;
    }

    .key-item {
        align-items: stretch;
        flex-direction: column;
    }

    .key-main-info {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .key-info-grid-status {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .key-info-grid-simple {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .key-time-wrap,
    .key-duration-wrap {
        width: 100%;
        min-width: 0;
        align-items: center;
        text-align: center;
    }

    .key-time-text {
        white-space: normal;
        word-break: break-word;
    }

    .key-side-meta {
        width: 100%;
        flex-direction: row;
        align-items: stretch;
        gap: 12px;
    }

    .key-side-meta > * {
        flex: 1;
    }
}

html.theme-dark {
    color-scheme: dark;
}

html.theme-dark body {
    background: #020617;
    color: #f8fafc;
}

html.theme-dark .navbar,
html.theme-dark .card,
html.theme-dark .auth-box,
html.theme-dark .table-wrap,
html.theme-dark .hero,
html.theme-dark .stats,
html.theme-dark .modal-box,
html.theme-dark .notice-dialog {
    background: #0f172a;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
}

html.theme-dark .notice-dialog,
html.theme-dark .notice-dialog * {
    color: #f8fafc;
}

html.theme-dark .brand,
html.theme-dark .hero h1,
html.theme-dark .auth-box h1,
html.theme-dark .card h2,
html.theme-dark .table-wrap h2,
html.theme-dark label,
html.theme-dark .key-code-text,
html.theme-dark .order-history-line,
html.theme-dark .order-item-check,
html.theme-dark strong,
html.theme-dark th,
html.theme-dark td,
html.theme-dark .section-toggle,
html.theme-dark .modal-head h2,
html.theme-dark .modal-close {
    color: #f8fafc;
}

html.theme-dark .modal-close {
    background: #0f172a;
    border-color: #334155;
}

html.theme-dark .helper,
html.theme-dark .muted,
html.theme-dark .key-time-label,
html.theme-dark .key-time-text,
html.theme-dark .key-duration-text,
html.theme-dark .pagination a,
html.theme-dark .pagination span,
html.theme-dark .theme-toggle,
html.theme-dark .section-toggle-icon,
html.theme-dark .home-notice-card p {
    color: #cbd5e1;
}

html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
}

html.theme-dark .input-error {
    border-color: #f87171;
}

html.theme-dark .key-item.is-uncopied,
html.theme-dark .redeem-card-result {
    background: rgba(22, 163, 74, 0.16);
}

html.theme-dark .key-item.is-uncopied .key-code-text,
html.theme-dark .key-item.is-uncopied .key-time-label,
html.theme-dark .key-item.is-uncopied .key-time-text,
html.theme-dark .key-item.is-uncopied .key-duration-text,
html.theme-dark .redeem-card-result-label,
html.theme-dark .redeem-card-result-code {
    color: #86efac;
}

html.theme-dark .invalidated-card-item {
    background: rgba(220, 38, 38, 0.14);
}

html.theme-dark .invalidated-card-item .key-code-text,
html.theme-dark .invalidated-card-item .key-time-label,
html.theme-dark .invalidated-card-item .key-time-text,
html.theme-dark .invalidated-card-item .key-duration-text {
    color: #fca5a5;
}

html.theme-dark .form-error {
    color: #fca5a5;
}

html.theme-dark input::placeholder,
html.theme-dark textarea::placeholder {
    color: #94a3b8;
}

html.theme-dark .price-item,
html.theme-dark .summary-item,
html.theme-dark .stat-item,
html.theme-dark .key-item,
html.theme-dark .order-item-option,
html.theme-dark .order-history-item,
html.theme-dark .pagination a,
html.theme-dark .pagination span,
html.theme-dark .theme-toggle,
html.theme-dark .order-total-box,
html.theme-dark .empty {
    background: #111827;
    border-color: #334155;
}

html.theme-dark .order-item-option:hover {
    border-color: #60a5fa;
}

html.theme-dark .order-item-option.is-selected {
    background: rgba(30, 64, 175, 0.2);
    border-color: #60a5fa;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22);
}


html.theme-dark .table-wrap,
html.theme-dark .order-history-item,
html.theme-dark .order-item-option,
html.theme-dark .key-list-dashed .key-item,
html.theme-dark .empty,
html.theme-dark .proof-detail-item,
html.theme-dark .proof-image-preview,
html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea {
    border: 1px solid #334155;
}

html.theme-dark .key-list-dashed .key-item {
    background: #020617;
}

html.theme-dark .proof-detail-item,
html.theme-dark .proof-image-preview {
    background: #111827;
}

html.theme-dark .card-source-badge-paid {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

html.theme-dark .card-source-badge-redeem {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

html.theme-dark .card-source-badge-manual {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

html.theme-dark .admin-order-key-input {
    background: rgba(15, 23, 42, 0.85);
    color: #f8fafc;
    border-color: #334155;
}

html.theme-dark .admin-order-key-input:disabled {
    background: rgba(51, 65, 85, 0.85);
    color: #f8fafc;
}

html.theme-dark .order-total-box {
    color: #93c5fd;
}

html.theme-dark .price-agent {
    color: #4ade80;
}

html.theme-dark .theme-toggle:hover,
html.theme-dark .pagination a:hover {
    filter: brightness(1.08);
}

html.theme-dark .section-toggle:hover .section-toggle-icon,
html.theme-dark .modal-close:hover {
    background: #1e293b;
    color: #f8fafc;
}

html.theme-dark .order-key-group,
html.theme-dark th,
html.theme-dark td {
    border-color: #334155;
}

html.theme-dark .order-history-side {
    border-left-color: #334155;
}

html.theme-dark .payment-chooser {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

html.theme-dark .modal-overlay,
html.theme-dark .notice-overlay {
    background: rgba(2, 6, 23, 0.72);
}

html.theme-dark .alert.success {
    background: #14532d;
    color: #dcfce7;
}

html.theme-dark .alert.error {
    background: #7f1d1d;
    color: #fee2e2;
}

html.theme-dark .loading-spinner {
    border-color: #334155;
    border-top-color: #60a5fa;
}

html.theme-dark .theme-toggle {
    --toggle-surface: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    background: var(--toggle-surface);
    border: 1px solid #334155;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html.theme-dark .theme-toggle:hover {
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html.theme-dark .app-sidebar {
    background: #020617;
    border-right: 1px solid #1e293b;
}

html.theme-dark .app-sidebar-brand {
    color: #f8fafc;
}

html.theme-dark .app-sidebar-subtitle {
    color: #94a3b8;
}

html.theme-dark .sidebar-menu-btn,
html.theme-dark .sidebar-menu-link {
    color: #cbd5e1;
}

html.theme-dark .sidebar-menu-btn:hover,
html.theme-dark .sidebar-menu-link:hover {
    background: rgba(148, 163, 184, 0.14);
    color: #ffffff;
}

html.theme-dark .sidebar-menu-btn.active,
html.theme-dark .sidebar-menu-link.active {
    background: rgba(148, 163, 184, 0.18);
    border-left-color: #60a5fa;
    color: #ffffff;
}

html.theme-dark .sidebar-user-summary {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.2);
}

html.theme-dark .sidebar-user-summary strong {
    color: #f8fafc;
}

html.theme-dark .sidebar-user-summary span {
    color: #cbd5e1;
}

html.theme-dark .theme-icon-moon {
    opacity: 0;
    transform: scale(0.55) rotate(30deg);
}

html.theme-dark .theme-icon-moon::before {
    background: #e2e8f0;
}

html.theme-dark .theme-icon-moon::after {
    box-shadow: -9px 9px 0 -6px rgba(191, 219, 254, 0.85), -2px 13px 0 -7px rgba(191, 219, 254, 0.6);
}

html.theme-dark .theme-icon-sun {
    opacity: 1;
    transform: scale(1);
    color: #fbbf24;
}

@media (max-width: 860px) {
    html.theme-dark .app-sidebar {
        border-right: none;
        border-bottom-color: #1e293b;
    }

    html.theme-dark .order-history-side {
        border-top-color: #334155;
    }
}

/* 产品区块样式 */
.product-section {
    margin-bottom: 32px;
}

.product-module-box {
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    padding: 28px;
}

.product-module-header {
    margin-bottom: 20px;
}

.product-module-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
    text-align: center;
}

.product-notice {
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    margin-top: 12px;
    margin-bottom: 0;
    border-radius: 8px;
    color: #1e40af;
    font-size: 14px;
    line-height: 1.6;
}

html.theme-dark .product-module-box {
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(71, 85, 105, 0.5);
}

html.theme-dark .product-module-title {
    color: #f1f5f9;
    border-bottom-color: #334155;
}

html.theme-dark .product-notice {
    background: #1e3a5f;
    border-left-color: #60a5fa;
    color: #bfdbfe;
}
