* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --admin-primary: #1a365d;
    --admin-primary-light: #2c5282;
    --admin-accent: #4fd1c5;
    --admin-bg: #f5f7fa;
    --admin-text: #2d3748;
    --admin-text-light: #718096;
    --admin-border: #e2e8f0;
    --admin-success: #48bb78;
    --admin-warning: #ed8936;
    --admin-danger: #f56565;
    --admin-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --admin-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --admin-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --admin-radius-sm: 6px;
    --admin-radius-md: 8px;
    --admin-radius-lg: 12px;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--admin-text);
    background-color: var(--admin-bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--admin-radius-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    outline: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--admin-primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--admin-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.25);
}

.btn-secondary {
    background-color: #fff;
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
}

.btn-secondary:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}

.btn-danger {
    background-color: var(--admin-danger);
    color: #fff;
}

.btn-danger:hover {
    background-color: #e53e3e;
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.25);
}

.btn-block {
    width: 100%;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-primary-light) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 209, 197, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 209, 197, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background-color: #fff;
    border-radius: var(--admin-radius-lg);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--admin-primary);
    margin-bottom: 12px;
}

.login-header .logo i {
    margin-right: 10px;
    font-size: 28px;
    color: var(--admin-accent);
}

.login-header p {
    color: var(--admin-text-light);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-group label {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--admin-text);
    margin-bottom: 8px;
}

.login-form .form-group label i {
    margin-right: 8px;
    color: #999;
    width: 16px;
}

.login-form .form-group input[type="text"],
.login-form .form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease;
}

.login-form .form-group input:focus {
    border-color: #1a365d;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 0;
}

.toggle-password:hover {
    color: #1a365d;
}

.remember-me label {
    cursor: pointer;
    font-weight: normal !important;
}

.remember-me input {
    margin-right: 8px;
}

.error-message {
    padding: 10px 15px;
    background-color: #fff5f5;
    color: #e53e3e;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 15px;
    border: 1px solid #fed7d7;
}

.btn-login {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer a {
    color: #1a365d;
    text-decoration: none;
    font-size: 14px;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Admin Page */
.admin-page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #1a365d;
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-header .logo i {
    margin-right: 10px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
    padding: 10px 0;
}

.nav-section-title {
    padding: 15px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left: 3px solid #4fd1c5;
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 16px;
}

.sidebar-nav-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.home-link:hover {
    background: rgba(255, 255, 255, 0.18);
}

.home-link i {
    margin-right: 10px;
    font-size: 13px;
}

.logout-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.logout-btn i {
    margin-right: 10px;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    padding: 8px;
    font-size: 18px;
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 20px;
    color: #666;
}

.top-bar-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.content-wrapper {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.page-actions {
    display: flex;
    gap: 10px;
}

.page-desc {
    color: #999;
    font-size: 13px;
    margin-bottom: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: 8px;
    margin-right: 20px;
}

.stat-icon.blue { background-color: #e6f0ff; color: #1a365d; }
.stat-icon.green { background-color: #e6fffa; color: #319795; }
.stat-icon.orange { background-color: #fffaf0; color: #dd6b20; }
.stat-icon.red { background-color: #fff5f5; color: #e53e3e; }
.stat-icon.purple { background-color: #faf5ff; color: #805ad5; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* Tables */
.table-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: #f5f7fa;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    font-weight: 600;
    color: #666;
    font-size: 13px;
}

.data-table td {
    font-size: 14px;
    color: #333;
}

.data-table tbody tr:hover {
    background-color: #fafbfc;
}

.data-table img {
    max-width: 80px;
    max-height: 60px;
    border-radius: 4px;
    object-fit: cover;
}

.data-table .action-buttons {
    display: flex;
    gap: 8px;
}

.data-table .action-buttons button {
    padding: 5px 12px;
    font-size: 12px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    background: #e8f0fe;
    color: #1a73e8;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 500;
}

.status-pending { background-color: #fff3cd; color: #856404; }
.status-processing { background-color: #cce5ff; color: #004085; }
.status-completed { background-color: #d4edda; color: #155724; }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open,
.modal-overlay:has(.modal.open) {
    display: flex;
}

.modal {
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    padding: 8px;
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.modal-body .form-group label .required {
    color: #e53e3e;
    margin-left: 3px;
}

.modal-body .form-group input,
.modal-body .form-group textarea,
.modal-body .form-group select {
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus,
.modal-body .form-group select:focus {
    border-color: #1a365d;
}

.modal-body .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-body .form-group input[type="file"] {
    padding: 6px;
}

.modal-body .form-group .hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.modal-body .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.modal-body .form-row .form-group {
    margin-bottom: 0;
}

.modal-body .form-group {
    box-sizing: border-box;
}

.modal-body .form-group .current-image {
    margin-top: 8px;
}

.modal-body .form-group .current-image img {
    max-width: 150px;
    max-height: 100px;
    border-radius: 4px;
}

/* Image input with upload button */
.modal-body .form-group .image-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-body .form-group .image-input-group input[type="text"] {
    flex: 1;
}

.modal-body .form-group .upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #1a365d;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s;
}

.modal-body .form-group .upload-btn:hover {
    background: #2d4a7c;
}

.modal-body .form-group .upload-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #eee;
    gap: 12px;
    flex-shrink: 0;
}

/* Section List (Home Sections) */
.section-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-card {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 16px 20px;
    transition: all 0.2s ease;
    cursor: grab;
}

.section-card:hover {
    border-color: #1a365d;
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.08);
}

.section-card.dragging {
    opacity: 0.5;
}

.section-card.section-hidden {
    background: #fafafa;
    border-color: #e0e0e0;
}

.section-card.section-hidden .section-icon {
    background: linear-gradient(135deg, #999, #777);
}

.section-card.section-hidden .section-info h4 {
    color: #999;
}

.section-drag {
    color: #ccc;
    margin-right: 16px;
    cursor: grab;
    font-size: 16px;
}

.section-drag:active {
    cursor: grabbing;
}

.section-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a365d, #2c5282);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 16px;
    flex-shrink: 0;
}

.section-info {
    flex: 1;
}

.section-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.section-info p {
    font-size: 13px;
    color: #999;
}

.hidden-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    background: #999;
    color: #fff;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: normal;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #1a365d;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 24px;
}

.tab-nav {
    width: 180px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 8px 0;
}

.tab-item {
    padding: 12px 20px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab-item:hover {
    background: #f5f7fa;
    color: #1a365d;
}

.tab-item.active {
    color: #1a365d;
    background: rgba(26, 54, 93, 0.05);
    border-left-color: #1a365d;
    font-weight: 500;
}

.tab-content {
    flex: 1;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Settings Form */
.settings-form {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.settings-form h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.settings-form .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.settings-form .form-group {
    margin-bottom: 0;
}

.settings-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.settings-form .form-group input,
.settings-form .form-group textarea,
.settings-form .form-group select {
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.settings-form .form-group input:focus,
.settings-form .form-group textarea:focus {
    border-color: #1a365d;
}

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

.image-input-group {
    display: flex;
    gap: 8px;
}

.image-input-group input[type="text"] {
    flex: 1;
}

.image-input-group .btn {
    flex-shrink: 0;
}

.logo-preview-box,
.favicon-preview-box {
    width: 100%;
    height: 80px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    overflow: hidden;
}

.logo-preview-box img {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
}

.favicon-preview-box {
    width: 80px;
    height: 80px;
}

.favicon-preview-box img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.color-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.color-input-group input[type="text"] {
    flex: 1;
}

/* Account */
.account-wrap {
    max-width: 500px;
}

.account-card {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.account-avatar {
    font-size: 64px;
    color: #1a365d;
    margin-right: 20px;
}

.account-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.account-info p {
    color: #999;
    font-size: 14px;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid #38a169; }
.toast.error { border-left: 4px solid #e53e3e; }
.toast.warning { border-left: 4px solid #dd6b20; }
.toast.info { border-left: 4px solid #3182ce; }

.toast .toast-icon {
    margin-right: 12px;
    font-size: 18px;
}

.toast.success .toast-icon { color: #38a169; }
.toast.error .toast-icon { color: #e53e3e; }
.toast.warning .toast-icon { color: #dd6b20; }
.toast.info .toast-icon { color: #3182ce; }

.toast .toast-message {
    font-size: 14px;
    color: #333;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ============================================================
   模板编辑器样式
   ============================================================ */
.templates-layout {
    display: flex;
    gap: 20px;
    min-height: 500px;
}
.templates-sidebar {
    width: 260px;
    min-width: 260px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.templates-sidebar h4 {
    padding: 15px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #1a365d;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}
.template-nav {
    max-height: 600px;
    overflow-y: auto;
}
.template-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}
.template-nav-item:hover { background: #f0f7ff; }
.template-nav-item.active { background: #ebf5ff; border-left: 3px solid #1a365d; }
.template-nav-item i { font-size: 18px; color: #1a365d; width: 24px; text-align: center; }
.template-nav-item .item-info { flex: 1; min-width: 0; }
.template-nav-item .item-title { display: block; font-size: 13px; font-weight: 500; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-nav-item .item-file { display: block; font-size: 11px; color: #999; margin-top: 2px; }
.template-nav-item .item-arrow { color: #ccc; font-size: 12px; }

.templates-editor {
    flex: 1;
    min-width: 0;
}
.editor-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #fff;
    border-radius: 8px;
    border: 2px dashed #e5e7eb;
    color: #999;
    gap: 12px;
}
.editor-placeholder i { font-size: 36px; color: #ccc; }

.editor-panel {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.editor-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    background: #f8fafc;
}
.editor-tabs .tab-item {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.editor-tabs .tab-item:hover { color: #1a365d; }
.editor-tabs .tab-item.active { color: #1a365d; border-bottom-color: #1a365d; }

.editor-tab-content { padding: 20px; }
.editor-tab-pane { display: none; }
.editor-tab-pane.active { display: block; }

.template-block {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}
.template-block .block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}
.template-block .block-icon { font-size: 14px; }
.template-block .block-label { font-size: 13px; font-weight: 500; color: #333; }
.template-block .block-tag { font-size: 11px; color: #999; background: #e5e7eb; padding: 2px 8px; border-radius: 3px; margin-left: auto; }
.template-block .block-editor {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}
.template-block .block-editor:focus { outline: none; border-color: #1a365d; box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.1); }

.header-actions {
    display: flex;
    gap: 10px;
}

.hint {
    font-size: 12px;
    color: #999;
}

/* ============================================================
   用户菜单下拉 & 通知弹窗 & 排序拖拽
   ============================================================ */

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    position: relative;
    user-select: none;
    transition: background 0.2s;
}
.user-menu:hover {
    background: #f0f4f8;
}
.user-menu .username {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}
.user-menu .fa-chevron-down {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.user-dropdown {
    display: none;
    position: fixed;
    z-index: 2000;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    overflow: hidden;
    animation: dropdownIn 0.15s ease;
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s;
}
.dropdown-item:hover {
    background: #f0f7ff;
}
.dropdown-item i {
    width: 18px;
    text-align: center;
    color: #666;
    font-size: 14px;
}
.dropdown-logout {
    color: #e53e3e;
}
.dropdown-logout i {
    color: #e53e3e;
}
.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

/* 通知铃铛 */
.notification-btn {
    position: relative;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 18px;
    border-radius: 6px;
    transition: all 0.2s;
    margin-right: 12px;
}
.notification-btn:hover {
    color: #1a365d;
    background: #f0f4f8;
}
.notify-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #e53e3e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notify-popover {
    display: none;
    position: fixed;
    z-index: 2000;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    width: 340px;
    max-height: 400px;
    overflow: hidden;
    animation: dropdownIn 0.15s ease;
}
.notify-header {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #1a365d;
    border-bottom: 1px solid #eee;
    background: #f8fafc;
}
.notify-list {
    max-height: 300px;
    overflow-y: auto;
}
.notify-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}
.notify-item:hover {
    background: #f0f7ff;
}
.notify-item:last-child {
    border-bottom: none;
}
.notify-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ebf4ff;
    color: #1a365d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}
.notify-item-content {
    flex: 1;
    min-width: 0;
}
.notify-item-title {
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.notify-item-time {
    font-size: 11px;
    color: #999;
}
.notify-footer {
    padding: 10px 16px;
    text-align: center;
    font-size: 12px;
    color: #1a365d;
    cursor: pointer;
    border-top: 1px solid #eee;
    background: #fafbfc;
    font-weight: 500;
}
.notify-footer:hover {
    background: #f0f7ff;
}
.notify-empty {
    text-align: center;
    padding: 30px 16px;
    color: #999;
}
.notify-empty i {
    font-size: 32px;
    color: #4fd1c5;
    margin-bottom: 8px;
    display: block;
}
.notify-empty p {
    font-size: 13px;
    margin: 0;
}

/* 拖拽排序反馈 */
.section-card.dragging {
    opacity: 0.4;
    background: #f0f7ff;
}

/* 备份按钮区域 */
.backup-section {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}
.backup-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}
.backup-section .btn i {
    margin-right: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .main-content { margin-left: 200px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-form .form-row { grid-template-columns: 1fr; }
    .settings-tabs { flex-direction: column; }
    .tab-nav { width: 100%; display: flex; overflow-x: auto; padding: 0; }
    .tab-item { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; }
    .tab-item.active { border-left: none; border-bottom-color: #1a365d; }
    .section-card { flex-wrap: wrap; }
    .section-actions { width: 100%; margin-top: 12px; justify-content: flex-end; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 10px; }
    .data-table img { max-width: 50px; max-height: 40px; }
    .modal { width: 95%; }
    .templates-layout { flex-direction: column; }
    .templates-sidebar { width: 100%; min-width: auto; }
}

@media (max-width: 480px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr; }
    .top-bar-left h1 { font-size: 16px; }
    .modal { width: 95%; }
}

/* ============================================================
   SEO管理
   ============================================================ */
.seo-page-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.seo-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
}

.seo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e8e8e8;
}

.seo-card-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.seo-card-body {
    padding: 16px 20px;
}

.seo-card-body p {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px 0;
    word-break: break-all;
}

.seo-card-body p:last-child {
    margin-bottom: 0;
}

.seo-card-body strong {
    color: #333;
    font-weight: 500;
}

/* ============================================================
   基础配置 - 开关标签
   ============================================================ */
.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.switch-label input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.switch-label input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.switch-label input[type="checkbox"]:checked {
    background: #1a365d;
}

.switch-label input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

/* FAQ管理 */
.faq-category-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.faq-cat-btn {
    padding: 8px 18px;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #666;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}
.faq-cat-btn:hover {
    border-color: #1a365d;
    color: #1a365d;
}
.faq-cat-btn.active {
    background: #1a365d;
    border-color: #1a365d;
    color: #fff;
}
.faq-cat-manager .cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f7fafc;
    border-radius: 6px;
    margin-bottom: 8px;
}
.faq-cat-manager .cat-name {
    font-weight: 500;
    color: #333;
}
.faq-cat-manager .cat-actions {
    display: flex;
    gap: 6px;
}

/* 产品图片预览 */
.image-preview {
    margin-top: 12px;
    display: none;
}
.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}
.image-preview.show {
    display: block;
}

/* 分类标签 */
.category-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #e8f4f8;
    color: #1a5f7a;
    border-radius: 12px;
    font-size: 12px;
}

/* 批量操作工具栏 */
.batch-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    background: #f0f7ff;
    border-radius: 6px;
    margin-bottom: 12px;
}
.batch-toolbar label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
}
.batch-toolbar select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
#selected-count {
    color: #666;
    font-size: 13px;
}

/* 批量上传弹窗 */
.batch-upload-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}
.batch-upload-overlay.open {
    display: block;
}
#batch-upload-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
}
#batch-upload-modal.open {
    display: block;
}
#batch-upload-modal .modal-content {
    width: 550px;
    height: 380px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.batch-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}
.batch-upload-area:hover {
    border-color: #4a90d9;
    background: #f0f7ff;
}
.batch-upload-area.dragover {
    border-color: #4a90d9;
    background: #e6f0ff;
    border-style: solid;
}
.batch-upload-area i {
    color: #999;
    margin-bottom: 12px;
}
.batch-upload-area p {
    color: #666;
    margin: 8px 0;
}
.batch-preview-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 16px 0;
}
.batch-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 8px;
    position: relative;
}
.batch-preview-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}
.batch-preview-info {
    flex: 1;
}
.batch-preview-name {
    display: block;
    font-size: 13px;
    color: #333;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.batch-preview-size {
    font-size: 11px;
    color: #999;
}
.batch-preview-fields {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.batch-preview-fields input,
.batch-preview-fields textarea {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}
.batch-preview-fields textarea {
    resize: none;
    height: 40px;
}
.batch-preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border: none;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.batch-upload-options {
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    margin-top: 12px;
}
.batch-upload-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
.batch-upload-options select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

/* 上传进度条 */
.upload-progress {
    margin-top: 16px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
}

/* 产品编辑页面布局 */
.product-edit-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px;
}

.product-edit-main {
    min-width: 0;
}

.product-edit-main .form-group {
    margin-bottom: 16px;
}

.product-edit-side {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 8px;
    position: sticky;
    top: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.product-edit-side .form-group {
    margin-bottom: 14px;
}

.product-edit-side .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

.product-edit-side .form-row .form-group {
    margin-bottom: 10px;
}

.product-edit-side .image-preview {
    margin-top: 8px;
    text-align: center;
}

.product-edit-side .image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    object-fit: contain;
}

/* 产品特点列表 */
.feature-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.feature-item input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.feature-item button {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .product-edit-grid {
        grid-template-columns: 1fr;
    }
}
.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s;
}
.progress-text {
    display: block;
    text-align: center;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}

/* 页面头部按钮组 */
.page-header .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 130px;
}

.switch-text {
    font-size: 14px;
    color: #333;
}

/* ============================================================
   关于页面管理样式
   ============================================================ */
.about-tabs {
    display: flex;
    gap: 0;
    margin: 20px 0;
    border-bottom: 2px solid #e0e0e0;
}
.about-tabs .tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}
.about-tabs .tab-btn:hover {
    color: #1a365d;
}
.about-tabs .tab-btn.active {
    color: #1a365d;
    border-bottom-color: #1a365d;
}
.about-tab-content {
    display: none;
}
.about-tab-content.active {
    display: block;
}

.nav-manage-tabs {
    display: flex;
    gap: 0;
    margin: 20px 0;
    border-bottom: 2px solid #e0e0e0;
}
.nav-manage-tabs .nav-tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}
.nav-manage-tabs .nav-tab-btn:hover {
    color: #1a365d;
}
.nav-manage-tabs .nav-tab-btn.active {
    color: #1a365d;
    border-bottom-color: #1a365d;
}
.nav-tab-content {
    display: none;
}
.nav-tab-content.active {
    display: block;
}
.tab-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.tab-toolbar .page-desc {
    margin-bottom: 0;
}

.home-sections-tabs {
    display: flex;
    gap: 0;
    margin: 20px 0;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}
.home-sections-tabs .hs-tab-btn {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}
.home-sections-tabs .hs-tab-btn:hover {
    color: #1a365d;
}
.home-sections-tabs .hs-tab-btn.active {
    color: #1a365d;
    border-bottom-color: #1a365d;
}
.hs-tab-content {
    display: none;
}
.hs-tab-content.active {
    display: block;
}

.product-manage-tabs {
    display: flex;
    gap: 0;
    margin: 20px 0;
    border-bottom: 2px solid #e0e0e0;
}
.product-manage-tabs .prod-tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}
.product-manage-tabs .prod-tab-btn:hover {
    color: #1a365d;
}
.product-manage-tabs .prod-tab-btn.active {
    color: #1a365d;
    border-bottom-color: #1a365d;
}
.prod-tab-content {
    display: none;
}
.prod-tab-content.active {
    display: block;
}
.about-edit-panel {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.about-edit-panel h4 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #333;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.about-edit-panel textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}
.about-edit-panel textarea:focus {
    border-color: #1a365d;
    outline: none;
}

/* 时间线编辑器 */
.timeline-editor, .values-editor, .honors-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}
.timeline-item-editor, .value-item-editor, .honor-item-editor {
    display: grid;
    grid-template-columns: 100px 1fr 2fr auto;
    gap: 12px;
    align-items: start;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}
.timeline-item-editor input,
.value-item-editor input,
.honor-item-editor input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}
.timeline-item-editor textarea,
.value-item-editor textarea,
.honor-item-editor textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    resize: vertical;
}
.item-delete-btn {
    padding: 8px 12px;
    border: none;
    background: #ff4444;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.item-delete-btn:hover {
    background: #cc0000;
}
.timeline-item-editor .form-group,
.value-item-editor .form-group,
.honor-item-editor .form-group {
    margin: 0;
}
.timeline-item-editor label,
.value-item-editor label,
.honor-item-editor label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

/* 排序拖拽手柄 */
.sort-handle {
    cursor: move;
    color: #999;
    padding: 8px;
}
.sort-handle:hover {
    color: #333;
}

/* ============================================================
   文件管理样式
   ============================================================ */
.file-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.file-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.file-filters {
    display: flex;
    gap: 6px;
}
.file-filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.file-filter-btn:hover {
    background: #f0f4ff;
    border-color: #1a365d;
    color: #1a365d;
}
.file-filter-btn.active {
    background: #1a365d;
    color: #fff;
    border-color: #1a365d;
}
.file-sort select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
}
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.file-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}
.file-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.file-card-preview {
    height: 150px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.file-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.file-card-preview .file-icon-preview {
    font-size: 48px;
    color: #ccc;
}
.file-card-info {
    padding: 12px;
}
.file-card-name {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    margin-bottom: 6px;
}
.file-card-meta {
    font-size: 11px;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.file-card-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid #f0f0f0;
}
.file-card-actions button {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}
.file-card-actions .btn-preview:hover {
    background: #f0f4ff;
    border-color: #1a365d;
    color: #1a365d;
}
.file-card-actions .btn-delete-file:hover {
    background: #fff0f0;
    border-color: #ff4444;
    color: #ff4444;
}
.file-card-referenced {
    border-left: 3px solid #4CAF50;
}
.file-card-orphaned {
    border-left: 3px solid #ff9800;
    opacity: 0.85;
}
.file-ref-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #e8f5e9;
    color: #388E3C;
    margin-left: 6px;
}
.file-orphan-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #fff3e0;
    color: #E65100;
    margin-left: 6px;
}
.file-loading {
    text-align: center;
    padding: 60px;
    color: #999;
    grid-column: 1/-1;
}
.file-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}
.file-pagination button {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.file-pagination button:hover {
    background: #f0f4ff;
}
.file-pagination button.active {
    background: #1a365d;
    color: #fff;
    border-color: #1a365d;
}
.file-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
/* 引用详情弹窗 */
.file-usage-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-usage-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.file-usage-content h3 {
    margin: 0 0 16px;
    font-size: 18px;
}
.file-usage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f9f9f9;
    margin-bottom: 8px;
}
.file-usage-item .ref-type {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
    background: #e3f2fd;
    color: #1976D2;
}
@media (max-width: 768px) {
    .file-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 16px 0;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.raw-code-placeholder {
    position: relative;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px dashed #0ea5e9;
    border-radius: 8px;
    padding: 30px 20px;
    margin: 16px 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}
.raw-code-placeholder:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}
.raw-code-placeholder .placeholder-icon {
    font-size: 40px;
    margin-bottom: 10px;
    color: #0ea5e9;
}
.raw-code-placeholder .placeholder-title {
    color: #0369a1;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}
.raw-code-placeholder .placeholder-desc {
    color: #666;
    font-size: 12px;
}
.raw-code-placeholder[data-type="video"] {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}
.raw-code-placeholder[data-type="video"]:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    border-color: #d97706;
}
.raw-code-placeholder[data-type="video"] .placeholder-icon {
    color: #f59e0b;
}
.raw-code-placeholder[data-type="video"] .placeholder-title {
    color: #92400e;
}

.code-editor {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    resize: vertical;
    min-height: 200px;
    box-sizing: border-box;
}
.code-editor:focus {
    outline: none;
    border-color: #1a365d;
    box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.1);
}

/* Quill 工具栏自定义按钮 */
.ql-toolbar .ql-upload-video,
.ql-toolbar .ql-code-insert,
.ql-toolbar .ql-source-code {
    width: auto !important;
    padding: 2px 8px !important;
}
.ql-toolbar .ql-upload-video:hover,
.ql-toolbar .ql-code-insert:hover,
.ql-toolbar .ql-source-code:hover {
    color: #06c;
}

/* 编辑器内视频预览 */
.ql-editor video {
    max-width: 100%;
    border-radius: 4px;
}
.ql-editor .video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    aspect-ratio: 16 / 9;
    margin: 12px 0;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.ql-editor .video-container iframe,
.ql-editor .video-container video,
.ql-editor .video-container > .polyv-player-wrapper,
.ql-editor .video-container > div[id^="plv_"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none;
    margin: 0;
    padding: 0;
}
.ql-editor .video-container .polyv-player-wrapper iframe,
.ql-editor .video-container > div[id^="plv_"] > iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none;
    margin: 0;
    padding: 0;
}

/* 视频上传进度条 */
#video-upload-progress .video-upload-bar {
    transition: width 0.3s ease;
}

/* Quill 字体/字号下拉框 */
.ql-snow .ql-picker.ql-font {
    width: auto !important;
    min-width: 100px;
}
.ql-snow .ql-picker.ql-size {
    width: auto !important;
    min-width: 70px;
}
.ql-snow .ql-picker-label {
    padding-left: 8px !important;
    padding-right: 8px !important;
}
.ql-snow .ql-picker-options {
    min-width: 120px;
}

/* 新增工具栏按钮图标（表格、分割线） */
.ql-toolbar .ql-table::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 11px;
    background-image:
        linear-gradient(#222, #222),
        linear-gradient(#222, #222),
        linear-gradient(#222, #222);
    background-size: 14px 2px, 2px 11px, 14px 2px;
    background-position: 0 0, 0 0, 0 11px;
    background-repeat: no-repeat;
    vertical-align: middle;
    position: relative;
    left: -2px;
    top: -1px;
}
.ql-toolbar .ql-table {
    padding: 2px 8px !important;
}
.ql-toolbar .ql-table::before {
    background-image:
        linear-gradient(#222, #222),
        linear-gradient(#222, #222),
        linear-gradient(#222, #222),
        linear-gradient(#222, #222);
    background-size: 12px 1px, 1px 10px, 12px 1px, 12px 1px;
    background-position: 0 0, 0 0, 0 5px, 0 10px;
    background-repeat: no-repeat;
    width: 12px;
    height: 11px;
    left: -1px;
    top: 0;
}

.ql-toolbar .ql-hr::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 2px;
    background: #222;
    vertical-align: middle;
    border-radius: 1px;
    position: relative;
    top: -1px;
}
.ql-toolbar .ql-hr {
    padding: 2px 8px !important;
}

/* 工具栏按钮组间距 */
.ql-toolbar .ql-formats {
    margin-right: 4px;
}

/* 表格对话框 */
.table-dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.table-dialog {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    width: 90%;
    max-width: 420px;
}
.table-dialog h3 {
    margin: 0 0 16px;
    font-size: 16px;
}
.table-dialog .form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.table-dialog .form-group {
    flex: 1;
}
.table-dialog label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}
.table-dialog input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.table-dialog .table-preview {
    margin: 16px 0;
    max-height: 200px;
    overflow: auto;
}
.table-dialog .table-preview table {
    border-collapse: collapse;
    width: 100%;
}
.table-dialog .table-preview table td,
.table-dialog .table-preview table th {
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    text-align: center;
    font-size: 12px;
}
.table-dialog .table-preview table th {
    background: #f1f5f9;
}
.table-dialog .btn-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 上传进度弹窗样式 */
.upload-progress-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-progress-modal .upload-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.upload-progress-modal .upload-card h3 {
    margin: 0 0 20px;
    font-size: 16px;
    text-align: center;
}
.upload-progress-modal .file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}
.upload-progress-modal .file-info .file-icon {
    font-size: 28px;
    color: #3b82f6;
}
.upload-progress-modal .file-info .file-name {
    font-size: 13px;
    color: #333;
    word-break: break-all;
}
.upload-progress-modal .file-info .file-size {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.upload-progress-modal .progress-container {
    margin-bottom: 8px;
}
.upload-progress-modal .progress-bar-track {
    background: #e5e7eb;
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
}
.upload-progress-modal .progress-bar-fill {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 6px;
}
.upload-progress-modal .progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}
.upload-progress-modal .upload-status {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-top: 12px;
}
.upload-progress-modal .upload-success {
    text-align: center;
    padding: 20px;
}
.upload-progress-modal .upload-success .check-icon {
    font-size: 48px;
    color: #16a34a;
    margin-bottom: 8px;
}
.upload-progress-modal .download-link {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 12px;
    color: #333;
    word-break: break-all;
    max-width: 100%;
}

.editor-preview {
    min-height: 200px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    background: #fff;
    line-height: 1.8;
    color: #333;
    overflow-x: auto;
}
.editor-preview :first-child {
    margin-top: 0;
}
.editor-preview :last-child {
    margin-bottom: 0;
}
.editor-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}
.editor-preview iframe {
    max-width: 100%;
}

