/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 登录卡片样式 */
.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
}

.logo {
    margin-bottom: 30px;
}

.logo i {
    font-size: 60px;
    color: #667eea;
    margin-bottom: 15px;
}

.logo h1 {
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group label i {
    margin-right: 8px;
    color: #667eea;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* 管理员链接 */
.admin-link {
    margin-top: 20px;
    text-align: center;
}

.admin-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.admin-link a:hover {
    text-decoration: underline;
}

/* 消息提示 */
.message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 头部样式 */
.header {
    background: white;
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header-left h1 {
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 用户信息样式 */
.user-info {
    position: relative;
    cursor: pointer;
}

.avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.user-details {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    display: none;
    z-index: 1000;
}

.user-info:hover .user-details {
    display: block;
}

.user-card {
    text-align: left;
}

.info-item {
    margin-bottom: 8px;
    font-size: 14px;
}

.info-item strong {
    color: #667eea;
}

/* 主要内容区域 */
.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.converter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.converter-header h2 {
    font-size: 28px;
    color: #333;
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.button-group .btn {
    padding: 10px 20px;
    font-size: 14px;
    white-space: nowrap;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.button-group .btn {
    padding: 10px 20px;
    font-size: 14px;
    white-space: nowrap;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* 转换器容器 */
.converter-container {
    display: grid;
    grid-template-columns: minmax(400px, 1fr) minmax(400px, 1fr);
    gap: 30px;
    height: 700px;
    flex: 1;
}

.input-section, .preview-section {
    display: flex;
    flex-direction: column;
}

.input-section h3, .preview-section h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.input-info, .preview-info {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 文本区域样式 */
textarea {
    height: 550px;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    font-family: 'Courier New', monospace;
    overflow-y: auto;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* 预览区域样式 */
.preview-content {
    height: 550px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    overflow-y: auto;
    overflow-x: auto;
    background: #fafafa;
    min-width: 0;
}

/* 防止pandoc生成的HTML内容撑宽容器 */
.preview-content * {
    max-width: 100%;
    word-wrap: break-word;
}

.preview-content pre,
.preview-content code {
    white-space: pre-wrap;
    word-break: break-all;
}

.preview-content table {
    width: 100%;
    table-layout: fixed;
    word-break: break-all;
}

.preview-placeholder {
    text-align: center;
    color: #999;
    padding: 60px 20px;
}

.preview-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Markdown预览样式 */
.preview-content h1, .preview-content h2, .preview-content h3 {
    margin: 20px 0 10px 0;
    color: #333;
}

.preview-content p {
    margin: 10px 0;
    line-height: 1.6;
}

.preview-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.preview-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
}

.preview-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
    font-style: italic;
}

/* 管理员面板样式 */
.admin-panel {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.admin-content {
    padding: 0;
}

.admin-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* 导入信息样式 */
.import-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.import-info pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    overflow-x: auto;
}

.result-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
}

.result-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .login-card {
        margin: 50px auto;
        padding: 30px 20px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .converter-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid #dee2e6;
        border-left: 3px solid transparent;
    }
    
    .tab-btn.active {
        border-left-color: #667eea;
        border-bottom-color: #dee2e6;
    }
}

/* 数学公式样式 */
.katex-display {
    margin: 15px 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.katex {
    font-size: 1.1em;
}

/* 底部样式 */
.footer {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    margin-top: 20px;
    text-align: center;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    color: white;
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

/* 底部样式 */
.footer {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    margin-top: 20px;
    text-align: center;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    color: white;
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

/* 底部样式 */
.footer {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    margin-top: 20px;
    text-align: center;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    color: white;
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

/* 底部样式 */
.footer {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    margin-top: 20px;
    text-align: center;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    color: white;
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

/* 底部样式 */
.footer {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    margin-top: 20px;
    text-align: center;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    color: white;
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

/* 底部样式 */
.footer {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    margin-top: 20px;
    text-align: center;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    color: white;
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}