* {
    box-sizing: border-box;
}

/* 👉 默认：电脑 / 平板 */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
    font-size: 14px;   /* 🔥 放大 */
    line-height: 1.5;
}

/* 标题 */
h2 {
    font-size: 16px;
    margin: 0;
}

/* 链接 */
a {
    color: #3b82f6;
    text-decoration: none;
}

/* 容器 */
.container {
    width: 100%;
    margin: 0;
    padding: 10px;
}

/* 顶部 */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.muted {
    color: #6b7280;
    font-size: 12px;
}

/* 卡片 */
.card, .editor-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

/* 工具区 */
.grid-tools {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
    margin-right: -5px;
    margin-left: -5px;
}

.tool-form {
    flex: 0 0 calc(33.333% - 10px);
    margin: 0 5px 10px 5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-form h3 {
    font-size: 13px;
    margin: 0;
}

/* 输入框 */
input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    padding: 8px 10px;
    min-height: 25px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
}

/* 按钮 */
button, .btn {
    font-size: 11px;
    padding: 6px 10px;
    min-height: 25px;
    border-radius: 6px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: white;
    cursor: pointer;
}

.btn.small {
    font-size: 12px;
    padding: 4px 8px;
}

.btn.ghost {
    background: #e5e7eb;
    color: #374151;

}

.btn.danger {
    background: #ef4444;
}

/* 提示 */
.flash {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

/* 路径栏 */
.path-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.muted-label, .path-value {
    font-size: 12px;
}

/* 表格 */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 13px;
    min-width: 650px;
}

th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 6px;
    text-align: center;
}

td {
    padding: 6px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}




/* 文件名列（左对齐） */
.name-cell {
    text-align: left;
    max-width: 140px;      
    overflow: hidden;        
    white-space: nowrap;     
}

/* 操作区 */
.op-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* 内联表单 */
.inline-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.inline-form input[type="text"] {
    width: 80px;
    padding: 6px 8px;
    font-size: 12px;
}

/* 图片 */
.thumb img {
    max-width: 100px;
    max-height: 70px;
}

/* 编辑器 */
#editor {
    width: 100%;
    height: 78vh;
}



/* 登录页 */
.login-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f7fb;
    padding: 0;
}

.login-page-main {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-box {
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
}

.login-box button[type="submit"] {
  display: block;
  padding: 10px 30px;
  margin: 0px auto 0;
}

/* 编辑器页面 */

.editor-page .topbar {
    padding: 0;   /* 🔥 减小上下内边距 */

    margin: 0;
}

.editor-page .btn {
    padding: 0 5px;
    min-height: 0px;
    font-size: 10px;
}

.editor-page .container {
    padding: 0;
    margin: 0;
}

.editor-page .card,
.editor-page .editor-card {
    padding: 0;
    margin: 0;
    border: none;
}

.editor-page #editor {
    width: 100%;
    height: 100vh;
}

html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.page-shell,
.editor-page-main,
.login-page-main {
    flex: 1 0 auto;
}

.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 8px 12px;
    background: transparent;
    color: #666;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.site-footer a:hover {
    opacity: 0.75;
    text-decoration: underline;
}

.site-footer .footer-records {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px 12px;
    flex-wrap: wrap;
}

.site-footer .footer-divider {
    opacity: 0.35;
}

/* 浅色模式 */
@media (prefers-color-scheme: light) {
    .site-footer {
        color: #666;
        background: transparent;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .site-footer {
        color: rgba(255, 255, 255, 0.72);
        background: transparent;
    }

    .site-footer a:hover {
        opacity: 0.9;
    }

    .site-footer .footer-divider {
        opacity: 0.28;
    }
}

/* 手机端再紧凑一点 */
@media (max-width: 640px) {
    .site-footer {
        padding: 6px 10px;
        font-size: 11px;
    }

    .site-footer .footer-records {
        gap: 4px 10px;
    }
}