/* style.css - 全新设计 by 小白 */

/* --- CSS 变量定义 --- */
:root {
--primary-color: #4a6b57; /* 森林绿 (主色调) */
--secondary-color: #8b5e3c; /* 暖木棕 (次要/点缀) */
--accent-color: #e4c8a4; /* 淡米金 (强调/悬停) */
--background-color: #fdfcf8; /* 非常浅的米白 (背景) */
--card-background: #ffffff; /* 卡片/模态框背景 */
--text-color: #3e3a39; /* 深灰棕 (主要文字) */
--text-muted: #6c757d; /* 柔和灰 (次要文字/提示) */
--border-color: #e8e6e1; /* 边框颜色 */
--error-color: #d9534f; /* 错误红 */
--warning-color: #f0ad4e; /* 警告黄 */
--success-color: #5cb85c; /* 成功绿 */
--info-color: #5bc0de; /* 信息蓝 */
--forest-green-dark: #33691E; /* 深绿 (用于强调, hover) */
--forest-green-medium: #558B2F; /* 中绿 (主色调, 链接) */
--forest-green-light: #8BC34A; /* 亮绿 (主要按钮, 激活状态) */
--forest-green-pale: #DCEDC8; /* 淡绿 (次要按钮背景, hover背景) */
--forest-brown-dark: #4E342E; /* 深棕 (主要文字) */
--forest-brown-medium: #795548; /* 中棕 (次要文字, 图标) */
--forest-brown-light: #A1887F; /* 浅棕 (边框, 分割线) */
--forest-bg-main: #F1F8E9; /* 主背景 (极浅灰绿) */
--forest-bg-panel: #F9FFF4; /* 面板/卡片背景 (接近白色但带绿调) */
--forest-accent-yellow: #FFF59D; /* 淡黄 (警告, 提醒背景) */
--forest-accent-red: #E57373; /* 柔和红 (错误) */
--forest-accent-blue: #81D4FA; /* 浅蓝 (信息提示) */
--font-family-sans-serif: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

--border-radius: 6px; /* 圆角 */
--box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* 阴影 */
--transition-speed: 0.25s; /* 过渡速度 */
}

/* --- 全局重置与基础样式 --- */
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}

/* 仅针对WebKit浏览器隐藏滚动条 */
*::-webkit-scrollbar {
  width: 0; /* 垂直滚动条宽度 */
}

html {
font-size: 16px; /* 基准字体大小 */
scroll-behavior: smooth;
}

body {
font-family: var(--font-family-sans-serif);
line-height: 1.6;
color: var(--text-color);
background-color: var(--background-color);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
display: flex;
flex-direction: column;
min-height: 100vh;
}

.index {
display: flex;
flex-direction: column;
flex-grow: 1;
max-width: 986px; /* 限制最大宽度，居中 */
margin: 0 auto;
width: 100%;
padding: 0 1rem; /* 左右留白 */
}

a {
color: var(--primary-color);
text-decoration: none;
transition: color var(--transition-speed) ease;
}

a:hover {
color: var(--secondary-color);
text-decoration: underline;
}

img, video {
max-width: 100%;
height: auto;
}

/* Feather Icons 基础样式 */
.icon {
width: 1em;
height: 1em;
stroke-width: 2;
vertical-align: -0.125em; /* 微调对齐 */
margin-right: 0.3em; /* 图标和文字间距 */
}
.icon-lg { width: 1.5em; height: 1.5em; }
.icon-sm { width: 0.8em; height: 0.8em; }

/* --- 顶部导航栏 --- */
.top-navbar {
display: flex;
align-items: center;
padding: 0.8rem 0;
background-color: var(--background-color);
border-bottom: 1px solid var(--border-color);
margin-bottom: 1rem; /* 和主要内容的间距 */
flex-wrap: wrap; /* 在小屏幕上换行 */
}

.navbar-brand {
color: var(--primary-color);
display: flex;
align-items: center;
text-decoration: none;
}
.navbar-brand:hover { text-decoration: none; }
.navbar-brand .icon { margin-right: 0.5em; width: 1.2em; height: 1.2em; }

.navbar-nav {
display: flex;
flex-grow: 1; /* 占据剩余空间 */
flex-wrap: wrap;
 justify-content: center;
}

.nav-link, .nav-button {
display: inline-flex; /* 使用 inline-flex */
align-items: center; /* 垂直居中 */
padding: 0.5rem 0.8rem;
color: var(--text-muted);
border-radius: var(--border-radius);
transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
text-decoration: none;
background: none;
border: none;
cursor: pointer;
white-space: nowrap;
}
.nav-link:hover, .nav-button:hover {
background-color: rgba(74, 107, 87, 0.1); /* 淡淡的主色背景 */
color: var(--primary-color);
text-decoration: none;
}
.nav-link.active, .nav-button.active {
background-color: var(--forest-green-pale);
color: var(--forest-green-dark);
font-weight: 500;
}
.nav-link .icon, .nav-button .icon { margin-right: 0.4em; }

.navbar-user {
margin-left: auto; /* 推到最右 */
}

.logout-btn { color: var(--error-color); }
.logout-btn:hover { background-color: rgba(217, 83, 79, 0.1); color: var(--error-color); }

/* 响应式导航栏 */
@media (max-width: 768px) {
.top-navbar { align-items: flex-start; }
.navbar-user { text-align: right; padding-left: 0; }
.nav-text { display: none; } /* 在小屏幕隐藏导航文字 */
.nav-link .icon, .nav-button .icon { margin-right: 0; } /* 图标无右边距 */
.nav-link, .nav-button {  } /* 调整按钮内边距 */
}

/* --- 主要内容区域 --- */
.main-content {
flex-grow: 1;

}

/* --- 面包屑导航 --- */
.breadcrumb {
font-size: 0.9rem;
color: var(--text-muted);
padding: 0.5rem 1rem;
background-color: rgba(74, 107, 87, 0.05); /* 非常淡的主色背景 */
border-radius: var(--border-radius);
}
.breadcrumb a { color: var(--primary-color); }
.breadcrumb a:hover { color: var(--secondary-color); }
.breadcrumb span { font-weight: 500; color: var(--text-color); }

/* --- 文件列表 --- */
.file-list-card {
background-color: var(--card-background);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
box-shadow: var(--box-shadow);
overflow: hidden; /* 保证圆角效果 */
}

.list-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.8rem 1.2rem;
background-color: rgba(74, 107, 87, 0.05); /* 列表头部淡背景 */
border-bottom: 1px solid var(--border-color);
font-size: 0.9rem;
}
.current-path { font-weight: 500; color: var(--primary-color); }
.current-path .icon { color: var(--primary-color); }
.item-count { color: var(--text-muted); }

.file-list {
list-style: none;
padding: 0;
margin: 0;
}

.file-list li {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.6rem 1.2rem;
border-bottom: 1px solid var(--border-color);
transition: background-color var(--transition-speed) ease;
}
.file-list li:last-child { border-bottom: none; }
.file-list li:hover { background-color: rgba(139, 94, 60, 0.05); /* 暖木棕悬停 */ }

.file-entry {
flex-grow: 1;
display: flex;
align-items: center;
min-width: 0; /* 防止文件名过长撑开布局 */
}

.item-link {
display: flex;
align-items: center;
color: var(--text-color);
text-decoration: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.item-link:hover { color: var(--secondary-color); text-decoration: none; }

.item-icon {
margin-right: 0.7em;
flex-shrink: 0; /* 防止图标被压缩 */
width: 1.2em;
height: 1.2em;
}
/* 图标颜色 */
.icon-folder { color: #a0846c; } /* 暖棕 */
.icon-image { color: #7aa1e8; } /* 蓝 */
.icon-media { color: #d9875f; } /* 橙 */
.icon-text { color: #6c757d; } /* 灰 */
.icon-archive { color: #b07289; } /* 粉紫 */
.icon-generic { color: #999; } /* 浅灰 */
.icon-encrypted { color: #e4c8a4; } /* 锁图标用米金 */

.item-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.95rem;
}
.folder-item .item-name { font-weight: 500; } /* 目录加粗 */

.file-actions {
display: flex;
align-items: center;
margin-left: 1rem; /* 与文件名的间距 */
flex-shrink: 0;
}

.action-btn {
background: none;
border: none;
color: var(--text-muted);
padding: 0.3rem;
margin-left: 0.4rem; /* 按钮间距 */
cursor: pointer;
transition: color var(--transition-speed) ease, transform 0.1s ease;
display: inline-flex; /* 让图标垂直居中 */
align-items: center;
justify-content: center;
border-radius: 50%; /* 圆形按钮 */
width: 28px;
height: 28px;
}
.action-btn:hover {
color: var(--primary-color);
background-color: rgba(74, 107, 87, 0.1);
}
.action-btn:active {
transform: scale(0.9);
}
.action-btn .icon { margin-right: 0; } /* 去掉默认间距 */
.delete-btn:hover { color: var(--error-color); background-color: rgba(217, 83, 79, 0.1); }

.empty-list-item {
padding: 2rem;
text-align: center;
color: var(--text-muted);
font-style: italic;
}
.empty-list-item .icon { margin-right: 0.5em; }

/* --- 分页 --- */
.pagination {
padding: 0.8rem 1.2rem;
border-top: 1px solid var(--border-color);
}
.pagination-list {
display: flex;
justify-content: center;
list-style: none;
padding: 0;
gap: 0.3rem; /* 页码间距 */
}
.page-link {
display: block;
padding: 0.4rem 0.8rem;
color: var(--primary-color);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
text-decoration: none;
font-size: 0.85rem;
transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}
.page-link:hover {
background-color: rgba(74, 107, 87, 0.1);
border-color: var(--primary-color);
}
.page-link.active {
background-color: var(--primary-color);
color: var(--card-background);
border-color: var(--primary-color);
font-weight: 600;
cursor: default;
}
.page-link.disabled {
color: #ccc;
cursor: default;
border-color: #eee;
}
.page-link.ellipsis { border: none; cursor: default; }
.page-prev, .page-next { font-weight: 500; }

/* --- 操作面板 (上传, 新建目录等) --- */
#action-panels-container {
margin-top: 1rem; /* 与文件列表或面包屑的间距 */
}
#login-section, #register-panel{
background-color: var(--card-background);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
padding: 1.5rem;
margin-bottom: 1.5rem;
box-shadow: var(--box-shadow);
margin: 0 auto;
max-width: 386px;
}
.action-panel {
background-color: var(--card-background);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
padding: 1.5rem;
margin-bottom: 1.5rem;
box-shadow: var(--box-shadow);
display: none; /* 默认隐藏 */
}
.action-panel.active { display: block; } /* JS 控制显示 */

.action-panel h3 {
margin-top: 0;
margin-bottom: 1rem;
font-size: 1.2rem;
color: var(--primary-color);
display: flex;
align-items: center;
}
.action-panel h3 .icon { margin-right: 0.5em; }

/* --- 表单样式 --- */
.form-group {
margin-bottom: 1rem;
}
.form-group label:not(.inline-label) {
display: block;
font-size: 0.9rem;
font-weight: 500;
color: var(--text-color);
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
width: 100%;
padding: 0.6rem 0.8rem;
font-size: 0.95rem;
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
background-color: #fff;
transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="url"]:focus,
.form-group select:focus,
.form-group textarea:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 2px rgba(74, 107, 87, 0.2);
}
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
margin-right: 0.5em;
vertical-align: middle; /* 对齐复选框和标签 */
}
label.inline-label {
display: inline-block; /* 让标签和 checkbox 在一行 */
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}

.form-group small, .form-group .text-warning {
display: block;
margin-top: 0.3rem;
font-size: 0.8rem;
color: var(--text-muted);
}
.form-group .text-warning { color: var(--warning-color); font-weight: 500; }

.form-actions {
margin-top: 1.5rem;
display: flex;
gap: 0.8rem;
}
.justify-content-center { justify-content: center; }
.w-100 { width: 100%; }

.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.6rem 1.2rem;
font-weight: 500;
border: 1px solid transparent;
border-radius: var(--border-radius);
cursor: pointer;
transition: all var(--transition-speed) ease;
text-decoration: none;
white-space: nowrap;
}
.btn .icon { margin-right: 0.5em; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
background-color: var(--primary-color);
color: var(--card-background);
border-color: var(--primary-color);
}
.btn-primary:hover:not(:disabled) {
background-color: #3a5745; /* 深一点的绿 */
border-color: #3a5745;
}

.btn-secondary {
background-color: #f0f0f0;
color: var(--text-color);
border-color: #ccc;
}
.btn-secondary:hover:not(:disabled) {
background-color: #e0e0e0;
border-color: #bbb;
}
.btn-cancel { /* 区分次要和取消 */
background-color: transparent;
color: var(--text-muted);
border: 1px solid var(--border-color);
}
.btn-cancel:hover:not(:disabled) {
background-color: rgba(0, 0, 0, 0.05);
border-color: var(--text-muted);
color: var(--text-color);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-lg {  font-size: 1.1rem; }

/* --- 文件上传区域 --- */
.file-upload-area {
border: 2px dashed var(--border-color);
border-radius: var(--border-radius);
text-align: center;
cursor: pointer;
transition: border-color var(--transition-speed) ease, background-color var(--transition-speed) ease;
position: relative; /* For label positioning */
}
.file-upload-area:hover, .file-upload-area.dragover {
border-color: var(--primary-color);
background-color: rgba(74, 107, 87, 0.03);
}
.file-upload-area input[type="file"] {
position: absolute; /* Hide the actual input */
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
z-index: -1;
}
.file-upload-area label {
display: block;
cursor: pointer;
color: var(--text-muted);
}
.file-upload-area .upload-icon {
width: 3em;
height: 3em;
color: var(--primary-color);
display: block; /* Make icon block level */
margin-left: auto; /* Center icon */
margin-right: auto;
}
#drop-zone-text { font-weight: 500; }

#upload-file-list {
overflow-y: auto;
background: #fff;
padding: 6px 10px;
border: 1px solid #eee;
border-radius: 3px;
}
#upload-file-list div {
padding: 0.3rem 0;
border-bottom: 1px dotted var(--border-color);
}
#upload-file-list div:last-child { border-bottom: none; }

/* 进度条基础样式 */
.progress-bar-wrapper {
background-color: #e9ecef;
border-radius: var(--border-radius);
overflow: hidden;
height: 20px; /* 或您想要的高度 */
position: relative; /* 用于定位文本 */
}
.progress-bar-fill {
background-color: var(--primary-color);
height: 100%;
width: 0%; /* 初始宽度为0 */
transition: width 0.3s ease-out; /* 平滑过渡效果 */
border-radius: var(--border-radius); /* 可选，如果希望填充条也有圆角 */
}
.progress-bar-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: var(--card-background); /* 白色文本 */
font-size: 0.8em;
font-weight: bold;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3); /* 可选：增加文本可读性 */
mix-blend-mode: difference; /* 尝试让文本在背景上更可见 */
pointer-events: none; /* 防止文本干扰鼠标事件 */
line-height: 20px; /* 与容器高度一致 */
}

/* --- 模态框 (Modal) --- */
.modal {
display: none; /* Hidden by default */
position: fixed;
z-index: 1050;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
outline: 0;
background-color: rgba(0, 0, 0, 0.5); /* Backdrop */
transition: opacity 0.15s linear;
}
.modal.show { display: flex; align-items: center; justify-content: center; }

.modal-dialog {
position: relative;
width: auto;
margin: 1.5rem auto;
pointer-events: none;
max-width: 500px; /* Default max width */
transition: transform 0.2s ease-out;
transform: translateY(-20px);
}
.modal.show .modal-dialog { pointer-events: auto; transform: translateY(0);}

.modal-content {
position: relative;
display: flex;
flex-direction: column;
width: 100%;
pointer-events: auto;
background-color: var(--card-background);
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: var(--border-radius);
box-shadow: var(--box-shadow);
outline: 0;
}

.modal-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding: 1rem 1rem;
border-bottom: 1px solid var(--border-color);
border-top-left-radius: var(--border-radius);
border-top-right-radius: var(--border-radius);
}
.modal-title {
margin-bottom: 0;
line-height: 1.5;
font-size: 1.15rem;
font-weight: 500;
color: var(--primary-color);
}
.modal-header .close {
padding: 0.5rem;
margin: -0.5rem -0.5rem -0.5rem auto;
background-color: transparent;
border: 0;
font-size: 1.5rem;
font-weight: 700;
line-height: 1;
color: #000;
text-shadow: 0 1px 0 #fff;
opacity: 0.5;
cursor: pointer;
}
.modal-header .close:hover { opacity: 0.8; }

.modal-body {
position: relative;
flex: 1 1 auto;
padding: 1rem;
max-height: 70vh; /* Limit body height */
overflow-y: auto;
}
/* Preview modal specifics */
#preview-modal .modal-dialog { max-width: 800px; } /* Wider preview */
#modal-body-content img, #modal-body-content video, #modal-body-content audio { display: block; margin: 0 auto; max-width: 100%; max-height: 65vh; }
#modal-body-content pre { background-color: #f8f9fa; border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 1rem; font-family: var(--font-family-monospace); font-size: 0.9em; white-space: pre-wrap; word-wrap: break-word; max-height: 65vh; overflow: auto;}
.modal-loading { text-align: center; padding: 2rem; color: var(--text-muted); }
.modal-loading .icon { width: 2em; height: 2em; }

.modal-footer {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
padding: 0.75rem 1rem;
border-top: 1px solid var(--border-color);
gap: 0.5rem;
}

/* Rename modal specifics */
#rename-modal .modal-dialog { max-width: 400px; } /* Smaller rename */

/* --- Settings Page --- */
#settings-panel fieldset {
border: 1px solid var(--border-color);
padding: 1rem;
border-radius: var(--border-radius);
margin-bottom: 1.5rem;
}
#settings-panel legend {
padding: 0 0.5rem;
font-weight: 600;
color: var(--primary-color);
font-size: 1rem;
}

/* --- Settings Page --- */
#settings-panel fieldset.collapsible-fieldset { /* 现在针对 .collapsible-fieldset */
border-radius: var(--border-radius);
overflow: hidden; /* 确保圆角效果在 legend 上也生效 */
}

#settings-panel fieldset.collapsible-fieldset > legend { /* 直接子元素 legend */
font-weight: 600;
color: var(--primary-color);
font-size: 1rem;
cursor: pointer; /* 表明可点击 */
display: flex; /* 用于对齐图标和文本 */
align-items: center;
margin: 0; /* 移除 legend 默认的 margin */
transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

#settings-panel fieldset.collapsible-fieldset > legend:hover {
background-color: rgba(74, 107, 87, 0.05); /* 淡主色背景悬停 */
}

.fieldset-toggle-icon {
transition: transform var(--transition-speed) ease;
width: 1.1em; /* 调整图标大小 */
height: 1.1em;
stroke-width: 2.5;
}

.fieldset-content {
display: none; /* 默认隐藏内容 */
}

/* 展开状态的样式 */
#settings-panel fieldset.collapsible-fieldset.expanded > legend {
/* border-bottom-color: var(--border-color); /* 展开时 legend 下方有边框 */
/* (上面这行可以不要了，因为 content 的 border-top 已经起作用) */
}

#settings-panel fieldset.collapsible-fieldset.expanded .fieldset-content {
display: block; /* 显示内容 */
}

#settings-panel fieldset.collapsible-fieldset.expanded .fieldset-toggle-icon {
transform: rotate(-180deg); /* 箭头向上旋转 */
}

/* Hide non-active backend settings */
.backend-settings-fieldset.d-none { display: none; }

#account-panel #two_factor_email_group {
/* Styles for the 2FA email input group */
/* Removed explicit display:none; now controlled by .d-none */
}

/* --- Account Panel --- */
#account-panel hr { border-top: 1px solid var(--border-color); margin: 1.5rem 0; }
#account-panel h4 { margin-top: 1rem; margin-bottom: 1rem; font-size: 1.1rem; color: var(--primary-color); }

#login-section #two_factor_code_group {
/* Removed explicit display:none; now controlled by .d-none */
}

/* Style for the 2FA code input itself */
#login-section #two_factor_code {
/* You might want to give it a fixed width */
max-width: 150px; /* Example width */
text-align: center; /* Center the code */
font-size: 1.1em; /* Slightly larger font */
letter-spacing: 2px; /* Add some spacing */
display: block; /* Make it a block element */
margin-left: auto; /* Center horizontally */
margin-right: auto;
}
/* END: 2FA Login Styles */

/* --- Notifications --- */
.notification-container {
position: fixed;
bottom: 1rem;
right: 1rem;
z-index: 1100;
width: 300px; /* Max width */
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.notification {
background-color: var(--text-color);
color: var(--card-background);
padding: 0.8rem 1.2rem;
border-radius: var(--border-radius);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
opacity: 0;
transform: translateX(100%);
transition: opacity 0.5s ease, transform 0.5s ease;
display: flex;
align-items: center;
cursor: pointer;
font-size: 0.9rem;
}
.notification.show { opacity: 1; transform: translateX(0); }
.notification .icon { margin-right: 0.8em; flex-shrink: 0; }
.notification.success { background-color: var(--success-color); }
.notification.error { background-color: var(--error-color); }
.notification.warning { background-color: var(--warning-color); color: #333; }
.notification.info { background-color: var(--info-color); }

/* --- Edit View Specific --- */
.edit-navbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.8rem 1.2rem;
background-color: var(--card-background);
border-bottom: 1px solid var(--border-color);
position: sticky;
top: 0;
z-index: 100; /* Above textarea */
}
.edit-navbar .filename { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-grow: 1; margin-right: 1rem; }
.edit-navbar .filename .icon { color: var(--primary-color); }
.edit-navbar .actions { display: flex; gap: 0.5rem; }
#editor-textarea {
width: 100%;
height: calc(100vh - 60px); /* Adjust height based on navbar */
border: none;
padding: 1rem;
font-family: var(--font-family-monospace);
font-size: 0.95rem;
line-height: 1.5;
resize: none;
outline: none;
background-color: var(--background-color);
}
#notification-area-edit { /* Position notifications for edit page differently if needed */
position: fixed;
bottom: 1rem;
left: 50%;
transform: translateX(-50%);
z-index: 1100;
width: auto; /* Adjust width */
max-width: 90%;
}


/* --- Footer --- */
.site-footer {
padding: 1rem 0;
text-align: center;
font-size: 0.85rem;
color: var(--text-muted);
border-top: 1px solid var(--border-color);
}
.footer-content {
display: flex;
align-items: center;
flex-wrap: wrap; /* Allow wrapping on small screens */
gap: 0.5rem; /* Add some space between items */
justify-content: center;
}

/* --- Utility Classes --- */
.d-none { display: none !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.text-center { text-align: center !important; }

/* --- Animations --- */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
.index { padding: 0 0.8rem; }
.file-list li { padding: 0.5rem 0.8rem; }
.list-header { padding: 0.6rem 0.8rem; }
.pagination { padding: 0.6rem 0.8rem; }
.action-panel { padding: 1rem; }
}

@media (max-width: 576px) {
html { font-size: 15px; }
.top-navbar { padding: 0.5rem 0; }
.navbar-brand { font-size: 1.1rem; }
.file-list li { }
.file-entry { }
.file-actions { margin-left: 0; justify-content: flex-end; }
.list-header { align-items: flex-start; gap: 0.3rem; }
.pagination-list { flex-wrap: wrap; justify-content: center; }
.modal-dialog { margin: 0.2rem; }
.notification-container { right: 0.5rem; width: calc(100% - 1rem); }
}


/* --- Client-Side Encryption Specific Styles --- */
.icon-encrypted { color: var(--accent-color); /* Use accent color for lock */ }
.file-list li .item-link .item-name span { /* Style for (.xiaopan) suffix */
opacity: 0.7;
}

#encryption-options-container { margin-top: 0.5rem; padding: 0.5rem; background-color: rgba(228, 200, 164, 0.1); border-radius: 4px;}
#encrypt-password-container { margin-top: 0.3rem;}

#decrypt-password-modal .modal-dialog { max-width: 350px; }
#decrypt-modal-filename { font-size: 0.9em;}
#decrypt-progress-area small { display: block; text-align: center; margin-bottom: 5px; }
#decrypt-progress-area .progress-bar-wrapper { height: 8px; }
#decrypt-progress-area .progress-bar-fill { height: 8px; background-color: var(--secondary-color); }