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

:root {
    --primary-color: #1e3c72;
    --primary-hover: #2a5298;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f0f4f8;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    --button-gradient: linear-gradient(135deg, #000000 0%, #434343 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 顶部面包屑导航 */
.top-nav {
    background: #f8fafc;
    padding: 12px 0;
    margin-bottom: 0;
    border-bottom: 1px solid #e2e8f0;
}

.nav-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-breadcrumb a:hover {
    color: #1d4ed8;
}

.nav-breadcrumb span {
    color: #94a3b8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px 30px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: visible;
    z-index: 50;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

header h1 {
    font-size: 32px;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 1;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    z-index: 100;
}

.dropdown-toggle {
    position: relative;
    padding-right: 30px;
}

.dropdown-toggle::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.user-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.btn-primary {
    background: var(--button-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.btn-edit {
    background: var(--warning-color);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-edit:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #dc2626;
}

.search-panel {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 10px;
}

.search-panel input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.search-panel input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.admin-panel {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.admin-panel h2 {
    margin-bottom: 24px;
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 600;
}

.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.edit-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.edit-modal-header h3 {
    font-size: 22px;
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-modal:hover {
    background: var(--bg-color);
    color: var(--danger-color);
}

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

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

.form-group input,
.form-group textarea,
.form-group .quill-editor {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group .quill-editor {
    padding: 0;
    min-height: 200px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.message-container {
    display: grid;
    gap: 20px;
}

.message-category {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.message-category:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.category-header h2 {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-header h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    border-radius: 2px;
}

.message-item {
    background: #f8fafc;
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.message-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-color: #2a5298;
    background: #ffffff;
}

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

.message-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 16px;
}

.message-actions {
    display: flex;
    gap: 8px;
}

.message-content {
    background: #ffffff;
    padding: 16px;
    border-radius: 10px;
    border-left: 4px solid #2a5298;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-color);
    word-break: break-word;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 富文本内容样式 */
.message-content h1, .message-content h2, .message-content h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

.message-content h1 { font-size: 24px; }
.message-content h2 { font-size: 20px; }
.message-content h3 { font-size: 16px; }

.message-content p {
    margin-bottom: 8px;
}

.message-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.message-content a:hover {
    color: var(--primary-hover);
}

.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}

.message-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.message-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.message-content ul, .message-content ol {
    margin-left: 24px;
    margin-bottom: 8px;
}

.message-content blockquote {
    border-left: 4px solid var(--border-color);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.copy-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: var(--secondary-color);
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text-color);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

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

.hidden {
    display: none !important;
}

.highlight {
    background-color: #fef08a;
    padding: 2px 4px;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    header h1 {
        font-size: 22px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Quill 编辑器自定义样式 */
.ql-toolbar {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background: #f8fafc;
    border-color: var(--border-color) !important;
}

.ql-container {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-color: var(--border-color) !important;
    font-size: 14px;
    min-height: 150px;
}

.ql-editor {
    min-height: 150px;
}

.ql-editor.ql-blank::before {
    color: var(--text-secondary);
    font-style: normal;
}

.form-group .quill-editor .ql-container {
    min-height: 200px;
}

#editContentInput .ql-container {
    min-height: 300px;
}

.ql-snow .ql-stroke {
    stroke: var(--text-secondary);
}

.ql-snow .ql-fill {
    fill: var(--text-secondary);
}

.ql-snow .ql-picker-label {
    color: var(--text-secondary);
}

.ql-toolbar button:hover,
.ql-toolbar button:focus {
    color: var(--primary-color);
}

.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button:focus .ql-stroke {
    stroke: var(--primary-color);
}

.ql-toolbar button:hover .ql-fill,
.ql-toolbar button:focus .ql-fill {
    fill: var(--primary-color);
}

.ql-toolbar button.ql-active,
.ql-toolbar .ql-picker-label.ql-active {
    color: var(--primary-color);
}

.ql-toolbar button.ql-active .ql-stroke,
.ql-toolbar .ql-picker-label.ql-active .ql-stroke {
    stroke: var(--primary-color);
}

.ql-toolbar button.ql-active .ql-fill,
.ql-toolbar .ql-picker-label.ql-active .ql-fill {
    fill: var(--primary-color);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideDown 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 24px;
    color: var(--text-color);
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    z-index: 10;
    position: relative;
}

.close-modal:hover {
    color: var(--danger-color);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
}

.modal-body h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 18px;
}

.modal-body p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.modal-body strong {
    color: var(--text-color);
}

/* 表单按钮组样式 */
.modal-body .btn {
    transition: all 0.3s ease;
}

.modal-body .btn + .btn {
    margin-top: 0;
}

/* 验证码输入框样式 */
#verificationCode {
    font-size: 20px;
    letter-spacing: 4px;
    text-align: center;
    font-weight: 600;
}

/* 模态框内按钮样式 */
.btn-full {
    width: 100%;
    margin-bottom: 10px;
}

.btn-full:last-child {
    margin-bottom: 0;
}

/* 修复模态框内按钮文字颜色 */
.modal-body .btn-primary,
.modal-body .btn-primary:hover,
.modal-body .btn-primary:focus {
    color: #ffffff !important;
}

.modal-body .btn-secondary {
    background: var(--secondary-color);
    color: #ffffff !important;
    border: none;
}

.modal-body .btn-secondary:hover {
    background: #475569;
}

/* 当前邮箱信息样式 */
.current-email-info {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.current-email-info strong {
    color: var(--text-color);
    font-weight: 600;
}

/* 页脚样式 */
.footer {
    background: #f8fafc;
    padding: 24px 32px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    border-top: 1px solid #e2e8f0;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content > div {
    margin: 4px 0;
}

.footer-links {
    margin-top: 8px;
}

.footer-links a {
    color: #2563eb;
    text-decoration: none;
    margin: 0 8px;
    cursor: pointer;
}

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

.version-tag {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.version-tag:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}
