/* =========================================
   全局重置与等宽字型规范 (全面支持全端自由双指缩放与自由平移)
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #AAAAAA #000080;
}

.hidden {
    display: none !important;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: #0000AA;
    color: #AAAAAA;
    font-family: 'Consolas', 'Menlo', 'Monaco', 'Cascadia Code', 'Courier New', 
                 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'SimSun', monospace;
    cursor: default;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;

}

html {
    overflow-y: auto;
    font-size: 18px;
}

/* 🌟 在电脑桌面端锁死外层窗口，消除重叠的双滚动条 */
@media (min-width: 769px) {
    html, body {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }
    .doc-window {
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
        margin: 10px auto !important;
    }
}

a, button, .menu-btn, .dos-button, .close-btn, .header-btn, .photo-item, .album-card, .dos-clock, .status-btn, .dropdown-item, .tag-badge, tr[data-slug], .term-quick-btn {
    cursor: pointer !important;
}

.doc-article, .doc-panel, .post-content-body, p, code, pre, .terminal-content {
    cursor: text;
}

.window-header {
    cursor: move;
    touch-action: none !important;
    user-select: none;
    -webkit-user-select: none;
}

.img-viewport {
    cursor: zoom-in;
}

.img-viewport.zoomable {
    cursor: grab !important;
}

.img-viewport.dragging {
    cursor: grabbing !important;
}

/* =========================================
   Turbo Vision 顶部菜单栏与防挤压时钟
   ========================================= */
.dos-menu {
    background-color: #AAAAAA;
    color: #000000;
    padding: 0 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    font-weight: bold;
    font-size: 0.88rem;
    border-bottom: 2px solid #000000;
    box-shadow: 0 2px 0px #000000;
    z-index: 500;
    height: 28px;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    overflow: visible !important;
}

.menu-items {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1 1 auto;
    height: 100%;
    min-width: 0;
    overflow: visible !important;
}

.menu-dropdown-wrapper {
    position: relative;
    height: 100%;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.menu-btn {
    padding: 2px 7px;
    transition: none;
    text-decoration: none;
    color: #000000;
    display: inline-flex;
    align-items: center;
    height: 24px;
    background-color: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: bold;
    box-sizing: border-box;
    white-space: nowrap;
    flex-shrink: 0;
}

.menu-btn:hover, .menu-btn.active, .menu-btn.open {
    background-color: #0000AA !important;
    color: #FFFFFF !important;
}

.menu-btn:hover .hotkey, .menu-btn.active .hotkey, .menu-btn.open .hotkey {
    color: #FFFF55 !important;
}

.dos-menu .hotkey {
    color: #AA0000; 
}

.menu-dropdown {
    position: absolute;
    top: 26px;
    left: 0;
    background-color: #AAAAAA;
    border: 2px solid #000000;
    box-shadow: 6px 6px 0px #000000;
    min-width: 240px;
    display: none;
    flex-direction: column;
    z-index: 600;
    padding: 2px 0;
}

.menu-dropdown.align-right {
    left: auto !important;
    right: 0 !important;
}

.menu-dropdown.show {
    display: flex !important;
}

.dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px;
    color: #000000;
    font-size: 0.84rem;
    font-weight: bold;
    text-decoration: none;
    background-color: transparent;
    white-space: nowrap;
    border: none;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.dropdown-item:hover, .dropdown-item.focused {
    background-color: #0000AA;
    color: #FFFFFF;
}

.dropdown-item:hover .hotkey, .dropdown-item.focused .hotkey {
    color: #FFFF55;
}

.dropdown-item:hover .dropdown-shortcut, .dropdown-item.focused .dropdown-shortcut {
    color: #55FFFF;
}

.dropdown-item .hotkey {
    color: #AA0000;
}

.dropdown-shortcut {
    color: #444444;
    font-size: 0.78rem;
    font-weight: normal;
    margin-left: 16px;
}

.dropdown-divider {
    border-top: 1px solid #777777;
    border-bottom: 1px solid #FFFFFF;
    margin: 3px 1px;
}

.dos-clock {
    color: #000000;
    padding: 2px 6px;
    letter-spacing: 0.5px;
    border-left: 1px solid #777777;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    margin-left: auto !important;
    font-family: inherit;
    font-size: 0.82rem;
    background-color: #AAAAAA;
    z-index: 10;
}

.dos-clock:hover {
    background-color: #000000;
    color: #55FFFF;
}

/* =========================================
   底部状态栏
   ========================================= */
.dos-status {
    background-color: #AAAAAA;
    color: #000000;
    padding: 3px 12px;
    /* 🌟 智能适配手机圆角与安全边距，两边绝对不贴边 */
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-weight: bold;
    font-size: 0.8rem;
    border-top: 2px solid #FFFFFF;
    user-select: none;
    z-index: 500;
    height: 28px;
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
    box-sizing: border-box;
}

.status-right {
    color: #000000;
    z-index: 2;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.status-left {
    display: flex;
    gap: 10px;
    z-index: 2;
}

.status-btn {
    padding: 0 4px;
}

.status-btn:hover {
    background-color: #0000AA;
    color: #FFFFFF;
}

.status-btn:hover .hotkey {
    color: #FFFF55;
}

.status-left .hotkey {
    color: #AA0000;
}

.status-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #000000;
    letter-spacing: 1px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
}


/* =========================================
   全幅满高 DOS 视窗通用规范
   ========================================= */
.dos-window {
    margin: 15px auto 25px;
    width: 94%;
    max-width: 1400px;
    background-color: #0000AA;
    border: 4px double #FFFFFF; 
    box-shadow: 8px 8px 0px #000000; 
    display: flex;
    flex-direction: column;
}

.doc-window {
    width: 96vw !important;
    max-width: 1600px !important;
    height: calc(100vh - 76px) !important;
    height: calc(100dvh - 76px) !important;
    margin: 10px auto !important;
    box-shadow: 8px 8px 0px #000000;
}

.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #FFFFFF;
    color: #0000AA;
    font-weight: bold;
    padding: 3px 8px;
    user-select: none;
    border-bottom: 2px solid #000000;
    flex-shrink: 0;
    touch-action: none !important;
    gap: 6px;
    height: 28px;
}

.window-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
    font-size: 0.85rem;
}

.header-btn {
    color: #0000AA;
    flex-shrink: 0;
}

.window-content {
    padding: 16px;
    background-color: #0000AA;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.doc-layout {
    flex: 1;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    background-color: #0000AA;
    padding: 16px 20px !important;
}

.doc-article {
    color: #FFFFFF;
    line-height: 1.7;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 100%;
}

.dir-toolbar {
    background-color: #000080;
    border: 2px solid #55FFFF;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 6px;
}

.dir-toolbar.hidden {
    display: none !important;
}

.dir-path-tag {
    color: #FFFF55;
    font-weight: bold;
    font-size: 0.84rem;
    line-height: 1.4;
    word-break: break-all;
    white-space: normal;
    flex: 1;
}

/* =========================================
   画廊与文件夹封面
   ========================================= */
.gallery-section-title {
    color: #FFFF55;
    font-size: 0.90rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    border-bottom: 1px dashed #55FFFF;
    padding-bottom: 4px;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
}

.album-card {
    border: 2px solid #55FFFF;
    background-color: #000080;
    box-shadow: 4px 4px 0px #000000;
    display: flex;
    flex-direction: column;
    transition: all 0.05s ease-in-out;
    cursor: pointer;
    overflow: hidden;
}

.album-card-header {
    background-color: #55FFFF;
    color: #0000AA;
    padding: 3px 8px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
}

.dir-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dir-badge {
    background-color: #0000AA;
    color: #FFFF55;
    padding: 0 4px;
    flex-shrink: 0;
    font-size: 0.76rem;
}

.album-cover-box {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    background-color: #000040;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid #55FFFF;
}

.album-cover-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    pointer-events: none !important;
}

/* 2. [DIR] 文件夹图标徽章（居中 + 放大） */
.album-dir-badge-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 🌟 锁定在正中心 */

    /* 🌟 核心：锁定徽章本身为 4:3 比例并放大 */
    width: 80px;                     /* 徽章宽度（想更大可以调成 120px 或 130px） */
    aspect-ratio: 4 / 3;             /* 🌟 严格 4:3 比例（高自动为 82.5px） */

    background-color: rgba(0, 0, 96, 0.90); /* 半透明 DOS 深蓝底色 */
    border: 2px solid #55FFFF;        /* 亮青色边框 */
    box-shadow: 4px 4px 0px #000000;  /* 复古硬阴影 */

    /* 内部排版：上面大文件夹图标，下面 [DIR] 文字，上下居中排列 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;

    color: #FFFF55;
    font-size: 0.92rem;
    font-weight: bold;
    letter-spacing: 1px;
    user-select: none;
    backdrop-filter: blur(3px);
    z-index: 2;
    pointer-events: none !important;
    transition: all 0.1s ease-in-out;
}


.album-dir-badge-overlay svg {
    width: 38px;                      /* 图标放大到 38px */
    height: 32px;
    vertical-align: middle;
    flex-shrink: 0;
}


.album-card:hover .album-dir-badge-overlay {
    background-color: #55FFFF;
    color: #0000AA;
    border-color: #FFFF55;
}

.album-meta-box {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: #000080;
}

.album-title {
    color: #FFFF55;
    font-weight: bold;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-detail-line {
    display: flex;
    flex-direction: column; /* 🌟 改为上下独立分行，彻底杜绝文字折行拥挤 */
    gap: 3px;
    font-size: 0.76rem;
    color: #55FFFF;
    white-space: nowrap;    /* 保持单行整齐不换行 */
}

.album-count {
    color: #55FF55;         /* 荧光绿统计数量，高亮醒目 */
    font-weight: bold;
}

.album-gear {
    color: #AAAAAA;
    font-size: 0.74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-card:hover {
    border-color: #FFFF55;
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0px #000000;
}
.album-card:hover .album-card-header {
    background-color: #FFFF55;
    color: #0000AA;
}

.photo-item {
    border: 2px solid #55FFFF;
    background-color: #000080;
    box-shadow: 4px 4px 0px #000000;
    display: flex;
    flex-direction: column;
    transition: all 0.05s ease-in-out;
    cursor: pointer;
    overflow: hidden;
}

.photo-item-cover {
    width: 100%;
    aspect-ratio: 3 / 2;
    background-color: #000000;
    overflow: hidden;
    border-bottom: 2px solid #55FFFF;
}

.photo-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    pointer-events: none !important;
}

.photo-meta-bar {
    padding: 6px 8px;
    background-color: #000080;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.photo-name-tag {
    color: #FFFF55;
    font-size: 0.78rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.photo-exif-badge {
    background-color: #000000;
    color: #55FF55;
    padding: 1px 5px;
    font-size: 0.72rem;
    border: 1px solid #555555;
    flex-shrink: 0;
    white-space: nowrap;
}

.photo-item:hover {
    border-color: #FFFF55;
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0px #000000;
}
.photo-item:hover .photo-meta-bar {
    background-color: #55FFFF;
}
.photo-item:hover .photo-name-tag {
    color: #0000AA;
}
.photo-item:hover .photo-exif-badge {
    background-color: #0000AA;
    color: #FFFF55;
    border-color: #0000AA;
}

/* =========================================
   文档、面板与文章标题框
   ========================================= */
.doc-header-box {
    background-color: #000080;
    border: 3px double #55FFFF;
    box-shadow: 4px 4px 0px #000000;
    color: #FFFF55;
    font-weight: bold;
    text-align: center;
    padding: 6px 12px;
    font-size: 0.92rem;
    letter-spacing: 1px;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-line {
    color: #55FFFF;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: clip;
    max-width: 100%;
}

.header-content {
    color: #FFFF55;
    background-color: #000080;
    padding: 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-section { display: flex; flex-direction: column; gap: 10px; }
.doc-title { color: #FFFF55; font-size: 1.05rem; border-bottom: 2px solid #55FFFF; padding-bottom: 4px; letter-spacing: 1px; }

.doc-panel {
    background-color: #000080;
    border: 2px solid #55FFFF;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #55FFFF;
}
.doc-panel p { margin: 0; }
.doc-panel strong { color: #FFFF55; margin-right: 8px; }

.doc-list-panel {
    background-color: #000080;
    border: 2px solid #55FFFF;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item { display: flex; gap: 10px; align-items: flex-start; color: #FFFFFF; }
.list-bullet { color: #55FFFF; font-weight: bold; flex-shrink: 0; }
.list-item strong { color: #FFFF55; }

.doc-footer-sign {
    margin-top: 15px;
    text-align: center;
    color: #55FF55;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 12px 0;
    border-top: 1px dashed #55FFFF;
}

/* =========================================
   POSTS.EXE
   ========================================= */
.posts-tag-bar {
    background-color: #000080;
    border: 2px solid #55FFFF;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    user-select: none;
}

.tag-bar-label { color: #FFFF55; font-weight: bold; font-size: 0.84rem; }

.tag-badge {
    background-color: #AAAAAA;
    color: #000000;
    padding: 2px 6px;
    font-size: 0.78rem;
    font-weight: bold;
    border: 1px solid #FFFFFF;
    box-shadow: 2px 2px 0px #000000;
    text-decoration: none;
}
.tag-badge:hover, .tag-badge.active { background-color: #55FFFF; color: #0000AA; border-color: #FFFF55; }

.posts-table-container {
    background-color: #000080;
    border: 2px solid #55FFFF;
    box-shadow: 6px 6px 0px #000000;
    overflow-x: auto;
}

.dos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    color: #FFFFFF;
    text-align: left;
}

.dos-table th {
    background-color: #55FFFF;
    color: #0000AA;
    padding: 6px 10px;
    font-weight: bold;
    border-bottom: 2px solid #000000;
    white-space: nowrap;
}

.dos-table td {
    padding: 8px 10px;
    border-bottom: 1px dashed #0000AA;
    vertical-align: middle;
    word-break: break-all;
}

.dos-table tbody tr { transition: background-color 0.05s; }
.dos-table tbody tr:hover { background-color: #55FFFF; color: #0000AA; }
.dos-table tbody tr:hover td { color: #0000AA; }
.dos-table tbody tr:hover .post-file-link { color: #0000AA; }
.dos-table tbody tr:hover .post-tag-item { background-color: #0000AA; color: #FFFF55; }

.post-file-link {
    color: #FFFF55;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.post-file-tag {
    color: #55FFFF; /* 平时是亮青色 */
    margin-right: 4px;
}

/* 🌟 核心：鼠标滑过高亮时，自动切换为深蓝色，清晰可见绝不隐形 */
.dos-table tbody tr:hover .post-file-tag {
    color: #000080 !important;
}

.post-tag-item {
    background-color: #000000;
    color: #55FF55;
    padding: 1px 5px;
    font-size: 0.74rem;
    margin-right: 4px;
    border: 1px solid #555555;
    display: inline-block;
}

.post-size { color: #AAAAAA; font-family: inherit; }
.post-date { color: #55FFFF; white-space: nowrap; }
.dos-table tbody tr:hover .post-date,
.dos-table tbody tr:hover .post-size { color: #000080; }

.post-reader-container { 
    display: flex; 
    flex-direction: column; 
    gap: 14px; 
    width: 100%;
}

.post-content-body { 
    color: #FFFFFF; 
    line-height: 1.8; 
    font-size: 0.94rem;
    overflow-wrap: break-word;
    word-break: break-word;
}
.post-content-body h1,
.post-content-body h2,
.post-content-body h3 {
    color: #FFFF55;
    margin-top: 24px;
    margin-bottom: 12px;
    border-bottom: 1px dashed #55FFFF;
    padding-bottom: 4px;
}
.post-content-body h1 { font-size: 1.25rem; }
.post-content-body h2 { font-size: 1.1rem; }
.post-content-body h3 { font-size: 0.98rem; color: #55FFFF; }
.post-content-body p { margin-bottom: 14px; }
.post-content-body ul, .post-content-body ol { margin-left: 24px; margin-bottom: 14px; }
.post-content-body li { margin-bottom: 4px; }
.post-content-body a { color: #55FFFF; text-decoration: underline; }
.post-content-body a:hover { background-color: #FFFF55; color: #0000AA; }

.post-content-body pre {
    background-color: #000000;
    border: 2px solid #55FFFF;
    box-shadow: 4px 4px 0px #000000;
    padding: 12px 14px;
    overflow-x: auto;
    margin: 16px 0;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.5;
    tab-size: 4;
    -webkit-overflow-scrolling: touch;
}

.post-content-body code {
    background-color: #000000;
    color: #FFFF55;
    padding: 1px 5px;
    border: 1px solid #333333;
    font-family: inherit;
    font-size: 0.88rem;
}
.post-content-body pre code { background-color: transparent; padding: 0; border: none; color: #55FF55; }

.post-content-body blockquote {
    background-color: #000080;
    border-left: 4px solid #FFFF55;
    padding: 8px 14px;
    margin: 14px 0;
    color: #55FFFF;
    font-style: normal;
}

.post-content-body img {
    max-width: 100%;
    height: auto;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    margin: 12px 0;
}

/* =========================================
   浮动窗口通用规范
   ========================================= */
.floating-window {
    position: fixed;
    background-color: #AAAAAA;
    border: 4px double #000000;
    box-shadow: 10px 10px 0px #000000;
    display: flex;
    flex-direction: column;
    max-width: 96vw;
}

.floating-window.hidden { display: none !important; }
.floating-window .window-header { 
    background-color: #0000AA; 
    color: #FFFFFF; 
    touch-action: none !important; 
    cursor: move;
}
.floating-window .header-btn { color: #55FFFF; }

.close-btn { color: #55FFFF; font-weight: bold; padding: 0 4px; flex-shrink: 0; }
.close-btn:hover { background-color: #AA0000; color: #FFFF55; }

.dialog-content {
    padding: 8px;
    background-color: #AAAAAA;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    box-sizing: border-box;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}

/* =========================================
   COMMAND.COM 终端样式
   ========================================= */
#terminal-window {
    width: 620px;
    max-width: 95vw;
    height: 380px;
    max-height: 80vh;
    max-height: 80dvh;
    z-index: 300;
}

.terminal-content {
    background-color: #000000;
    color: #55FF55;
    font-family: inherit;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 28px);
    overflow-y: auto;
    box-sizing: border-box;
    border: 2px solid #55FFFF;
    position: relative;
    cursor: text;
}

.terminal-output {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.45;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
    flex: 1;
}

.terminal-line { color: #AAAAAA; }
.terminal-line.green { color: #55FF55; }
.terminal-line.cyan { color: #55FFFF; }
.terminal-line.yellow { color: #FFFF55; }
.terminal-line.red { color: #FF5555; }

.terminal-quick-bar {
    display: none;
    gap: 6px;
    padding: 6px 0;
    overflow-x: auto;
    white-space: nowrap;
    border-top: 1px dashed #333333;
    margin-top: 6px;
    flex-shrink: 0;
}

.term-quick-btn {
    background-color: #000080;
    color: #55FFFF;
    border: 1px solid #55FFFF;
    box-shadow: 2px 2px 0px #000000;
    font-family: inherit;
    font-weight: bold;
    font-size: 0.76rem;
    padding: 3px 8px;
    outline: none;
    user-select: none;
    flex-shrink: 0;
}

.term-quick-btn:hover {
    background-color: #55FFFF;
    color: #0000AA;
}

.term-quick-btn:active {
    transform: translate(1px, 1px);
    box-shadow: none;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-shrink: 0;
}

.terminal-prompt {
    color: #55FFFF;
    font-weight: bold;
    font-size: 0.86rem;
    white-space: nowrap;
}

#terminal-cmd-input {
    background: transparent;
    border: none;
    outline: none;
    color: #FFFF55;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: bold;
    flex: 1;
    min-width: 0;
    padding: 0;
    margin: 0;
    caret-color: #55FF55;
    caret-shape: block;
}

#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 10;
    background-color: #000000;
    cursor: pointer;
}

/* =========================================
   Tier 1: 浮动查看器 (VIEWER.EXE)
   ========================================= */
#viewer-window {
    width: min(960px, 88vw);
    min-width: 320px;
    max-width: 88vw;
    height: auto;
    max-height: 88vh;
    max-height: 88dvh;
    z-index: 100;
}

#viewer-window .dialog-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    overflow: hidden;
}

.img-viewport {
    position: relative;
    width: 100%;
    height: clamp(220px, 56vh, 620px);
    height: clamp(220px, 56dvh, 620px);
    max-width: 100%;
    flex: 0 0 auto;
    background-color: #17191D;
    border: 2px solid #000000;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
    margin: 0 auto;
}

#lb-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
    opacity: 0;
}

#lb-img.is-ready {
    opacity: 1;
}

.viewer-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: #FFFF55;
    background-color: #000000;
    font-weight: bold;
}

#viewer-window.is-loading .viewer-loading {
    display: flex;
}

.viewer-toolbar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.viewer-toolbar .dos-button {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 4px 2px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-details {
    width: 100%;
    background-color: #0000AA;
    color: #55FFFF;
    padding: 6px 10px;
    border: 2px solid #000000;
    font-size: 0.82rem;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.2fr;
    gap: 4px 10px;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* =========================================
   🌟 查看器底部参数栏（杜绝冒号和英文折行）
   ========================================= */
.meta-col { 
    display: flex; 
    flex-direction: column; 
    gap: 3px; 
    min-width: 0; 
}

.meta-col p { 
    margin: 0; 
    display: flex; 
    align-items: baseline; 
    gap: 6px;             /* 🌟 标签与内容之间保持合适间距 */
    line-height: 1.4; 
    white-space: nowrap;  /* 🌟 整行禁止随意折行 */
}

.meta-col strong { 
    color: #FFFF55; 
    width: auto;          /* 🌟 去除死板的 48px 限制，按文字长度自适应 */
    white-space: nowrap;  /* 🌟 严禁把冒号和英文单词拆断换行 */
    flex-shrink: 0; 
}

.meta-col span { 
    color: #55FFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 🌟 如果在极小屏幕放不下，显示省略号，绝不乱折行 */
}   

/* =========================================
   🌟 最大化看图器（全屏自适应，参数永不丢失）
   ========================================= */
#viewer-window.maximized {
    top: 28px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 28px !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(100vh - 56px) !important;
    height: calc(100dvh - 56px) !important;
    max-height: calc(100dvh - 56px) !important;
    transform: none !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: 3px double #000000;
    z-index: 100;
    overflow: hidden !important;
}

#viewer-window.maximized .dialog-content {
    height: calc(100% - 28px);
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    gap: 6px;
    box-sizing: border-box;
    background-color: #AAAAAA;
    overflow: hidden !important; /* 锁定无滚动条 */
}

#viewer-window.maximized .img-viewport {
    flex: 1 1 0; /* 🌟 让图片视口自动吃满剩余空间 */
    min-height: 0;
    min-width: 0;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    border: 2px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#viewer-window.maximized #lb-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: none;
}

/* 🌟 核心保底：工具栏和参数栏严禁被图片挤压，永远固定显示在最下方 */
#viewer-window.maximized .viewer-toolbar,
#viewer-window.maximized .lb-details {
    flex-shrink: 0 !important;
}

/* =========================================
   Tier 2: 系统悬浮工具
   ========================================= */
#time-window { width: 410px; max-width: 92vw; z-index: 200; }

.clock-body {
    width: 100%;
    display: flex;
    gap: 12px;
    background-color: #0000AA;
    padding: 10px;
    border: 2px solid #000000;
    align-items: center;
    justify-content: center;
}

.analog-box {
    width: 130px; height: 130px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}

.clock-detail-panel { color: #55FFFF; font-size: 0.85rem; line-height: 1.5; flex: 1; }
.clock-detail-panel strong { color: #FFFF55; margin-right: 6px; }

#help-window { width: 520px; max-width: 94vw; z-index: 201; }

.help-content-panel {
    width: 100%;
    background-color: #0000AA;
    color: #55FFFF;
    padding: 10px 12px;
    border: 2px solid #000000;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.help-section-title {
    color: #FFFF55;
    font-weight: bold;
    border-bottom: 1px dashed #55FFFF;
    padding-bottom: 2px;
    margin-top: 4px;
    letter-spacing: 1px;
}
.help-section-title:first-child { margin-top: 0; }

.help-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 0;
}

.help-row span {
    background-color: #000000;
    color: #55FF55;
    padding: 1px 5px;
    border: 1px solid #555555;
    font-family: inherit;
    font-size: 0.78rem;
    white-space: nowrap;
}

.help-row strong {
    color: #FFFFFF;
    font-weight: normal;
    text-align: right;
    padding-left: 8px;
}

#welcome-window { width: 560px; max-width: 92vw; z-index: 202; }
#welcome-window > .dialog-content { align-items: stretch; overflow: hidden; }

.welcome-content-panel {
    width: 100%;
    background-color: #000080;
    color: #FFFFFF;
    padding: 16px 18px;
    border: 2px solid #55FFFF;
    font-size: 0.84rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
}

.welcome-intro { display: grid; gap: 6px; }
.welcome-kicker { color: #55FFFF; font-size: .65rem; letter-spacing: .04em; }
.welcome-intro h2 { color: #FFFF55; font-size: 1.05rem; line-height: 1.5; }
.welcome-text { color: #EEEEEE; }
.welcome-guide { border-top: 1px dashed #5555AA; padding-top: 12px; }
.welcome-guide h3 { color: #FFFF55; font-size: .86rem; margin-bottom: 4px; }
.welcome-nav-location { color: #55FFFF; font-size: .78rem; }
.welcome-location-mobile { display: none; }
.welcome-sections { margin-top: 8px; }
.welcome-sections > div { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.welcome-sections > div + div { border-top: 1px solid #222288; }
.welcome-sections dt { color: #55FFFF; font-weight: bold; }
.welcome-sections dd { display: grid; gap: 1px; min-width: 0; }
.welcome-sections strong { color: #FFFF55; font-size: .82rem; }
.welcome-sections dd span { font-size: .78rem; color: #EEEEEE; }
.welcome-actions { display: flex; width: 100%; justify-content: center; flex-shrink: 0; }
.welcome-actions .dos-button { min-width: 180px; min-height: 40px; }

.btn-highlight {
    background-color: #0000AA !important;
    color: #FFFF55 !important;
    border-color: #FFFF55 !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-highlight:hover { background-color: #FFFF55 !important; color: #0000AA !important; }

.dialog-actions { display: flex; justify-content: center; padding-top: 4px; }

.dos-button {
    background-color: #AAAAAA;
    color: #000000;
    border: 2px outset #FFFFFF;
    box-shadow: 2px 2px 0px #000000;
    padding: 4px 10px;
    font-family: inherit;
    font-weight: bold;
    font-size: 0.82rem;
    outline: none;
    user-select: none;
}
.dos-button:hover { background-color: #000000; color: #55FFFF; border-color: #55FFFF; }
.dos-button:active { border-style: inset; transform: translate(1px, 1px); box-shadow: none; }
.btn-ok { min-width: 100px; }

/* =========================================
   BBS 留言板表单与列表
   ========================================= */
.bbs-form-panel {
    background-color: #000080;
    border: 2px solid #55FFFF;
    box-shadow: 6px 6px 0px #000000;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bbs-form-header-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.bbs-reply-tag {
    background-color: #000000;
    color: #FFFF55;
    padding: 3px 8px;
    font-size: 0.78rem;
    border: 1px dashed #55FFFF;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bbs-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.bbs-field, .bbs-field-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bbs-field label, .bbs-field-block label {
    color: #FFFF55;
    font-weight: bold;
    font-size: 0.82rem;
}

.bbs-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bbs-char-counter {
    color: #55FFFF;
    font-size: 0.78rem;
    font-weight: bold;
    font-family: inherit;
    letter-spacing: 0.5px;
}

.dos-input, .dos-textarea {
    background-color: #000000;
    color: #55FF55;
    border: 1px solid #55FFFF;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 0.86rem;
    outline: none;
    box-sizing: border-box;
    width: 100%;
}

.dos-textarea {
    min-height: 130px;
    max-height: 350px;
    resize: vertical;
    line-height: 1.5;
    padding: 8px 10px;
    font-family: inherit;
}

@media (max-width: 768px) {
    .dos-input, .dos-textarea, #terminal-cmd-input {
        font-size: 16px !important;
    }
}

.dos-input:focus, .dos-textarea:focus {
    border-color: #FFFF55;
    background-color: #000022;
}

.dos-input::placeholder, .dos-textarea::placeholder {
    color: #666666;
}

.bbs-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bbs-status-msg {
    font-size: 0.82rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.bbs-honeypot-wrap {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    visibility: hidden !important;
}

.dos-button:disabled {
    background-color: #555555 !important;
    color: #888888 !important;
    border-color: #777777 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.album-card:focus-visible,
.photo-item:focus-visible {
    outline: 2px solid #FFFF55;
    outline-offset: 2px;
}

.dos-button:focus-visible {
    outline: 2px solid #FFFF55;
    outline-offset: 1px;
}

/* 留言列表 */
.bbs-archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bbs-list-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}

.bbs-msg-card {
    background-color: #000080;
    border: 2px solid #55FFFF;
    box-shadow: 4px 4px 0px #000000;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background-color 0.05s;
}

.bbs-msg-card:hover {
    border-color: #FFFF55;
}

.bbs-msg-card.admin-card {
    border: 2px solid #FFFF55 !important;
    background-color: #000099;
    box-shadow: 6px 6px 0px #000000;
}

.bbs-msg-card.admin-card:hover {
    background-color: #0000AA;
}

.bbs-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #55FFFF;
    padding-bottom: 6px;
    flex-wrap: wrap;
    gap: 6px;
}

.bbs-msg-card.admin-card .bbs-msg-header {
    border-bottom-color: #FFFF55;
}

.bbs-msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bbs-badge {
    background-color: #000000;
    color: #FFFF55;
    padding: 1px 5px;
    font-size: 0.74rem;
    border: 1px solid #555555;
    font-weight: bold;
}

.bbs-author {
    color: #FFFFFF;
    font-weight: bold;
    font-size: 0.88rem;
}

.bbs-author.is-op {
    color: #FFFF55;
}

.bbs-op-badge {
    background-color: #AA0000;
    color: #FFFF55;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-weight: bold;
    border: 1px solid #FFFF55;
    letter-spacing: 1px;
}

.bbs-device-tag {
    background-color: #000000;
    color: #55FF55;
    padding: 1px 5px;
    font-size: 0.72rem;
    border: 1px solid #555555;
    font-weight: bold;
}

.bbs-geo-tag {
    background-color: #000000;
    color: #FFFF55;
    padding: 1px 5px;
    font-size: 0.72rem;
    border: 1px solid #555555;
    font-weight: bold;
}

.bbs-ip-tag {
    background-color: #000000;
    color: #AAAAAA;
    padding: 1px 5px;
    font-size: 0.72rem;
    border: 1px solid #555555;
    font-weight: bold;
}

.bbs-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bbs-time {
    color: #AAAAAA;
    font-size: 0.78rem;
}

.btn-reply {
    padding: 1px 6px;
    font-size: 0.72rem;
    height: 20px;
    line-height: 1;
}

.bbs-msg-body {
    color: #FFFFFF;
    line-height: 1.6;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 260px;
    overflow-y: auto;    
}

.bbs-replies-container {
    margin-top: 6px;
    border-left: 2px solid #55FFFF;
    margin-left: 8px;
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bbs-replies-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bbs-reply-card {
    background-color: #000060;
    border: 1px solid #55FFFF;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bbs-reply-card.admin-card {
    border-color: #FFFF55;
    background-color: #000077;
}

.bbs-reply-card .bbs-msg-header {
    border-bottom: 1px dashed #3333aa;
    padding-bottom: 4px;
}

.bbs-reply-bullet {
    color: #55FFFF;
    font-weight: bold;
}

.bbs-reply-wrapper.hidden-reply {
    display: none;
}

.bbs-collapse-toggle-btn {
    background: transparent;
    border: 1px dashed #FFFF55;
    color: #FFFF55;
    font-family: inherit;
    font-size: 0.76rem;
    padding: 4px 8px;
    cursor: pointer;
    text-align: left;
    outline: none;
    margin-top: 2px;
}

.bbs-collapse-toggle-btn:hover {
    background-color: #FFFF55;
    color: #0000AA;
}

.bbs-pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px 0 4px;
    margin-top: 8px;
    border-top: 1px dashed #55FFFF;
    flex-wrap: wrap;
}

.bbs-page-info {
    color: #FFFF55;
    font-weight: bold;
    font-size: 0.84rem;
}

.bbs-loading-line, .bbs-empty-line {
    color: #AAAAAA;
    text-align: center;
    padding: 20px;
    font-style: italic;
    background-color: #000080;
    border: 1px dashed #55FFFF;
}

/* =========================================
   CRT 复古显像管扫描线滤镜模式
   ========================================= */
body.crt-mode::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 255, 0, 0.03));
    z-index: 9999;
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
}

body.crt-mode::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 9998;
    pointer-events: none;
}

/* =========================================
   移动端自适应
   ========================================= */
/* Shared accessible controls retain the Turbo Vision palette. */
:root { --dos-blue: #0000AA; --dos-cyan: #55FFFF; --dos-yellow: #FFFF55; }
:focus-visible { outline: 2px solid var(--dos-yellow); outline-offset: 2px; }
.tag-badge, .post-file-link { font-family: inherit; cursor: pointer; }
.dir-breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.viewer-loading { background-color: transparent; text-shadow: 1px 1px #000; }
#lb-img.is-placeholder { opacity: .6; }
#viewer-window.is-loading .viewer-loading { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
