/* ========== AIAS 系统UI · 机密系统代入感 ========== */

/* ---- 1. 启动加载画面 ---- */
.boot-overlay {
    position: fixed; inset: 0;
    background: #0a0907;
    z-index: 99999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-family: var(--font-mono, 'Special Elite', monospace);
    color: #888070;
    transition: opacity 0.6s ease;
}

.boot-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.boot-logo {
    font-family: var(--font-stamp, 'Oswald', sans-serif);
    font-size: 3rem; font-weight: 700;
    color: var(--stamp-red, #8a1e22);
    letter-spacing: 0.3em;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(138,30,34,0.4);
    animation: boot-flicker 2s ease-in-out;
}

.boot-sub {
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    color: #555048;
    margin-bottom: 40px;
}

.boot-lines {
    font-size: 0.8rem;
    line-height: 2;
    color: #6a6258;
    text-align: left;
    min-height: 120px;
    max-width: 420px;
    width: 90%;
}

.boot-line {
    opacity: 0;
    animation: boot-line-in 0.3s ease forwards;
}

.boot-line::before {
    content: '> ';
    color: #4a4438;
}

.boot-line.ok::after {
    content: ' [OK]';
    color: #4a6a30;
}

.boot-line.warn::after {
    content: ' [WARN]';
    color: #8a6020;
}

.boot-line.deny::after {
    content: ' [RESTRICTED]';
    color: #6a1818;
}

@keyframes boot-flicker {
    0%, 100% { opacity: 1; }
    20% { opacity: 0.4; }
    40% { opacity: 1; }
    60% { opacity: 0.7; }
    80% { opacity: 1; }
}

@keyframes boot-line-in {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.boot-bar {
    width: 280px; height: 3px;
    background: #1a1812;
    border: 1px solid #2a2618;
    margin-top: 30px;
    overflow: hidden;
}

.boot-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #4a3a18, #8a6a20, #4a3a18);
    transition: width 0.1s linear;
}

/* ---- 2. 安全许可弹窗 ---- */
.clearance-modal {
    position: fixed; inset: 0;
    background: rgba(5,4,3,0.85);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: none;
    align-items: center; justify-content: center;
    animation: modal-in 0.2s ease;
}

.clearance-modal.show {
    display: flex;
}

@keyframes modal-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.clearance-box {
    background: linear-gradient(180deg, #14110a 0%, #0e0c06 100%);
    border: 1px solid #3a3218;
    border-top: 2px solid var(--stamp-red, #8a1e22);
    width: 90%; max-width: 460px;
    padding: 32px 36px 28px;
    font-family: var(--font-mono, 'Special Elite', monospace);
    color: #8a8270;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6), inset 0 0 60px rgba(20,14,6,0.3);
}

.clearance-box::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--stamp-red, #8a1e22), transparent);
}

.clearance-icon {
    text-align: center;
    font-size: 2.4rem;
    color: var(--stamp-red, #8a1e22);
    margin-bottom: 8px;
    line-height: 1;
}

.clearance-title {
    text-align: center;
    font-family: var(--font-stamp, 'Oswald', sans-serif);
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    color: #a09878;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.clearance-subtitle {
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: #555048;
    margin-bottom: 20px;
}

.clearance-body {
    font-size: 0.85rem;
    line-height: 1.8;
    text-align: center;
    color: #7a7260;
    margin-bottom: 20px;
}

.clearance-body .doc-ref {
    color: #a09878;
    font-weight: bold;
}

.clearance-progress {
    width: 100%; height: 4px;
    background: #1a1810;
    border: 1px solid #2a2618;
    margin: 16px 0;
    overflow: hidden;
}

.clearance-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #4a3a18, #8a6a20);
    transition: width 0.15s linear;
}

.clearance-status {
    text-align: center;
    font-size: 0.75rem;
    color: #6a6250;
    min-height: 1.2em;
    margin-bottom: 12px;
}

.clearance-status.granted {
    color: #4a7a30;
}

.clearance-status.denied {
    color: #8a3030;
}

.clearance-btn {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid #3a3218;
    color: #8a8270;
    font-family: var(--font-mono, 'Special Elite', monospace);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.clearance-btn:hover {
    background: #1a1810;
    border-color: var(--stamp-red, #8a1e22);
    color: #b0a888;
}

.clearance-btn:active {
    transform: scale(0.98);
}

.clearance-btn.primary {
    border-color: #4a3a18;
    color: #a09878;
}

.clearance-btn.primary:hover {
    border-color: #6a5020;
    background: #1a1408;
}

/* ---- 3. 系统状态栏 ---- */
.sys-status {
    position: fixed;
    bottom: 0; right: 0;
    background: rgba(10,8,6,0.92);
    border-top: 1px solid #2a2418;
    border-left: 1px solid #2a2418;
    padding: 6px 14px;
    font-family: var(--font-mono, 'Special Elite', monospace);
    font-size: 0.65rem;
    color: #5a5248;
    z-index: 9000;
    display: flex; align-items: center;
    gap: 16px;
    backdrop-filter: blur(4px);
}

.sys-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #3a6a20;
    box-shadow: 0 0 6px #3a6a20;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.sys-status .ss-label {
    color: #4a4438;
}

.sys-status .ss-value {
    color: #7a7260;
}

.sys-status .ss-sep {
    color: #2a2618;
}

/* ---- 4. 涂黑文字交互 ---- */
.redacted {
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}

.redacted:hover {
    color: transparent;
    background: var(--stamp-red, #8a1e22);
    text-shadow: none;
}

.redacted::after {
    content: 'ACCESS DENIED';
    position: absolute;
    bottom: 100%; left: 50%;
    transform: translateX(-50%);
    background: rgba(10,8,6,0.95);
    color: var(--stamp-red, #8a1e22);
    font-family: var(--font-mono, 'Special Elite', monospace);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    padding: 3px 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    margin-bottom: 4px;
    border: 1px solid #3a1818;
}

.redacted:hover::after {
    opacity: 1;
}

/* ---- 5. 扫描线效果 ---- */
.scanline-overlay {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

.scanline-overlay::before {
    content: '';
    position: absolute;
    top: -100%; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(138,30,34,0.15), transparent);
    animation: scanline-sweep 3s ease-out;
}

@keyframes scanline-sweep {
    0% { top: -10%; }
    100% { top: 110%; }
}

/* ---- 6. 页面进入闪烁 ---- */
.page-flicker {
    position: fixed; inset: 0;
    background: #c8b890;
    z-index: 9998;
    pointer-events: none;
    animation: page-flicker-anim 0.15s ease-out forwards;
}

@keyframes page-flicker-anim {
    0% { opacity: 0.3; }
    100% { opacity: 0; }
}

/* ---- 7. CRT 持续扫描线 ---- */
.crt-overlay {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 9997;
    overflow: hidden;
    opacity: 0.15;
}

.crt-overlay::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.15) 2px,
        rgba(0,0,0,0.15) 3px
    );
    animation: crt-scroll 8s linear infinite;
}

@keyframes crt-scroll {
    from { transform: translateY(0); }
    to { transform: translateY(3px); }
}

/* ---- 8. 系统通知 Toast ---- */
.toast-container {
    position: fixed;
    top: 90px; right: 0;
    z-index: 9500;
    display: flex; flex-direction: column;
    gap: 8px;
    padding: 0 12px;
    max-width: 340px;
    pointer-events: none;
}

.toast-item {
    background: rgba(14,12,6,0.95);
    border: 1px solid #2a2418;
    border-left: 3px solid #4a3a18;
    padding: 8px 14px;
    font-family: var(--font-mono, 'Special Elite', monospace);
    font-size: 0.7rem;
    color: #7a7260;
    line-height: 1.6;
    backdrop-filter: blur(4px);
    animation: toast-in 0.3s ease;
    display: flex; align-items: center;
    gap: 10px;
}

.toast-item.out {
    animation: toast-out 0.3s ease forwards;
}

.toast-item.alert {
    border-left-color: var(--stamp-red, #8a1e22);
}

.toast-item.ok {
    border-left-color: #3a6a20;
}

.toast-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.toast-item.alert .toast-icon { color: var(--stamp-red, #8a1e22); }
.toast-item.ok .toast-icon { color: #4a7a30; }
.toast-item .toast-icon { color: #6a5e3e; }

.toast-time {
    color: #4a4438;
    font-size: 0.6rem;
    margin-left: auto;
    white-space: nowrap;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(60px); }
}

/* ---- 9. 文档水印 ---- */
.doc-watermark-stamp {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.doc-watermark-stamp::before {
    content: 'AIAS · CLASSIFIED · AIAS · CLASSIFIED · AIAS · CLASSIFIED';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    white-space: nowrap;
    font-family: var(--font-stamp, 'Oswald', sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: rgba(138,30,34,0.04);
    width: 200%;
    text-align: center;
}

.archive-document.classified-doc {
    position: relative;
}

.archive-document.classified-doc::after {
    content: 'CLASSIFIED · AIAS · CLASSIFIED · AIAS · CLASSIFIED · AIAS';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    white-space: nowrap;
    font-family: var(--font-stamp, 'Oswald', sans-serif);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: rgba(138,30,34,0.035);
    pointer-events: none;
    z-index: 0;
    width: 200%;
    text-align: center;
}

/* ---- 10. 屏幕故障效果 ---- */
.glitch-overlay {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 9996;
    opacity: 0;
}

.glitch-overlay.active {
    animation: glitch-anim 0.3s steps(2) ;
}

.glitch-overlay::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 2px,
        rgba(138,30,34,0.08) 2px,
        rgba(138,30,34,0.08) 4px
    );
    mix-blend-mode: screen;
}

.glitch-overlay::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(138,30,34,0.06), transparent, rgba(26,56,88,0.06));
    mix-blend-mode: screen;
}

@keyframes glitch-anim {
    0% { opacity: 0; transform: translateX(0); }
    20% { opacity: 1; transform: translateX(-3px); }
    40% { opacity: 1; transform: translateX(3px); }
    60% { opacity: 0.8; transform: translateX(-2px); }
    80% { opacity: 0.5; transform: translateX(1px); }
    100% { opacity: 0; transform: translateX(0); }
}

/* ---- 11. 访问日志面板 ---- */
.access-log-panel {
    position: fixed;
    bottom: 142px; right: 0;
    width: 320px;
    max-height: 280px;
    background: rgba(10,8,6,0.96);
    border: 1px solid #2a2418;
    border-bottom: none;
    font-family: var(--font-mono, 'Special Elite', monospace);
    font-size: 0.62rem;
    color: #5a5248;
    z-index: 9100;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(6px);
}

.access-log-panel.show {
    display: flex;
    animation: log-panel-in 0.2s ease;
}

@keyframes log-panel-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.access-log-header {
    background: #14110a;
    border-bottom: 1px solid #2a2418;
    padding: 6px 12px;
    display: flex; justify-content: space-between;
    align-items: center;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: #6a6250;
    text-transform: uppercase;
}

.access-log-close {
    cursor: pointer;
    color: #4a4438;
    padding: 0 4px;
    transition: color 0.15s;
}

.access-log-close:hover { color: var(--stamp-red, #8a1e22); }

.access-log-body {
    overflow-y: auto;
    padding: 6px 12px;
    line-height: 1.8;
    max-height: 240px;
}

.access-log-body::-webkit-scrollbar { width: 4px; }
.access-log-body::-webkit-scrollbar-track { background: transparent; }
.access-log-body::-webkit-scrollbar-thumb { background: #2a2418; }

.log-entry {
    display: flex; gap: 8px;
    padding: 2px 0;
    border-bottom: 1px dotted rgba(42,36,24,0.3);
    animation: log-entry-in 0.15s ease;
}

@keyframes log-entry-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.log-time { color: #4a4438; white-space: nowrap; }
.log-user { color: #6a5e3e; }
.log-action { color: #7a7260; flex: 1; }
.log-action.danger { color: #8a4030; }
.log-action.ok { color: #4a6a30; }

/* ---- 12. 安全警告横幅 ---- */
.security-banner {
    position: fixed;
    top: 80px; left: 0; right: 0;
    height: 24px;
    background: linear-gradient(90deg, rgba(138,30,34,0.12), rgba(138,30,34,0.06), rgba(138,30,34,0.12));
    border-bottom: 1px solid rgba(138,30,34,0.2);
    display: flex; align-items: center;
    justify-content: center;
    font-family: var(--font-mono, 'Special Elite', monospace);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: rgba(138,30,34,0.6);
    z-index: 8999;
    text-transform: uppercase;
    overflow: hidden;
    white-space: nowrap;
}

.security-banner::before {
    content: '\26A0  CLASSIFIED CONTENT — UNAUTHORIZED ACCESS PROHIBITED — ALL ACTIVITY LOGGED  \00B7  ';
    animation: banner-scroll 20s linear infinite;
}

@keyframes banner-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---- 13. 打字机效果 ---- */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--ink-soft);
    animation: blink-cursor 0.8s step-end infinite;
}

.typewriter.done {
    border-right: none;
    animation: none;
}

@keyframes blink-cursor {
    0%, 100% { border-right-color: var(--ink-soft); }
    50% { border-right-color: transparent; }
}

/* ---- 14. 涂黑解密动画 ---- */
.redacted.decrypting {
    animation: decrypt-flicker 0.4s steps(3);
}

@keyframes decrypt-flicker {
    0% { background: var(--ink); color: var(--ink); }
    33% { background: #4a3a18; color: #6a5e3e; }
    66% { background: #8a6a20; color: #8a8270; }
    100% { background: var(--stamp-red, #8a1e22); color: transparent; }
}

.redacted-decrypt-text {
    display: inline-block;
    font-family: var(--font-mono, 'Special Elite', monospace);
    font-size: 0.55rem;
    color: var(--stamp-red, #8a1e22);
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.redacted:hover .redacted-decrypt-text {
    opacity: 1;
}

/* ---- 15. 随机系统闪烁 ---- */
.sys-alert-flash {
    position: fixed; inset: 0;
    border: 3px solid transparent;
    pointer-events: none;
    z-index: 9995;
    transition: border-color 0.15s;
}

.sys-alert-flash.active {
    animation: alert-flash 0.5s ease-out;
}

@keyframes alert-flash {
    0% { border-color: transparent; }
    30% { border-color: rgba(138,30,34,0.4); }
    100% { border-color: transparent; }
}

/* ---- 16. 信号强度指示 ---- */
.signal-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 1px;
    height: 10px;
    vertical-align: middle;
}

.signal-bar {
    width: 2px;
    background: #3a6a20;
    border-radius: 1px;
}

.signal-bar:nth-child(1) { height: 3px; }
.signal-bar:nth-child(2) { height: 5px; }
.signal-bar:nth-child(3) { height: 7px; }
.signal-bar:nth-child(4) { height: 10px; }

.signal-bar.weak { background: #5a3818; }
.signal-bar.dead { background: #2a2418; }

/* ---- 17. 印章盖落动画 ---- */
.stamp-slam {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(3) rotate(-15deg);
    z-index: 9990;
    pointer-events: none;
    opacity: 0;
    font-family: var(--font-stamp, 'Oswald', sans-serif);
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--stamp-red, #8a1e22);
    border: 4px solid var(--stamp-red, #8a1e22);
    padding: 12px 32px;
    text-transform: uppercase;
    text-shadow: 0 0 4px rgba(138,30,34,0.3);
    box-shadow: 0 0 0 2px rgba(138,30,34,0.2);
    border-radius: 4px;
    white-space: nowrap;
}

.stamp-slam.animate {
    animation: stamp-slam-anim 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.stamp-slam::after {
    content: '';
    position: absolute; inset: -2px;
    border: 2px solid var(--stamp-red, #8a1e22);
    border-radius: 4px;
    opacity: 0.3;
    transform: rotate(1deg) scale(1.02);
}

@keyframes stamp-slam-anim {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(3) rotate(-15deg); }
    40% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.9) rotate(-8deg); }
    55% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) rotate(-7deg); }
    70% { opacity: 1; transform: translate(-50%, -50%) scale(0.98) rotate(-7.5deg); }
    85% { opacity: 0.8; transform: translate(-50%, -50%) scale(1) rotate(-7deg); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1) rotate(-7deg); }
}

/* ---- 18. 文字解密效果 ---- */
.decode-text {
    font-family: var(--font-mono, 'Special Elite', monospace);
}

.decode-char {
    display: inline-block;
    transition: color 0.05s;
}

.decode-char.scramble {
    color: var(--stamp-red, #8a1e22);
    opacity: 0.6;
}

/* ---- 19. 页面切换过渡 ---- */
.page-transition {
    position: fixed; inset: 0;
    background: #0a0907;
    z-index: 99998;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-family: var(--font-mono, 'Special Elite', monospace);
    color: #6a6258;
    pointer-events: all;
    animation: pt-fade 0.3s ease;
}

@keyframes pt-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-transition.out {
    animation: pt-fade-out 0.3s ease forwards;
}

@keyframes pt-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.pt-spinner {
    width: 32px; height: 32px;
    border: 2px solid #2a2418;
    border-top-color: var(--stamp-red, #8a1e22);
    border-radius: 50%;
    animation: pt-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes pt-spin {
    to { transform: rotate(360deg); }
}

.pt-text {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: #555048;
}

.pt-bar {
    width: 200px; height: 2px;
    background: #1a1812;
    margin-top: 16px;
    overflow: hidden;
}

.pt-bar-fill {
    height: 100%; width: 0%;
    background: var(--stamp-red, #8a1e22);
    animation: pt-bar-load 0.6s ease forwards;
}

@keyframes pt-bar-load {
    to { width: 100%; }
}

/* ---- 20. 滚动揭示扫描 ---- */
.scroll-reveal {
    position: relative;
}

.scroll-reveal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(138,30,34,0.06), transparent 30%, transparent 70%, rgba(26,56,88,0.04));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
}

.scroll-reveal.revealing::before {
    opacity: 1;
    animation: reveal-scan 0.6s ease-out;
}

@keyframes reveal-scan {
    0% { background: linear-gradient(180deg, rgba(138,30,34,0.15), transparent 50%); transform: translateY(0); }
    100% { background: linear-gradient(180deg, transparent, transparent); transform: translateY(100%); }
}

/* ---- 21. 背景氛围粒子 ---- */
.ambient-particles {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.ambient-dot {
    position: absolute;
    width: 2px; height: 2px;
    background: rgba(138,100,30,0.3);
    border-radius: 50%;
    animation: ambient-float linear infinite;
}

@keyframes ambient-float {
    from { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    to { transform: translateY(-10vh) translateX(20px); opacity: 0; }
}

/* ---- 22. 威胁等级指示器 ---- */
.threat-indicator {
    position: fixed;
    top: 90px; left: 0;
    z-index: 8998;
    background: rgba(10,8,6,0.92);
    border-right: 1px solid #2a2418;
    border-bottom: 1px solid #2a2418;
    padding: 6px 12px;
    font-family: var(--font-mono, 'Special Elite', monospace);
    font-size: 0.6rem;
    color: #5a5248;
    display: flex; flex-direction: column;
    gap: 3px;
    backdrop-filter: blur(4px);
}

.threat-label {
    letter-spacing: 0.15em;
    color: #4a4438;
    text-transform: uppercase;
    font-size: 0.5rem;
}

.threat-level {
    display: flex; align-items: center; gap: 6px;
}

.threat-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.threat-bar {
    width: 4px;
    background: #2a2418;
    border-radius: 1px;
    transition: background 0.3s;
}

.threat-bar:nth-child(1) { height: 3px; }
.threat-bar:nth-child(2) { height: 6px; }
.threat-bar:nth-child(3) { height: 9px; }
.threat-bar:nth-child(4) { height: 12px; }
.threat-bar:nth-child(5) { height: 15px; }

.threat-bar.active.green { background: #3a6a20; }
.threat-bar.active.yellow { background: #8a6818; }
.threat-bar.active.orange { background: #b5651d; }
.threat-bar.active.red { background: #8a3020; }
.threat-bar.active.critical { background: #8a1e22; animation: threat-pulse 0.5s ease-in-out infinite alternate; }

@keyframes threat-pulse {
    from { box-shadow: 0 0 2px #8a1e22; }
    to { box-shadow: 0 0 8px #8a1e22; }
}

.threat-text {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
}

.threat-text.green { color: #4a7a30; }
.threat-text.yellow { color: #8a7818; }
.threat-text.orange { color: #b5651d; }
.threat-text.red { color: #8a4030; }
.threat-text.critical { color: #8a1e22; }

/* ---- 23. 终端控制台 ---- */
.terminal-console {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 140px;
    background: rgba(8,7,5,0.97);
    border-top: 1px solid #2a2418;
    font-family: var(--font-mono, 'Special Elite', monospace);
    z-index: 9600;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(6px);
    transition: height 0.25s ease;
}

.terminal-console::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(138,30,34,0.3), transparent);
}

.terminal-console.collapsed {
    height: 30px;
}

.terminal-console.collapsed .terminal-body {
    display: none;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 14px;
    background: rgba(14,12,6,0.8);
    border-bottom: 1px solid #1a1812;
    height: 30px;
    flex-shrink: 0;
}

.terminal-title-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #3a6a20;
    box-shadow: 0 0 4px #3a6a20;
    animation: pulse-dot 2s ease-in-out infinite;
}

.terminal-title {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: #6a6250;
    text-transform: uppercase;
}

.terminal-session {
    font-size: 0.5rem;
    color: #4a4438;
    letter-spacing: 0.1em;
    margin-left: 8px;
    padding: 1px 6px;
    border: 1px solid #2a2418;
    border-radius: 1px;
}

.terminal-controls {
    display: flex;
    gap: 4px;
}

.terminal-btn {
    background: transparent;
    border: 1px solid #2a2418;
    color: #5a5248;
    font-size: 0.65rem;
    width: 22px; height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1px;
    transition: all 0.15s;
    font-family: inherit;
}

.terminal-btn:hover {
    border-color: #4a3a18;
    color: #8a8270;
    background: #14110a;
}

.terminal-btn.muted {
    color: #4a4438;
}

.terminal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.terminal-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.12) 2px,
        rgba(0,0,0,0.12) 3px
    );
    pointer-events: none;
    animation: crt-scroll 8s linear infinite;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 6px 14px;
    font-size: 0.62rem;
    line-height: 1.7;
    color: #5a5248;
}

.terminal-output::-webkit-scrollbar { width: 3px; }
.terminal-output::-webkit-scrollbar-track { background: transparent; }
.terminal-output::-webkit-scrollbar-thumb { background: #2a2418; }

.terminal-line {
    white-space: pre-wrap;
    word-break: break-word;
    animation: log-entry-in 0.15s ease;
}

.terminal-line.ok { color: #4a6a30; }
.terminal-line.danger { color: #8a4030; }
.terminal-line.hint { color: #6a5e3e; font-style: italic; }
.terminal-line.sys { color: #6a6250; }
.terminal-line.cmd { color: #8a7858; }

.terminal-input-line {
    display: flex;
    align-items: center;
    padding: 4px 14px;
    border-top: 1px solid #1a1812;
    background: rgba(14,12,6,0.6);
    gap: 4px;
    position: relative;
}

.terminal-prompt {
    color: #4a4438;
    font-size: 0.6rem;
    white-space: nowrap;
}

.terminal-input {
    flex: 1;
    color: #8a8270;
    font-size: 0.6rem;
    outline: none;
    background: transparent;
    border: none;
    min-width: 0;
    word-break: break-all;
}

.terminal-input:empty::before {
    content: 'Type a command...';
    color: #3a3428;
}

.terminal-cursor {
    color: var(--stamp-red, #8a1e22);
    font-size: 0.6rem;
    animation: terminal-cursor-blink 0.8s step-end infinite;
}

.terminal-input-line.active .terminal-cursor {
    animation: terminal-cursor-blink 0.6s step-end infinite;
}

@keyframes terminal-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ---- 24. 角落HUD框架 ---- */
.corner-hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 8990;
}

.corner-hud-tl, .corner-hud-tr, .corner-hud-bl, .corner-hud-br {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono, 'Special Elite', monospace);
    font-size: 0.5rem;
    color: rgba(90,82,72,0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.corner-hud-tl { top: 80px; left: 6px; flex-direction: row; }
.corner-hud-tr { top: 80px; right: 6px; flex-direction: row-reverse; }
.corner-hud-bl { bottom: 145px; left: 6px; flex-direction: row; }
.corner-hud-br { bottom: 145px; right: 6px; flex-direction: row-reverse; }

.corner-bracket {
    width: 12px; height: 12px;
    border-color: rgba(90,82,72,0.35);
    border-style: solid;
    flex-shrink: 0;
}

.corner-hud-tl .corner-bracket { border-width: 2px 0 0 2px; }
.corner-hud-tr .corner-bracket { border-width: 2px 2px 0 0; }
.corner-hud-bl .corner-bracket { border-width: 0 0 2px 2px; }
.corner-hud-br .corner-bracket { border-width: 0 2px 2px 0; }

.corner-text {
    white-space: nowrap;
}

.corner-coords { color: rgba(106,94,62,0.45); }
.corner-fps { color: rgba(74,106,48,0.45); }

/* ---- 25. 文档指纹 ---- */
.doc-fingerprint {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    margin-top: 20px;
    background: rgba(10,8,6,0.03);
    border: 1px dashed rgba(42,36,24,0.2);
    border-radius: 1px;
    font-family: var(--font-mono, 'Special Elite', monospace);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: var(--ink-fade, #5a5248);
    opacity: 0.6;
}

.fp-label { color: #4a4438; font-weight: bold; }
.fp-hash { color: #6a5e3e; }
.fp-check { color: #4a4438; }

/* ---- 页面内搜索高亮 ---- */
.terminal-find-hl {
    background: rgba(138,110,32,0.45);
    color: #e8d8a0;
    padding: 0 2px;
    border-radius: 1px;
    box-shadow: 0 0 4px rgba(138,110,32,0.5);
    animation: find-pulse 1.2s ease-in-out infinite;
}

@keyframes find-pulse {
    0%, 100% { background: rgba(138,110,32,0.45); }
    50% { background: rgba(170,140,40,0.65); }
}

/* ---- 26. 移动端适配 ---- */
@media (max-width: 700px) {
    .boot-logo { font-size: 2rem; }
    .boot-sub { font-size: 0.6rem; }
    .boot-lines { font-size: 0.7rem; max-width: 300px; }
    .boot-bar { width: 220px; }

    .clearance-box {
        padding: 24px 20px 20px;
    }
    .clearance-title { font-size: 0.95rem; }

    .sys-status {
        font-size: 0.55rem;
        padding: 4px 10px;
        gap: 10px;
    }

    .toast-container { max-width: 260px; top: 80px; }
    .toast-item { font-size: 0.6rem; padding: 6px 10px; }
    .toast-time { display: none; }

    .access-log-panel { width: 240px; max-height: 200px; bottom: 112px; }
    .access-log-body { max-height: 160px; font-size: 0.5rem; }

    .security-banner { font-size: 0.45rem; height: 18px; }

    .crt-overlay { opacity: 0.08; }

    .stamp-slam { font-size: 2.5rem; padding: 8px 16px; }
    .threat-indicator { font-size: 0.5rem; padding: 4px 8px; }
    .threat-bar { width: 3px; }
    .threat-bars { height: 10px; }
    .pt-bar { width: 160px; }

    .terminal-console { height: 110px; }
    .terminal-console.collapsed { height: 28px; }
    .terminal-output { font-size: 0.52rem; }
    .terminal-title { font-size: 0.5rem; }
    .terminal-prompt, .terminal-input, .terminal-cursor { font-size: 0.5rem; }
    .terminal-session { display: none; }

    .corner-hud-tl, .corner-hud-tr { top: 70px; }
    .corner-hud-bl, .corner-hud-br { bottom: 115px; }
    .corner-text { font-size: 0.4rem; }
    .doc-fingerprint { font-size: 0.45rem; gap: 6px; padding: 6px 10px; }
}

@media (max-width: 480px) {
    .sys-status .ss-session,
    .sys-status .ss-sep:nth-of-type(2) {
        display: none;
    }
    .toast-container { max-width: 220px; }
    .access-log-panel { display: none !important; }
    .threat-indicator { display: none; }
    .corner-hud { display: none; }
    .terminal-console { height: 90px; }
    .terminal-console.collapsed { height: 26px; }
    .terminal-output { font-size: 0.45rem; padding: 4px 8px; }
    .terminal-input-line { padding: 3px 8px; }
}
