/* 全局样式 */
@font-face {
    font-family: 'TitleFont';
    src: url('/static/fonts/title.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*:focus {
    outline: none;
}

/* 作者样式表里的 display 会盖掉浏览器默认的 [hidden] 规则，这里显式补一条。
   CSP 的 style-src 'self' 会拦截行内 style 属性，隐藏元素统一用 hidden。 */
[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-form h1 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 600;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

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

.login-btn,
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.login-btn:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.login-btn {
    width: 100%;
    margin-top: 1rem;
}

.error-message {
    color: #e74c3c;
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: #fdf2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

/* 仪表板样式 */
.dashboard-container {
    min-height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.dashboard-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 50px;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-danger {
    background: #e74c3c;
    border: 2px solid #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.dashboard-main {
    padding: 0;
}

.text-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem 2.5rem;
}

.pagination.hidden {
    display: none;
}

#paginationInfo {
    font-size: 0.9rem;
    color: #666;
    min-width: 120px;
    text-align: center;
}

.text-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1rem 2rem 1rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

.text-item:hover {
    background: rgba(102, 126, 234, 0.05);
    border-bottom-color: rgba(102, 126, 234, 0.3);
}

/* 文本项头部布局 */
.text-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.text-item-title {
    font-size: 1.2rem;
    font-weight: 400;
    font-family: 'TitleFont', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #444;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-block;
    max-width: calc(100% - 1rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 标题容器，占用剩余空间但不响应点击 */
.text-item-title-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.text-item-title:hover {
    color: #667eea;
}

/* 时间和复制按钮容器 */
.text-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}
.text-item-actions .window-size-btn {
    margin-right: 0;
}

/* 时间显示样式 */
.text-item-time {
    font-size: 0.8rem;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.text-item-time:hover {
    color: #667eea;
}

/* 复制按钮样式 */
.copy-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.copy-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    opacity: 1;
    transform: scale(1.1);
}

/* 移动端响应式样式 */
@media (max-width: 768px) {
    .text-item-title {
        max-width: calc(100% - 0.8rem);
        font-size: 1.1rem;
    }
    
    .text-item-actions {
        gap: 0.5rem;
    }
    
    .text-item-time {
        font-size: 0.75rem;
    }
    
    .copy-btn {
        padding: 0.3rem;
    }
    
    .copy-btn svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .text-item {
        padding: 0.75rem 0.5rem 0.75rem 1rem;
    }
    
    .text-item-title {
        max-width: calc(100% - 0.6rem);
        font-size: 1rem;
    }
    
    .text-item-actions {
        gap: 0.3rem;
        flex-shrink: 0;
    }
    
    .text-item-time {
        font-size: 0.7rem;
        white-space: nowrap;
    }
    
    .copy-btn {
        padding: 0.2rem;
        flex-shrink: 0;
    }
    
    .copy-btn svg {
        width: 14px;
        height: 14px;
    }
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

.text-item-preview {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.25rem;
    border-radius: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 预览两行，每行各自单行省略显示 */
.text-item-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
}

.text-item-preview-line {
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.text-item-preview:hover {
    background-color: rgba(102, 126, 234, 0.05);
    color: #333;
}

.loading {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
    font-style: italic;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 1rem;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* 复选框样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 0;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    margin-right: 0.75rem;
    cursor: pointer;
    position: relative;
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.05);
}

.checkbox-text {
    color: #374151;
    font-weight: 500;
    user-select: none;
}

/* 置顶标识样式 */
.pinned-badge {
    display: inline-block;
    background-color: #FF6347;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* 头部置顶复选框样式 */
.header-checkbox {
    margin-right: 1rem;
    font-size: 0.85rem;
}

.header-checkbox .checkbox-text {
    color: #64748b;
    font-weight: 500;
}

/* 移动端：置顶文字缩短，仅显示数字 */
@media (max-width: 480px) {
    .header-checkbox .pin-label { display: none; }
    .header-checkbox .pin-num { display: inline; }
}

/* 置顶2蓝色视觉提示，可配合徽标使用 */
.pinned-badge.level-2 {
    background-color: #3B82F6;
}
.pinned-badge.level-3 {
    background-color: #10B981;
}

.header-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-color: rgba(148, 163, 184, 0.3);
}

.header-checkbox input[type="checkbox"]:checked {
    background: rgba(102, 126, 234, 0.9);
    border-color: rgba(102, 126, 234, 0.9);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%), 
                rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全屏模态框包装器 */
.fullscreen-modal-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    max-height: none !important;
    animation: scaleFromCenter 0.3s ease-out;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* 从中心向四边扩展的动画 */
@keyframes scaleFromCenter {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 全屏模态框的背景层 */
.modal:has(.fullscreen-modal) {
    z-index: 9998 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* 当body激活全屏模态框时的样式 */
body.modal-fullscreen-active {
    overflow: auto !important;
}

body.modal-fullscreen-active .modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
}

body.modal-fullscreen-active .fullscreen-modal-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 100000 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 确保全屏模式下关闭按钮可见且可点击 */
body.modal-fullscreen-active .modal-header-right {
    z-index: 100001 !important;
    position: relative !important;
}

body.modal-fullscreen-active .close {
    z-index: 100002 !important;
    position: relative !important;
}

body.modal-fullscreen-active .modal .fullscreen-modal {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    z-index: 100001 !important;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh !important;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 
                0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
    position: relative;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
#fullTextModal .modal-header-right {
    gap: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


.close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.2rem;
    font-weight: 500;
    color: #64748b;
}

.close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
    background: white;
}

/* 全文显示模态框的modal-body特殊处理 */
.full-text-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

/* 全屏模式下的modal-body样式 */
.fullscreen-modal-wrapper .modal-body {
    padding: 0 !important;
    overflow-y: visible !important;
    max-height: none !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 修复模态框中按钮的样式 */
.modal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.3);
}

.modal .btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.4);
}

.modal .btn-secondary {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #64748b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.modal .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.modal .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.3);
}

.modal .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(239, 68, 68, 0.4);
}

/* 全文显示模态框样式 */
.full-text-modal {
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    transition: all 0.3s ease;
}

/* 全屏模态框样式 */
.fullscreen-modal-wrapper .full-text-modal {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    max-width: 100vw !important;
    width: 100vw !important;
    max-height: none !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.full-text-content {
    max-height: none;
    overflow-y: visible;
    padding: 0;
    transition: all 0.3s ease;
}

/* 全屏模式下的内容样式 */
.fullscreen-modal-wrapper .full-text-content {
    max-height: none !important;
    height: auto !important;
    overflow-y: auto !important;
    padding: 20px !important;
    transition: none !important;
    flex: 1 !important;
    min-height: 0 !important;
}

/* 全屏模式下的文本预览区域 */
.fullscreen-modal-wrapper .full-text-pre {
    max-height: none !important;
    overflow-y: visible !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

.full-text-pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 2rem;
    background: transparent;
    border-radius: 0;
    border: none;
}

/* 窗口大小按钮样式 */
.window-size-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
}

.window-size-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: scale(1.05);
}

.window-size-btn svg {
    width: 16px;
    height: 16px;
}
#fullTextModal .copy-btn {
    padding: 0.5rem;
    border-radius: 6px;
}
#fullTextModal .copy-btn svg {
    width: 18px;
    height: 18px;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 设置页面样式 */
.settings-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    position: relative;
}

.settings-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

.settings-form {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 
                0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 520px;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

.settings-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1px;
}

.settings-header h1 {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    display: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.message.is-visible {
    display: block;
}

.message.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #a7f3d0;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.1);
}

.message.success::before {
    content: '✓';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.message.success {
    padding-left: 3.5rem;
}

.message.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fecaca;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
}

.message.error::before {
    content: '✕';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.message.error {
    padding-left: 3.5rem;
}

.copy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 12px 20px;
    border-radius: 6px;
    background: #4caf50;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    animation: copy-toast-in 0.3s ease;
}

.copy-toast.is-hiding {
    animation: copy-toast-out 0.3s ease;
}

@keyframes copy-toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes copy-toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}


/* 响应式设计 */
@media (max-width: 768px) {
    .settings-container {
        padding: 1rem;
    }
    
    .settings-form {
        padding: 2rem 1.5rem;
        border-radius: 16px;
        max-width: 100%;
    }
    
    .settings-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
    }
    
    .settings-header h1 {
        font-size: 1.75rem;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1.25rem 1.5rem;
        min-height: 60px;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    
    .form-actions .btn {
        flex: 1;
        min-width: 0;
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .settings-form {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }
    
    .settings-header h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-header {
        padding: 1rem 1.25rem;
        min-height: 50px;
    }
    
    /* 顶部1/2/3复选框：间距减半 */
    .modal-header-right {
        gap: 0.5rem;
    }
    .header-checkbox {
        margin-right: 0;
    }
    
    .modal-body {
        padding: 1.25rem;
        max-height: calc(100vh - 140px);
    }
    
    /* 手机模式下（非全屏）全文内容左右内边距缩小以显示更多文字 */
    .full-text-modal .full-text-pre {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.875rem 1rem;
        font-size: 16px; /* 防止iOS缩放 */
    }
}
