/* 剥离所有网页特征，还原记事本本色 */
body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; background-color: #ffffff; display: flex; flex-direction: column; }

/* 伪造 Windows 顶部菜单栏 */
.menu-bar {
    background-color: #f0f0f0; border-bottom: 1px solid #cccccc; padding: 2px 8px;
    display: flex; justify-content: space-between; font-family: "Segoe UI", sans-serif; font-size: 12px; color: #333; user-select: none;
}
.menu-left { display: flex; }
.menu-item { padding: 4px 8px; cursor: default; position: relative; }
.menu-item:hover { background-color: #e5e5e5; }

/* 原生风格下拉菜单 */
.dropdown-content {
    display: none; position: absolute; top: 100%; left: 0; background-color: #f2f2f2;
    min-width: 200px; box-shadow: 2px 2px 5px rgba(0,0,0,0.2); border: 1px solid #ccc; z-index: 100;
    padding: 2px 0;
}
.dropdown-content div { padding: 5px 15px; display: flex; justify-content: space-between; cursor: default; }
.dropdown-content div:hover:not(.disabled):not(.separator) { background-color: #91c9f7; color: black; }
.dropdown-content .disabled { color: #999; }
.dropdown-content .separator { border-top: 1px solid #ccc; margin: 3px 0; padding: 0; height: 0; }

.shortcut { color: #666; } /* 快捷键灰字显示 */

/* 纯粹的打字机输入区 */
.editor-area {
    flex-grow: 1; border: none; outline: none; padding: 5px 8px;
    font-family: "Consolas", "Courier New", monospace; font-size: 14px;
    resize: none; box-sizing: border-box; background-color: #ffffff;
}

/* 状态栏密码指示器 */
#lock-status { cursor: pointer; font-weight: bold; }
#lock-status:hover { color: #000; }
.unlocked { color: #d73a49; }
.locked { color: #28a745; }

/* 打印时隐藏菜单栏，只打印文本区域 */
@media print {
    .menu-bar { display: none; }
    .editor-area { height: auto; overflow: visible; font-size: 12pt; }
}

/* 🚨 安全密码弹窗 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 1000; justify-content: center; align-items: center; }
.modal-box { background: white; padding: 20px; border-radius: 6px; width: 300px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); font-family: "Segoe UI", sans-serif; }
.modal-title { font-size: 14px; font-weight: bold; margin-bottom: 8px; color: #333; }
.modal-desc { font-size: 12px; color: #666; margin-bottom: 15px; }
#pwd-input { width: 100%; padding: 8px; margin-bottom: 15px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; outline: none; font-family: monospace; letter-spacing: 2px;}
#pwd-input:focus { border-color: #0078D7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions button { padding: 6px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; }
.btn-cancel { background: #e1e1e1; color: #333; }
.btn-cancel:hover { background: #ccc; }
.btn-confirm { background: #0078D7; color: white; }
.btn-confirm:hover { background: #005a9e; }

/* ==========================================
   📱 响应式与移动端装甲 (Responsive & Touch Adapters)
   ========================================== */

/* 1. 修复模态框在小屏上的物理溢出 */
.modal-box { 
    width: 90%; 
    max-width: 320px; 
}

/* 2. 当屏幕宽度小于 600px 时的形态突变 */
@media (max-width: 600px) {
    /* 菜单栏允许折行，防止小屏幕挤压破版 */
    .menu-bar { 
        flex-wrap: wrap; 
        padding: 4px; 
    }
    
    /* 增大手指触摸热区，防止误触 */
    .menu-item { 
        padding: 10px 12px; 
        font-size: 14px; 
    }
    
    /* 密码状态栏被挤下去时，自动占满一行并靠右对齐 */
    #lock-status { 
        width: 100%; 
        text-align: right; 
        padding-top: 8px; 
        border-top: 1px solid #ddd; 
        margin-top: 4px; 
    }
    
    /* 下拉菜单加宽，适应大拇指的操作逻辑 */
    .dropdown-content { 
        width: 100%; 
        left: 0; 
        top: 100%; 
        box-shadow: 0 8px 16px rgba(0,0,0,0.3); 
    }
    .dropdown-content div { 
        padding: 15px 15px; 
        font-size: 15px; 
    }
    
    /* 手机上没有实体键盘，隐藏多余的快捷键提示文本 */
    .shortcut { 
        display: none; 
    }
    
    /* 增大文本框的基础字号，保护视力 */
    .editor-area { 
        font-size: 16px; 
        padding: 10px;
    }
}
