/* 全局样式 */
:root {
    --primary-color: #42b983;
    --primary-dark: #359c6d;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 菜单导航样式 */
.menu-nav {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
}

.menu-btn {
    padding: 12px 24px;
    background-color: #e9ecef;
    border: 2px solid #dee2e6;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
}

.menu-btn:hover {
    background-color: #dee2e6;
}

.menu-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.menu-btn.active:hover {
    background-color: var(--primary-dark);
}

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

/* 头部 */
.header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 主要内容区域 */
.main {
    margin-bottom: 40px;
}

/* 上传区域 */
.upload-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    text-align: center;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 60px 20px;
    cursor: pointer;
    transition: var(--transition);
    background-color: #fafafa;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #f0f8ff;
}

.upload-area.dragover {
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-content h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.upload-content p {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 1rem;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
    margin: 5px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 文件列表 */
.file-list {
    margin-top: 30px;
    text-align: left;
}

.file-list h4 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.file-items {
    margin-bottom: 20px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    background-color: #fff;
    transition: var(--transition);
}

.file-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-icon {
    font-size: 1.5rem;
    margin-right: 15px;
}

.file-details h5 {
    margin-bottom: 5px;
    color: var(--dark-color);
}

.file-details span {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.file-remove {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--danger-color);
    padding: 5px 10px;
    border-radius: 50%;
    transition: var(--transition);
}

.file-remove:hover {
    background-color: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

.file-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* 前缀输入框容器 */
.prefix-input-container {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.prefix-input-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--dark-color);
}

.prefix-input-container input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.prefix-input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 185, 131, 0.2);
}

.help-text {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--secondary-color);
    line-height: 1.5;
}

/* 服务器地址配置容器 */
.server-config-container {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.server-config-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--dark-color);
}

.server-config-container input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.server-config-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 185, 131, 0.2);
}

.server-config-container .help-text {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--secondary-color);
    line-height: 1.5;
}

/* 进度区域 */
.progress-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
}

.progress-container {
    max-width: 600px;
    margin: 0 auto;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 500;
}

.progress-bar {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

/* 结果区域 */
.result-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

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

.result-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.result-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background-color: #f8f9fa;
    border-radius: 20px;
    font-size: 0.9rem;
}

.stat-icon {
    font-size: 1.2rem;
}

/* 标签切换 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--secondary-color);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--dark-color);
    background-color: #f8f9fa;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 标签内容 */
.tab-content {
    min-height: 300px;
}

.tab-pane {
    display: none;
}

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

.content-header {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.code-container {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 20px;
    overflow-x: auto;
    max-height: 500px;
}

.code-block {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.preview-container {
    padding: 20px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-height: 300px;
}

.markdown-preview {
    line-height: 1.6;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.markdown-preview h1 {
    font-size: 2em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

.markdown-preview h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

.markdown-preview p {
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-preview a {
    color: var(--primary-color);
    text-decoration: none;
}

.markdown-preview a:hover {
    text-decoration: underline;
}

.markdown-preview img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 5px;
}

.markdown-preview code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.markdown-preview pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 6px;
}

.markdown-preview pre code {
    padding: 0;
    margin: 0;
    font-size: 100%;
    word-break: normal;
    white-space: pre;
    background: transparent;
    border: 0;
}

.markdown-preview blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin: 0 0 16px 0;
}

.markdown-preview ul,
.markdown-preview ol {
    padding-left: 2em;
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-preview li {
    margin-bottom: 0.25em;
}

.markdown-preview li>p {
    margin-top: 16px;
}

/* 图片列表 */
.images-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.image-item {
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background-color: #fff;
    transition: var(--transition);
}

.image-item:hover {
    box-shadow: var(--shadow);
}

.image-item.success {
    border-left: 4px solid var(--success-color);
}

.image-item.error {
    border-left: 4px solid var(--danger-color);
}

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

.image-header strong {
    color: var(--dark-color);
}

.image-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.image-status.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.image-status.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.image-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-detail strong {
    min-width: 80px;
    color: var(--dark-color);
}

.image-url {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
    word-break: break-all;
}

.image-url:hover {
    color: var(--primary-dark);
}

/* 错误区域 */
.error-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
}

.error-container {
    max-width: 500px;
    margin: 0 auto;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-container h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.error-message {
    color: var(--danger-color);
    margin-bottom: 25px;
    padding: 15px;
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* 通知组件 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    background-color: white;
}

.notification.success .notification-content {
    border-left: 4px solid var(--success-color);
}

.notification.error .notification-content {
    border-left: 4px solid var(--danger-color);
}

.notification.info .notification-content {
    border-left: 4px solid var(--info-color);
}

.notification.warning .notification-content {
    border-left: 4px solid var(--warning-color);
}

.notification-icon {
    font-size: 1.5rem;
    margin-right: 15px;
}

.notification-message {
    flex: 1;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
}

.notification-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* 加载中遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-hover);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
}

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

.modal-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* 底部 */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
    color: #adb5bd;
    font-size: 0.9rem;
}

.footer-section li strong {
    color: white;
}

/* 微信二维码区域样式 */
.wechat-section {
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    margin-top: 20px;
}

.wechat-content p {
    margin-bottom: 15px;
    color: #e9ecef;
}

.wechat-qr {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.wechat-qr-code {
    width: 200px;
    height: 200px;
    border-radius: var(--border-radius);
    object-fit: contain;
    background-color: white;
    padding: 15px;
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    background-color: white;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.9rem;
    border: 2px dashed #dee2e6;
}

.wechat-text {
    font-weight: 500;
    color: white !important;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #adb5bd;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header {
        padding: 30px 0;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .upload-section {
        padding: 20px;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .result-stats {
        width: 100%;
        flex-wrap: wrap;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 0 auto;
        text-align: center;
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .content-header {
        flex-direction: column;
    }

    .notification {
        left: 20px;
        right: 20px;
        min-width: auto;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .menu-nav {
        flex-direction: column;
        align-items: center;
    }

    .menu-btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .qr-placeholder {
        width: 120px;
        height: 120px;
    }
}