:root {
    --uc-primary: #003d9b;
    --uc-primary-strong: #00296d;
    --uc-accent: #8a4b08;
    --uc-bg: #f5f7fb;
    --uc-panel: #ffffff;
    --uc-soft: #eef3f9;
    --uc-line: #d9e1ec;
    --uc-text: #1b2330;
    --uc-muted: #667085;
    --uc-danger: #b42318;
    --uc-success: #137a42;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--uc-text);
    background: var(--uc-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

code {
    padding: 2px 5px;
    border: 1px solid var(--uc-line);
    border-radius: 4px;
    background: var(--uc-soft);
}

.uc-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}

.uc-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    width: 248px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 14px;
    color: #fff;
    background: var(--uc-primary-strong);
}

.uc-brand {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 8px 18px;
    margin-bottom: 14px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.uc-brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--uc-primary-strong);
    font-weight: 800;
}

.uc-brand strong,
.uc-brand small {
    display: block;
}

.uc-brand small {
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
}

.uc-nav,
.uc-nav-title {
    display: grid;
    gap: 6px;
}

.uc-nav-title {
    margin: 18px 8px 7px;
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
}

.uc-nav a,
.uc-logout {
    padding: 10px 12px;
    border-radius: 6px;
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
}

.uc-nav a:hover,
.uc-nav a.is-active,
.uc-logout:hover {
    background: rgba(255, 255, 255, .13);
    color: #fff;
}

.uc-logout {
    display: block;
    margin-top: 18px;
}

.uc-main {
    min-width: 0;
    padding: 28px;
}

.uc-topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.uc-topbar h1 {
    margin: 0 0 6px;
    font-size: 28px;
    letter-spacing: 0;
}

.uc-topbar p {
    min-height: 22px;
    margin: 0;
    color: var(--uc-muted);
}

.uc-user-chip {
    min-width: 150px;
    padding: 9px 12px;
    border: 1px solid var(--uc-line);
    border-radius: 8px;
    background: var(--uc-panel);
    text-align: right;
}

.uc-user-chip span,
.uc-user-chip small {
    display: block;
}

.uc-user-chip small {
    color: var(--uc-muted);
}

.uc-alert {
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 6px;
    border: 1px solid var(--uc-line);
    background: var(--uc-panel);
}

.uc-alert-success {
    border-color: #b6e3c8;
    background: #f0fdf4;
    color: var(--uc-success);
}

.uc-alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--uc-danger);
}

.uc-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.uc-card,
.uc-panel,
.uc-auth-panel {
    border: 1px solid var(--uc-line);
    border-radius: 8px;
    background: var(--uc-panel);
    box-shadow: 0 10px 28px rgba(24, 36, 58, .06);
}

.uc-card {
    padding: 18px;
}

.uc-card span {
    display: block;
    color: var(--uc-muted);
    font-size: 13px;
}

.uc-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}

.uc-panel,
.uc-auth-panel {
    padding: 20px;
    margin-bottom: 16px;
}

.uc-auth-panel {
    max-width: 760px;
}

.uc-panel-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}

.uc-panel-title h2 {
    margin: 0;
    font-size: 18px;
}

.uc-panel-title a,
.uc-link {
    color: var(--uc-primary);
    text-decoration: none;
    font-weight: 700;
}

.uc-form {
    display: grid;
    gap: 16px;
}

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

.uc-form label,
.uc-inline-form {
    display: grid;
    gap: 6px;
}

.uc-form span {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfd7e3;
    border-radius: 6px;
    background: #fff;
    color: var(--uc-text);
    font: inherit;
}

input,
select {
    height: 40px;
    padding: 0 10px;
}

textarea {
    min-height: 92px;
    padding: 10px;
    resize: vertical;
}

.uc-col-span {
    grid-column: 1 / -1;
}

.uc-check-row {
    display: flex !important;
    align-items: center;
    gap: 9px;
    min-height: 40px;
}

.uc-check-row input {
    width: auto;
    height: auto;
}

.uc-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.uc-btn,
.uc-small-btn {
    border: 0;
    border-radius: 6px;
    background: var(--uc-primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.uc-btn:hover,
.uc-small-btn:hover {
    background: var(--uc-primary-strong);
}

.uc-btn:disabled,
.uc-small-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.uc-btn {
    min-height: 42px;
    padding: 0 16px;
}

.uc-small-btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

.uc-inline-form {
    grid-template-columns: minmax(180px, 320px) auto;
    align-items: end;
}

.uc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.uc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}

.uc-table th,
.uc-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #edf1f6;
    text-align: left;
    vertical-align: top;
}

.uc-table th {
    color: #475467;
    font-size: 12px;
    background: #f8fafc;
}

.uc-text-cell {
    max-width: 360px;
    white-space: normal;
    word-break: break-word;
}

.uc-empty {
    color: var(--uc-muted);
    text-align: center !important;
}

.uc-detail-list {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px 16px;
    margin: 0;
}

.uc-detail-list dt {
    color: var(--uc-muted);
}

.uc-detail-list dd {
    margin: 0;
    word-break: break-word;
}

.uc-actions-cell {
    min-width: 180px;
}

.uc-actions-cell form {
    display: inline-grid;
    margin-right: 8px;
}

.uc-actions-cell details {
    margin-top: 8px;
}

.uc-mini-form {
    display: grid !important;
    grid-template-columns: 86px 100px minmax(120px, 1fr) auto;
    gap: 8px;
    margin-top: 8px;
}

.uc-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.uc-quick {
    display: block;
    padding: 16px;
    border: 1px solid var(--uc-line);
    border-radius: 8px;
    background: #fff;
    color: var(--uc-primary);
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.uc-quick:hover {
    border-color: rgba(0, 61, 155, 0.35);
    box-shadow: 0 10px 24px rgba(0, 61, 155, 0.08);
}

.uc-subnav {
    display: flex;
    gap: 6px;
    margin-bottom: 22px;
    padding: 8px 0;
    border-bottom: 2px solid var(--uc-line);
    flex-wrap: wrap;
}

.uc-subnav a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px 6px 0 0;
    color: var(--uc-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.15s ease, color 0.15s ease;
}

.uc-subnav a:hover {
    color: var(--uc-primary);
    background: var(--uc-soft);
}

.uc-subnav a.is-active {
    color: var(--uc-primary-strong);
    background: var(--uc-panel);
    border: 2px solid var(--uc-primary);
    border-bottom-color: var(--uc-panel);
    position: relative;
    top: 2px;
}

.uc-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.uc-meta-table {
    width: 100%;
    font-size: 14px;
}

.uc-meta-table td {
    padding: 8px 0;
    border-bottom: 1px solid #edf1f6;
}

.uc-meta-table td:first-child {
    color: var(--uc-muted);
    width: 40%;
}

.uc-ok {
    color: var(--uc-success);
    font-weight: 700;
}

.uc-warn {
    color: var(--uc-accent);
    font-weight: 700;
}

.uc-back-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.uc-back-link {
    display: inline-block;
    padding: 12px 20px;
    border: 1px solid var(--uc-line);
    border-radius: 8px;
    background: #fff;
    color: var(--uc-primary);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.15s ease;
}

.uc-back-link:hover {
    border-color: rgba(0, 61, 155, 0.3);
    background: #f8fbff;
}

.uc-quick-links {
    display: grid;
    gap: 10px;
}

.uc-quick-link {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--uc-line);
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: var(--uc-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.uc-quick-link:hover {
    border-color: rgba(0, 61, 155, 0.3);
    box-shadow: 0 8px 20px rgba(0, 61, 155, 0.06);
}

.uc-quick-link strong {
    display: block;
    margin-bottom: 4px;
}

.uc-quick-link span {
    display: block;
    color: var(--uc-muted);
    font-size: 13px;
}

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

.uc-stat-card {
    padding: 18px;
    border: 1px solid var(--uc-line);
    border-radius: 8px;
    background: var(--uc-panel);
    box-shadow: 0 10px 28px rgba(24, 36, 58, 0.06);
}

.uc-stat-label {
    color: var(--uc-muted);
    font-size: 13px;
    margin: 0 0 8px;
}

.uc-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--uc-primary-strong);
}

.uc-stat-mode {
    font-size: 16px !important;
}

.uc-panels-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 1040px) {
    .uc-metrics,
    .uc-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .uc-text-cell {
        min-width: 220px;
        white-space: normal;
    }
}

@media (max-width: 760px) {
    .uc-shell {
        grid-template-columns: 1fr;
    }

    .uc-sidebar {
        position: static;
        height: auto;
    }

    .uc-main {
        padding: 18px;
    }

    .uc-topbar {
        display: block;
    }

    .uc-user-chip {
        margin-top: 14px;
        text-align: left;
    }

    .uc-form-grid,
    .uc-metrics,
    .uc-quick-grid,
    .uc-inline-form,
    .uc-mini-form {
        grid-template-columns: 1fr;
    }

    .uc-detail-list {
        grid-template-columns: 1fr;
    }
}

.uc-field-hint {
    font-size: 12px;
    color: var(--uc-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.uc-wallet-action {
    position: relative;
    display: inline-block;
}

.uc-wallet-action-btn {
    display: inline-block;
    padding: 0 10px;
    min-height: 32px;
    line-height: 32px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(0, 61, 155, 0.25);
    border-radius: 6px;
    background: #fff9e6;
    color: var(--uc-warning);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    list-style: none;
}

.uc-wallet-action-btn:hover {
    background: #fff3cc;
    border-color: var(--uc-warning);
}

.uc-wallet-action-btn::-webkit-details-marker {
    display: none;
}

.uc-wallet-action-btn::marker {
    display: none;
}

.uc-wallet-action[open] > .uc-wallet-action-btn {
    background: #fff3cc;
    border-color: var(--uc-warning);
}

.uc-mini-form {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.uc-mini-form input,
.uc-mini-form select {
    padding: 4px 8px;
    border: 1px solid #dce3ea;
    border-radius: 4px;
    font-size: 13px;
    height: 30px;
}

.uc-mini-form input[type="number"] {
    width: 80px;
}

.uc-mini-form input[type="text"] {
    width: 100px;
}

.uc-link-btn {
    display: inline-block;
    padding: 0 10px;
    min-height: 32px;
    line-height: 32px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(0, 61, 155, 0.25);
    border-radius: 6px;
    background: #f8fbff;
    color: var(--uc-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.uc-link-btn:hover {
    background: #eef3ff;
    border-color: var(--uc-primary);
}

.uc-ghost-btn {
    display: inline-block;
    padding: 0 10px;
    min-height: 32px;
    line-height: 32px;
    font-size: 13px;
    font-weight: 700;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--uc-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.uc-ghost-btn:hover {
    background: var(--uc-soft);
}

.uc-small-btn-link {
    display: inline-block;
    border: 1px solid rgba(0, 61, 155, 0.25);
    border-radius: 6px;
    background: #f8fbff;
    color: var(--uc-primary);
    text-decoration: none;
    line-height: 30px;
    vertical-align: middle;
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.uc-small-btn-link:hover {
    background: #f0f6ff;
    border-color: rgba(0, 61, 155, 0.4);
}

