/* 全息教研管理舱 · Admin Content Studio（v1.70.0 Cupertino） */

#view-admin-studio.active {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--bg);
}

.admin-studio-root {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.admin-gate {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

/* Author `display:flex` beats UA [hidden]; must hide explicitly after unlock */
.admin-gate[hidden],
.admin-deck[hidden] {
    display: none !important;
}

.admin-gate-card {
    width: min(420px, 100%);
    padding: 32px 28px 28px;
    border-radius: var(--radius);
    border: var(--hairline);
    background: var(--glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-soft);
    transform: translateY(0);
    transition: transform var(--transition), box-shadow var(--transition);
    color: var(--text);
}

.admin-gate-card:focus-within {
    box-shadow: var(--shadow-lg);
}

.admin-gate-kicker {
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.admin-gate-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.admin-gate-sub {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.admin-gate-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: var(--hairline);
    border-color: var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.admin-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.14);
}

.admin-input::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

textarea.admin-input {
    min-height: 96px;
    resize: vertical;
    line-height: 1.55;
}

select.admin-input {
    cursor: pointer;
    appearance: none;
    background-color: var(--surface-2);
    background-image: linear-gradient(45deg, transparent 50%, #86868B 50%),
        linear-gradient(135deg, #86868B 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: var(--radius-pill);
    border: var(--hairline);
    background: rgba(0, 0, 0, 0.04);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.admin-btn:hover {
    transform: translateY(-1px);
    background: rgba(0, 0, 0, 0.07);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.admin-btn:active {
    transform: translateY(0);
}

.admin-btn-secure {
    background: var(--primary);
    color: #FFFFFF;
    border-color: transparent;
    letter-spacing: -0.01em;
}

.admin-btn-danger {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.28);
    color: var(--danger);
}

.admin-btn-danger:hover {
    background: rgba(255, 59, 48, 0.16);
    border-color: rgba(255, 59, 48, 0.4);
    box-shadow: var(--shadow);
}

.admin-btn-ghost {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border);
    color: var(--text);
}

.admin-btn-ghost:hover {
    border-color: rgba(0, 122, 255, 0.28);
    color: var(--primary);
}

.admin-gate-err {
    min-height: 18px;
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--danger);
}

.admin-deck {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 20px 20px;
}

.admin-deck-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 4px 14px;
    flex-shrink: 0;
}

.admin-deck-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 3px;
    background: rgba(0, 0, 0, 0.055);
    border-radius: 10px;
    box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

.admin-tab {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.admin-tab:hover {
    color: var(--text);
}

.admin-tab.active {
    color: var(--text);
    font-weight: 600;
    background: var(--surface-2);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.1),
        0 1px 1px rgba(0, 0, 0, 0.04),
        0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

.admin-panels {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.admin-panel {
    display: none;
    animation: adminPanelIn 0.28s ease both;
}

.admin-panel.active {
    display: block;
}

@keyframes adminPanelIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-glass {
    padding: 26px 28px;
    border-radius: var(--radius);
    border: var(--hairline);
    background: var(--glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-soft);
    color: var(--text);
}

.admin-panel-head {
    margin-bottom: 18px;
}

.admin-panel-head h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.admin-panel-head p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-field.span-2 {
    grid-column: 1 / -1;
}

.admin-field label {
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #86868B;
}

.admin-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.admin-status {
    font-size: 12px;
    color: #86868B;
    min-height: 18px;
}

.admin-status.ok {
    color: #248A3D;
}

.admin-status.err {
    color: #C4271F;
}

.admin-flash-orphan {
    animation: adminOrphanFlash 0.85s ease;
    border-color: rgba(251, 113, 133, 0.85) !important;
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.25), 0 0 28px rgba(251, 113, 133, 0.2) !important;
}

@keyframes adminOrphanFlash {
    0%,
    100% {
        background: rgba(255, 255, 255, 0.75);
    }
    35% {
        background: rgba(255, 59, 48, 0.12);
    }
}

.admin-flash-arch-warn {
    animation: adminArchWarnFlash 1.05s ease;
    border-color: rgba(251, 191, 36, 0.75) !important;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.28), 0 0 32px rgba(245, 158, 11, 0.22) !important;
}

@keyframes adminArchWarnFlash {
    0%,
    100% {
        background: rgba(255, 255, 255, 0.75);
    }
    40% {
        background: rgba(255, 149, 0, 0.16);
    }
}

.admin-tree-preview {
    margin-top: 16px;
    max-height: 220px;
    overflow: auto;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--surface-2);
    font-size: 12px;
    line-height: 1.7;
    color: var(--text);
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.admin-tree-preview .depth-0 {
    font-weight: 700;
    color: #0071E3;
}

.admin-tree-preview .depth-1 {
    padding-left: 14px;
}

.admin-tree-preview .depth-2 {
    padding-left: 28px;
    color: #86868B;
}

.admin-entry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
    color: #0071E3;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.admin-entry-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 113, 227, 0.4);
    background: rgba(0, 113, 227, 0.08);
}

.foot-admin-row {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

/* —— 历史实训成绩审计大盘（v1.37.0） —— */

.audit-board {
    position: relative;
    overflow: hidden;
    min-height: 420px;
}

.audit-board-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}

.audit-board-head .admin-panel-head {
    margin-bottom: 14px;
    flex: 1;
    min-width: 0;
}

.audit-full-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.audit-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--primary-light);
}

.audit-note-icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--primary);
}

.audit-note-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.audit-note-body strong {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}

.audit-note-body b {
    font-weight: 600;
    color: var(--text);
}

.audit-note-body code {
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 11px;
}

.audit-note-demo {
    color: var(--text-secondary);
}

.audit-filters {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
    gap: 12px 14px;
    margin-bottom: 14px;
}

.audit-filter-action .admin-btn {
    width: 100%;
    min-height: 44px;
}

.audit-meta {
    min-height: 20px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.audit-meta strong {
    color: var(--primary);
    font-weight: 600;
}

.audit-table-wrap {
    border-radius: var(--radius);
    border: var(--hairline);
    background: var(--surface-2);
    overflow: auto;
    max-height: min(52vh, 480px);
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
    box-shadow: var(--shadow);
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text); /* #1D1D1F · WCAG AAA on white */
}

.audit-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--text-secondary);
    background: var(--bg);
    border-bottom: var(--hairline);
}

.audit-table tbody td {
    padding: 14px 16px;
    border-bottom: var(--hairline);
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
    line-height: 1.45;
    color: var(--text);
    background: transparent;
}

.audit-table tbody tr {
    transition: background var(--transition);
}

.audit-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.025);
}

.audit-empty-row td {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-secondary);
}

/* VERIFIED · green breathing dot */
.audit-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.audit-badge-verified {
    color: #248A3D;
}

.audit-badge-verified .audit-dot {
    display: inline-block;
    color: #34C759;
    text-shadow: none;
    animation: auditBreathe 2.2s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes auditBreathe {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.75;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* TAMPERED · orange-red flash + row pulse */
.audit-badge-tampered {
    color: #C4271F;
}

.audit-badge-tampered .audit-warn {
    display: inline-block;
    color: #FF3B30;
    animation: auditWarnFlash 0.9s ease-in-out infinite;
    will-change: opacity, transform;
}

@keyframes auditWarnFlash {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(1.12);
    }
}

.audit-row-tampered {
    animation: auditRowFlash 1.4s ease-in-out infinite;
}

@keyframes auditRowFlash {
    0%,
    100% {
        background: rgba(255, 59, 48, 0.06);
    }
    50% {
        background: rgba(255, 59, 48, 0.16);
    }
}

/* Holographic radar / wave loading overlay */
.audit-radar {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(245, 245, 247, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.audit-radar[hidden] {
    display: none !important;
}

.audit-radar-ring {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: var(--hairline);
    border-color: rgba(0, 122, 255, 0.28);
    box-shadow: none;
    animation: auditRadarPulse 2s ease-out infinite;
    will-change: transform, opacity;
}

.audit-radar-ring-2 {
    width: 220px;
    height: 220px;
    border-color: rgba(0, 122, 255, 0.14);
    animation-delay: 0.45s;
}

.audit-radar-sweep {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(0, 122, 255, 0.28) 50deg,
        transparent 90deg
    );
    mask-image: radial-gradient(circle, transparent 42%, #000 44%);
    -webkit-mask-image: radial-gradient(circle, transparent 42%, #000 44%);
    animation: auditRadarSweep 1.6s linear infinite;
    will-change: transform;
}

.audit-radar-label {
    position: relative;
    z-index: 1;
    margin: 180px 0 0;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--primary);
}

@keyframes auditRadarPulse {
    0% {
        transform: scale(0.85);
        opacity: 0.85;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

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

.admin-students-created {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.admin-students-created h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.admin-students-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-btn-sm {
    padding: 4px 10px !important;
    font-size: 12px !important;
}

.admin-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.admin-pill.ok {
    background: rgba(52, 199, 89, 0.14);
    color: #248A3D;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.admin-pill.off {
    background: rgba(255, 59, 48, 0.1);
    color: #C4271F;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

@media (max-width: 720px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-field.span-2 {
        grid-column: auto;
    }

    .admin-deck-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .audit-board-head {
        flex-direction: column;
    }

    .audit-full-btn {
        width: 100%;
        white-space: normal;
    }

    .audit-filters {
        grid-template-columns: 1fr 1fr;
    }

    .audit-filter-action {
        grid-column: 1 / -1;
    }
}
