html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* 文件预览专属样式隔离 */
.file-display-body {
    margin: 0;
    padding: 0;
    min-height: 0;
    background: #fff;
}
.file-display-container {
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    max-width: none;
}
.file-content-wrapper {
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
}
.file-content-wrapper body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}
.file-content-wrapper input.form-field {
    border: 1px dashed #000 !important;
    writing-mode: vertical-rl !important;
    font-size: 19px !important;
    padding: 5px !important;
    text-align: center !important;
    background: #fff !important;
}
.file-content-wrapper .title,
.file-content-wrapper .subtitle,
.file-content-wrapper .content {
    writing-mode: vertical-rl !important;
}

/* 覆盖 container 限制 */
.file-display-body .container,
.file-display-body .container-fluid {
    padding: 0;
    margin: 0;
    max-width: none;
}

@media print {
    body {
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
    }
    .container, .container-fluid, .file-display-container, .file-content-wrapper {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    * {
        box-shadow: none !important;
        border: none !important;
    }
    body, p, div {
        color: #000 !important;
        background: none !important;
    }
    nav, .navbar, .footer {
        display: none !important;
    }
    [style*="writing-mode: vertical-rl"] {
        writing-mode: vertical-rl !important;
    }
    .form-field {
        border: 1px dashed #000 !important;
    }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* 导航条美化 */
.main-nav {
    background: linear-gradient(90deg, #f8fafc 0%, #e0e7ef 100%);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    padding: 0.5em 0;
}
.nav-links {
    display: flex;
    gap: 2em;
    justify-content: center;
    align-items: center;
}
.nav-links a {
    color: #2d3748;
    font-weight: 500;
    text-decoration: none;
    font-size: 1.15em;
    padding: 0.5em 1em;
    border-radius: 0.5em 0.5em 0 0;
    transition: background 0.2s, color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
    background: #e5e7eb;
    color: #007bff;
}

/* 主标题美化 */
.main-title {
    text-align: center;
    margin: 2em 0 1.5em 0;
    font-size: 2.2em;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: 0.05em;
}

/* 卡片美化 */
.folder-card {
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    background: linear-gradient(135deg, #f8fafc 60%, #e0e7ef 100%);
    transition: box-shadow 0.2s;
}
.folder-card:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.folder-link {
    color: #007bff;
    font-size: 1.3em;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.folder-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 默认表文列表美化 */
.default-folder-list {
    max-width: 600px;
    margin: 2em auto;
    padding: 2em;
    border-radius: 1em;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid #e5e7eb;
}
.file-list .file-link {
    color: #2d3748;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.file-list .file-link:hover {
    color: #007bff;
    text-decoration: underline;
}
.empty-list {
    color: #888;
    text-align: center;
    padding: 2em 0;
}

/* 页脚美化 */
.main-footer {
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #666;
    text-align: center;
    padding: 1.5em 0 1em 0;
    font-size: 1em;
    margin-top: 3em;
}

/* 主内容区美化 */
.main-content {
    margin-top: 2em;
    margin-bottom: 2em;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .nav-links {
        gap: 1em;
        font-size: 1em;
    }
    .main-title {
        font-size: 1.4em;
    }
    .default-folder-list {
        padding: 1em;
    }
}