/* 后台：低对比、低饱和，适合长时间阅读 */
body:has(.admin-wrap) {
    overflow-x: auto;
    background: #11141c;
    color: #b4c0d4;
}
.container.admin-wrap {
    max-width: none;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}
.admin-wrap {
    margin: 32px 0;
    font-size: 16px;
    line-height: 1.6;
}
.admin-wrap .card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #a8b4c8;
}
.admin-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.admin-nav a {
    padding: 10px 18px;
    border-radius: 30px;
    border: 1px solid rgba(130, 140, 160, 0.35);
    font-size: 1rem;
    color: #95a3b8;
}
.admin-nav a:hover {
    color: #c5d0e0;
    border-color: rgba(150, 160, 180, 0.45);
}
.admin-nav a.active {
    background: rgba(75, 88, 110, 0.5);
    color: #d8e0ec;
    border-color: rgba(140, 150, 170, 0.45);
}
.stats-admin {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.stat-admin-card {
    background: rgba(22, 26, 36, 0.9);
    border-radius: 1rem;
    padding: 1.2rem;
    border: 1px solid rgba(130, 140, 160, 0.2);
    text-align: center;
}
.stat-admin-card .num {
    font-size: 2rem;
    font-weight: 700;
    color: #9aa8be;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}
.data-table th,
.data-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(80, 90, 110, 0.35);
    text-align: left;
}
.data-table th {
    color: #8a96a8;
    font-weight: 600;
}
.data-table td {
    color: #b0bccf;
}
.btn-sm {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(130, 140, 160, 0.45);
    background: transparent;
    color: #aeb9cb;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
}
.btn-sm:hover {
    color: #d0d8e4;
    border-color: rgba(150, 160, 180, 0.55);
}
.btn-sm.active {
    background: rgba(75, 88, 110, 0.45);
    color: #d8e0ec;
}
.btn-danger {
    border-color: rgba(180, 120, 120, 0.45);
    color: #c9a8a8;
}
.btn-danger:hover {
    color: #e0c8c8;
}
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}
.admin-msg.ok { color: #8fb89a; font-size: 1rem; }
.admin-msg.err { color: #c49a9a; font-size: 1rem; }
.admin-hint {
    font-size: 0.95rem;
    color: #7d8a9e;
    margin-bottom: 16px;
}
.admin-form label {
    display: block;
    margin-bottom: 12px;
    font-size: 1rem;
    color: #aeb9cb;
}
.admin-form h2 { font-size: 1.25rem; color: #a8b4c8; }
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form select,
.admin-form textarea {
    width: 100%;
    margin-top: 4px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(120, 130, 150, 0.4);
    background: rgba(18, 22, 32, 0.95);
    color: #c8d2e0;
    box-sizing: border-box;
}
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: rgba(140, 155, 180, 0.55);
}
.card-panel {
    background: rgba(20, 24, 34, 0.85);
    border: 1px solid rgba(120, 130, 150, 0.22);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}
.card-panel h2 {
    font-size: 1.1rem;
    margin: 0 0 12px;
    color: #9aa8be;
    font-weight: 600;
}
.table-scroll {
    overflow-x: auto;
    margin-bottom: 16px;
    width: 100%;
}
.data-table-q {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}
.data-table-q .col-id { width: 1%; white-space: nowrap; }
.data-table-q .col-dim { white-space: nowrap; }
.data-table-q .col-no { white-space: nowrap; }
.data-table-q .col-status { white-space: nowrap; }
.data-table-q .col-act { white-space: nowrap; }
.data-table-q .td-stem {
    white-space: nowrap;
    min-width: 12rem;
    color: #b8c4d6;
}
.data-table-q .td-opt-clip {
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #9aa8b8;
}
.inline-form { display: inline; margin-left: 6px; }
.admin-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aeb9cb;
}
.admin-check input { width: auto; margin: 0; }
.td-actions { white-space: nowrap; }

.admin-dialog {
    border: 1px solid rgba(120, 130, 150, 0.35);
    border-radius: 16px;
    padding: 0;
    margin: auto;
    max-width: 640px;
    width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #161b26;
    color: #c8d2e0;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.admin-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}
.admin-dialog:not([open]) {
    display: none !important;
}
.admin-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(120, 130, 150, 0.25);
}
.admin-dialog-head h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #a8b4c8;
    font-weight: 600;
}
.admin-dialog-close {
    font-size: 1.75rem;
    line-height: 1;
    color: #7d8a9e;
    text-decoration: none;
    padding: 0 4px;
}
.admin-dialog-close:hover { color: #b8c4d6; }
.admin-dialog .admin-form { padding: 20px; }
.admin-form-grid .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 16px;
}
.admin-form-grid .form-full { grid-column: 1 / -1; }
.admin-form-grid .form-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-form-grid .opt-score {
    font-size: 0.85rem;
    color: #8a96a8;
    font-weight: normal;
}
.admin-dialog-foot {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(120, 130, 150, 0.2);
}
.admin-dialog-foot .btn-primary,
.admin-dialog-foot .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin: 0;
    line-height: 1.25;
    box-sizing: border-box;
}
.btn-primary {
    padding: 10px 24px;
    border-radius: 24px;
    border: none;
    background: #4a5568;
    color: #e8edf4;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
}
.btn-primary:hover {
    background: #5a6578;
}
.admin-copy-form .copy-field {
    display: block;
    margin-bottom: 14px;
}
.admin-copy-form .copy-field-label {
    display: block;
    margin-bottom: 6px;
    color: #9aa8be;
    font-size: 0.95rem;
}
.admin-copy-form .copy-field input,
.admin-copy-form .copy-field textarea {
    display: block;
    width: 100%;
    min-height: 2.5rem;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(120, 130, 150, 0.4);
    background: rgba(14, 18, 28, 0.95);
    color: #c8d2e0;
    font-size: 1rem;
    box-sizing: border-box;
}
.admin-copy-form .copy-field textarea {
    min-height: 4.5rem;
    resize: vertical;
}
.admin-copy-actions { margin-top: 8px; }
