/* 按钮基础样式 - 移到文件前面以确保优先加载 */
.btn,
button[type="submit"],
.btn-add,
.add-new-btn,
.add-new-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 4rem;
    border: none;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

/* 主要按钮样式 */
.btn-primary,
button[type="submit"],
.btn-save,
.add-new-content {
    background-color: #333333 !important;
    color: white !important;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 功能按钮样式 */
.btn-copy {
    background-color: #9333ea !important;
}

.btn-download {
    background-color: #0284c7 !important;
}

.btn-edit {
    background-color: #059669 !important;
}

.btn-delete {
    background-color: #dc2626 !important;
}

/* 次要按钮样式 */
.btn-secondary,
.btn-cancel {
    background-color: #6b7280 !important;
}

/* 按钮悬停效果 */
.btn:hover,
.btn-primary:hover,
button[type="submit"]:hover,
.btn-save:hover,
.add-new-content:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* 按钮激活状态 */
.btn:active {
    transform: translateY(0);
}

/* 按钮禁用状态 */
.btn:disabled {
    background-color: #bdc3c7 !important;
    cursor: not-allowed;
    transform: none;
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局字体设置 */
:root {
    --font-sans: -apple-system, "Noto Sans", "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Source Han Sans CN", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif;
    --font-serif: "Noto Serif", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", serif;
    --font-mono: "Fira Code", "Noto Sans Mono CJK SC", "Source Code Pro", Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;

    /* 浅色主题变量 */
    --bg-color: #f5f5f5;
    --text-color: #333;
    --grid-color: rgba(0, 0, 0, 0.84);
    --card-bg: #ffffff;
    --card-inner-bg: #f8f8f8;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --heading-color: #2c3e50;
    --border-color: #e8e8e8;
    --input-bg: #ffffff;
    --input-border: #d0d0d0;
    --input-focus-border: #3498db;
    --input-text: #333;
    --input-placeholder: #999;
    --file-bg: var(--card-inner-bg);
    --file-border: var(--border-color);
    --file-text: #2c3e50;
    --file-subtext: #7f8c8d;
    --code-bg: var(--card-inner-bg);
    --modal-bg: #ffffff;
    --modal-overlay: rgba(0, 0, 0, 0.5);
}

/* 深色主题变量 */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --grid-color: rgba(255, 255, 255, 0.1);
    --card-bg: #2d2d2d;
    --card-inner-bg: #1e1e1e;
    --card-border: #404040;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --heading-color: #ffffff;
    --border-color: #404040;
    --file-bg: #2d2d2d;
    --file-border: #404040;
    --file-text: #e0e0e0;
    --file-subtext: #a0a0a0;
    --code-bg: #1e1e1e;
    --code-block-bg: #1e1e1e;
    --code-border: #2d2d2d;
    --code-text: #e0e0e0;
    --code-comment: #6a9955;
    --code-string: #ce9178;
    --code-number: #b5cea8;
    --code-keyword: #569cd6;
    --code-function: #dcdcaa;
    --code-property: #9cdcfe;
    --modal-bg: #2d2d2d;
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --btn-bg: #3d3d3d;
    --btn-text: #ffffff;
    --btn-hover: #4a4a4a;
    --input-bg: #2d2d2d;
    --input-border: #404040;
    --input-text: #e0e0e0;
    --toast-bg: rgba(45, 45, 45, 0.9);
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 29px 29px;
    background-position: 24px 24px;
    background-attachment: fixed;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    color: var(--heading-color);
    margin-bottom: 1rem;
}

.text-block {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 2px var(--card-shadow),
        0 2px 4px var(--card-shadow),
        0 4px 8px var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.text-block:hover {
    box-shadow: 0 6px 12px var(--card-shadow);
}

.text-block.fade-out {
    opacity: 0;
}

.text-block.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

h2 {
    color: var(--heading-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* 诗歌样式 */
.poetry {
    font-family: var(--font-serif);
    text-align: center;
    font-size: 1.2rem;
    line-height: 2;
}

/* 代码样式 */
pre {
    margin: 0;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 普通文本样式 */
.prose {
    font-size: 1rem;
    line-height: 1.8;
    text-align: justify;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .text-block {
        padding: 1.5rem;
    }

    .poetry {
        font-size: 1.1rem;
    }
}

/* 提示框样式 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 100%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success {
    background-color: rgba(46, 204, 113, 0.9);
}

.toast.error {
    background-color: rgba(231, 76, 60, 0.9);
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.toast.fade-out {
    opacity: 0;
    transform: translate(-50%, 20px);
}

.toast::before {
    content: '';
    width: 16px;
    height: 16px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.toast.success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
}

.toast.error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z'/%3E%3C/svg%3E");
}

/* 内容块样式 */
.text-block {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.text-block:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.text-block-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* 图片样式 */
.image {
    text-align: center;
}

.image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background-color: var(--modal-bg);
    margin: 20px auto;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    color: var(--text-color);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--file-border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-sans);
    background-color: var(--file-bg);
    color: var(--text-color);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* 响应式调整 */
@media (max-width: 600px) {
    .modal {
        padding: 10px;
    }

    .modal-content {
        margin: 10px auto;
        padding: 1rem;
        width: 95%;
    }

    .form-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
    }

    .image-preview img {
        max-height: 200px;
    }
}

/* 状态显示样式 */
.loading,
.error,
.empty {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.loading {
    color: #3498db;
}

.error {
    color: #e74c3c;
}

.empty {
    color: #95a5a6;
}

/* 按钮禁用状态 */
.btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* 加载动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 优化过渡效果 */
.text-block {
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

.text-block.fade-out {
    opacity: 0;
}

.text-block.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 图片相关样式 */
.image {
    text-align: center;
}

.image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-preview {
    margin-top: 1rem;
    text-align: center;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#editImage {
    padding: 1rem;
    background-color: #f8f9fa;
    border: 2px dashed #bdc3c7;
    cursor: pointer;
    transition: border-color 0.3s;
}

#editImage:hover {
    border-color: #3498db;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

/* 提示框样式 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 100%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.toast.fade-out {
    opacity: 0;
    transform: translate(-50%, 20px);
}

/* 内容样式 */
.prose p {
    margin: 0.5em 0;
    line-height: 1.6;
}

.poetry p {
    margin: 0.5em 0;
    line-height: 1.8;
    text-align: center;
}

.code {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.code pre {
    margin: 0;
}

.code code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* 图片样式 */
.image {
    text-align: center;
    padding: 1rem 0;
}

.image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 图片相关样式 */
.image {
    text-align: center;
}

.image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-preview {
    margin-top: 1rem;
    text-align: center;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#editImage {
    padding: 1rem;
    background-color: #f8f9fa;
    border: 2px dashed #bdc3c7;
    cursor: pointer;
    transition: border-color 0.3s;
}

#editImage:hover {
    border-color: #3498db;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

/* 提示框样式 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 100%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.toast.fade-out {
    opacity: 0;
    transform: translate(-50%, 20px);
}

/* 确认对话框样式 */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.confirm-dialog-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
}

.confirm-dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
}

.confirm-dialog-message {
    font-size: 14px;
    color: #34495e;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 文件相关样式 */
.file {
    background: var(--file-bg);
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--file-border);
    margin: 1rem 0;
    transition: all 0.2s ease;
}

.file:hover {
    box-shadow: 0 4px 8px var(--card-shadow);
}

.file-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.file-details {
    margin-left: 1rem;
}

.file-name {
    color: var(--file-text);
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.file-type {
    color: var(--file-subtext);
    font-size: 0.875rem;
}

/* 图片文件图标 */
.file-icon.image {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2327ae60' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-5-7l-3 3.72L9 13l-3 4h12l-4-5z'/%3E%3C/svg%3E");
}

/* Markdown文件图标 */
.file-icon.markdown {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232980b9' d='M20.56 3H3.44C2.65 3 2 3.65 2 4.44v15.12c0 .79.65 1.44 1.44 1.44h17.12c.79 0 1.44-.65 1.44-1.44V4.44c0-.79-.65-1.44-1.44-1.44zM8 17H5v-5h3v5zm6.5 0h-3v-5h3v5zM17 17h-3v-5h3v5zM8 11H5V6h3v5zm6.5 0h-3V6h3v5zM17 11h-3V6h3v5z'/%3E%3C/svg%3E");
}

/* PDF文件图标 */
.file-icon.pdf {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23e74c3c' d='M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z'/%3E%3C/svg%3E");
}

/* Word文件图标 */
.file-icon.word {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232b579a' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3.5 14H14l-2-7.5-2 7.5H8.5L6.1 7h1.7l1.54 7.5L11.3 7h1.4l1.97 7.5L16.2 7h1.7l-2.4 10z'/%3E%3C/svg%3E");
}

/* Excel文件图标 */
.file-icon.excel {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23217346' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8.5 14H9v-4h1.5v4zm3 0h-1.5v-4H14v4zm3 0h-1.5v-4H17v4zm-9-5H7V8h1.5v4zm3 0h-1.5V8H11v4zm3 0h-1.5V8H14v4zm3 0h-1.5V8H17v4z'/%3E%3C/svg%3E");
}

/* PowerPoint文件图标 */
.file-icon.powerpoint {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect fill='%23d24726' x='2' y='2' width='20' height='20' rx='4'/%3E%3Cpath fill='white' d='M8 17V7h5c1.1 0 2 .9 2 2v2.5c0 1.1-.9 2-2 2H9.5v3.5H8zm1.5-5h3c.3 0 .5-.2.5-.5v-2c0-.3-.2-.5-.5-.5h-3v3z'/%3E%3C/svg%3E");
}

/* 代码文件图标 */
.file-icon.code {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%233498db' d='M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z'/%3E%3C/svg%3E");
}

/* 压缩文件图标 */
.file-icon.archive {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffa000' d='M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-6 0h-4V4h4v2z'/%3E%3C/svg%3E");
}

/* 视频文件图标 */
.file-icon.video {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23e74c3c' d='M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z'/%3E%3C/svg%3E");
}

/* 音频文件图标 */
.file-icon.audio {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%239b59b6' d='M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3h-7z'/%3E%3C/svg%3E");
}

/* 文本文件图标 */
.file-icon.text {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2395a5a6' d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm2 14H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
}

/* 通用文件图标 */
.file-icon.generic {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2395a5a6' d='M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z'/%3E%3C/svg%3E");
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 24px;
    border-radius: 12px;
    background-color: #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    transition: all 0.3s ease;
    border: none;
    z-index: 1000;
}

.theme-toggle::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle {
    background-color: #3498db;
}

[data-theme="dark"] .theme-toggle::before {
    transform: translateX(24px);
}

.theme-toggle:hover {
    opacity: 0.9;
}

/* 按钮样式适配深色模式 */
[data-theme="dark"] .btn {
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .btn:hover {
    background-color: var(--btn-hover);
}

/* 表单元素适配深色模式 */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--input-text);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: #3498db;
    outline: none;
}

/* 文件卡片深色模式样式 */
[data-theme="dark"] .file {
    background: var(--file-bg);
    border-color: var(--file-border);
}

[data-theme="dark"] .file:hover {
    background: var(--btn-hover);
    border-color: var(--border-color);
}

/* 模态框深色模式样式 */
[data-theme="dark"] .modal-content {
    background-color: var(--modal-bg);
    border: 1px solid var(--border-color);
}

/* 提示框深色模式样式 */
[data-theme="dark"] .toast {
    background-color: var(--toast-bg);
}

/* 确保所有元素都有平滑的主题切换效果 */
* {
    transition: background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

/* 状态显示样式深色模式适配 */
[data-theme="dark"] .loading,
[data-theme="dark"] .error,
[data-theme="dark"] .empty {
    background: var(--loading-bg);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .loading {
    color: var(--loading-text);
}

[data-theme="dark"] .error {
    color: var(--error-text);
}

[data-theme="dark"] .empty {
    color: var(--empty-text);
}

/* 确认对话框深色模式样式 */
[data-theme="dark"] .confirm-dialog-content {
    background: var(--dialog-bg);
    color: var(--dialog-text);
    border: 1px solid var(--dialog-border);
}

[data-theme="dark"] .confirm-dialog-title {
    color: var(--heading-color);
}

[data-theme="dark"] .confirm-dialog-message {
    color: var(--text-color);
}

/* 加载动画深色模式样式 */
[data-theme="dark"] .loading-spinner {
    border: 2px solid var(--spinner-bg);
    border-top: 2px solid var(--spinner-border);
}

/* 文件信息深色模式样式 */
[data-theme="dark"] .file-preview {
    background-color: var(--file-bg);
    border-color: var(--file-border);
}

[data-theme="dark"] .file-name {
    color: var(--file-text);
}

[data-theme="dark"] .file-type,
[data-theme="dark"] .file-size {
    color: var(--file-subtext);
}

/* 图片预览深模式样式 */
[data-theme="dark"] #imagePreview {
    background-color: var(--file-bg);
    border-color: var(--file-border);
}

[data-theme="dark"] #editImage {
    background-color: var(--file-bg);
    border-color: var(--file-border);
}

[data-theme="dark"] #editImage:hover {
    border-color: #3498db;
}

/* 卡片样式深色模式适配 */
[data-theme="dark"] .text-block {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 4px var(--card-shadow);
}

[data-theme="dark"] .text-block>div {
    background: var(--card-inner-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0.5rem;
}

[data-theme="dark"] .text-block pre {
    background: var(--card-inner-bg);
    margin: 0;
    border: none;
}

[data-theme="dark"] .text-block .code {
    background: var(--card-inner-bg);
    padding: 0;
    border-radius: 4px;
    overflow: hidden;
}

[data-theme="dark"] .text-block code {
    background: transparent;
    color: var(--code-text);
}

[data-theme="dark"] .text-block-actions {
    background: var(--card-bg);
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
}

/* 代码区域深色模式样式 */
[data-theme="dark"] pre {
    background-color: var(--code-block-bg);
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] pre code {
    background-color: transparent;
    color: var(--code-text);
    border: none;
}

[data-theme="dark"] .text-block pre {
    background-color: var(--code-block-bg);
    border: 1px solid var(--code-border);
}

/* 确保代码块内的所有元素背景色一致 */
[data-theme="dark"] pre * {
    background-color: transparent !important;
}

[data-theme="dark"] .language-javascript {
    color: var(--code-text);
}

/* 代码高亮深色模式样式 */
[data-theme="dark"] .token.comment,
[data-theme="dark"] .token.prolog,
[data-theme="dark"] .token.doctype,
[data-theme="dark"] .token.cdata {
    color: var(--code-comment);
}

[data-theme="dark"] .token.string,
[data-theme="dark"] .token.attr-value {
    color: var(--code-string);
}

[data-theme="dark"] .token.number,
[data-theme="dark"] .token.boolean {
    color: var(--code-number);
}

[data-theme="dark"] .token.keyword,
[data-theme="dark"] .token.operator {
    color: var(--code-keyword);
}

[data-theme="dark"] .token.function {
    color: var(--code-function);
}

[data-theme="dark"] .token.property,
[data-theme="dark"] .token.attr-name {
    color: var(--code-property);
}

[data-theme="dark"] .token.punctuation {
    color: var(--text-color);
}

/* 卡片基础样式 */
.text-block {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 2px var(--card-shadow),
        0 2px 4px var(--card-shadow),
        0 4px 8px var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.text-block h2 {
    color: var(--heading-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* 文件卡片样式 */
.file {
    background: var(--file-bg);
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--file-border);
    margin: 1rem;
    transition: all 0.2s ease;
}

[data-theme="dark"] .file {
    background: var(--card-inner-bg);
    border: 1px solid var(--card-border);
    margin: 1.5rem;
    padding: 2rem;
}

/* 文件信息样式 */
.file-details {
    margin-left: 1.5rem;
}

/* 操作按钮区域样式 */
[data-theme="dark"] .text-block-actions {
    background: var(--card-bg);
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
}

/* 按钮间距 */
.text-block-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4rem;
    color: white;
}

.btn-copy {
    background-color: #9b59b6;
    color: white;
}

.btn-download {
    background-color: #3498db;
    color: white;
}

.btn-edit {
    background-color: #2ecc71;
    color: white;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn:active {
    transform: translateY(0);
}

/* 表单元素样式 */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--input-text);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    margin-bottom: 1rem;
}

input::placeholder,
textarea::placeholder {
    color: var(--input-placeholder);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 10.5l-4-4h8l-4 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

/* 操作区域样式 */
.text-block-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

/* 卡片头部样式 */
.text-block-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.text-block-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--heading-color);
    flex: 1;
}

.text-block-meta {
    font-size: 0.875rem;
    color: #666;
    margin-left: 1rem;
}

.modified-date {
    display: inline-flex;
    align-items: center;
    color: #666;
}

.modified-date::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666666'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.7;
}

/* 深色模式适配 */
[data-theme="dark"] .text-block-meta {
    color: #999;
}

[data-theme="dark"] .modified-date {
    color: #999;
}

[data-theme="dark"] .modified-date::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23999999'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'%3E%3C/path%3E%3C/svg%3E");
}

/* 自定义滚动条样式 */
.edit-form {
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    /* Firefox */
}

.edit-form::-webkit-scrollbar {
    width: 6px;
}

.edit-form::-webkit-scrollbar-track {
    background: transparent;
}

.edit-form::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    border: none;
}

.edit-form::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* 暗色模式下的滚动条 */
@media (prefers-color-scheme: dark) {
    .edit-form {
        scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    }

    .edit-form::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.2);
    }

    .edit-form::-webkit-scrollbar-thumb:hover {
        background-color: rgba(255, 255, 255, 0.3);
    }
}

.edit-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 500px;
    background: var(--background-color);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border-radius: 12px 0 0 12px;
    overflow: hidden;
    z-index: 1000;
}

.edit-form {
    height: calc(100% - 60px);
    overflow-y: auto;
    padding-right: 20px;
    margin-right: -20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* 加载动画 */
@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-color-secondary);
}

.loading::before {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    border: 3px solid var(--text-color-secondary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-color-secondary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* 空状态动画 */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    border: 2px dashed var(--border-color);
    margin: 2rem 0;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.empty-text {
    font-size: 1.25rem;
    color: var(--heading-color);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.empty-hint {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.875rem;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

/* 深色模式适配 */
[data-theme="dark"] .empty {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .empty-text {
    color: var(--heading-color);
}

[data-theme="dark"] .empty-hint {
    color: var(--text-color);
}

/* 加载动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    color: var(--text-color-secondary);
}

.loading::before {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

/* 深色模式适配 */
[data-theme="dark"] .loading::before {
    border-color: #333;
    border-top-color: #3498db;
}

[data-theme="dark"] .loading-text {
    color: #999;
}