/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #404040 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.title {
    font-size: 2.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    flex: 1;
    margin-bottom: 40px;
}

/* 区域标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 输入区域 */
.input-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#markdown-input {
    width: 100%;
    height: 600px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 15px;
    padding: 20px;
    font-size: 14px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    resize: vertical;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

#markdown-input:focus {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

#markdown-input::placeholder {
    color: #999;
}

/* 输出区域 */
.output-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.preview {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    height: 600px;
    overflow-y: auto;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 按钮样式 */
.clear-btn,
.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.clear-btn:hover,
.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    font-weight: 600;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #444 0%, #666 100%);
}

.copy-icon {
    font-size: 16px;
}



/* Toast 提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 500;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translate(-50%, -50%) scale(1);
}

/* 微信公众号格式样式 */
.wechat-content h1 {
    color: white;
    background: #4a4a4a;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.6;
    margin: 35px 0 30px 0;
    text-align: center;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: inline-block;
    width: auto;
}

.wechat-content p:has(strong[style*="background-color: #4a4a4a"]) {
    text-align: center;
}

.wechat-content h2 {
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.5;
    margin: 35px 0 20px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #666;
}

.wechat-content h3 {
    color: #2a2a2a;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    margin: 28px 0 12px 0;
}

.wechat-content p {
    color: #1a1a1a;
    font-size: 16px;
    line-height: 1.8;
    margin: 18px 0;
}

.wechat-content strong {
    color: #333;
    font-weight: 600;
}

.wechat-content em {
    color: #555;
    font-style: italic;
    font-weight: 500;
}

.wechat-content code {
    background: #f8f9fa;
    color: #e74c3c;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 14px;
}

.wechat-content pre {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wechat-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    border: none;
}

.wechat-content blockquote {
    background: #f8f8f8;
    border-left: 4px solid #666;
    margin: 15px 0;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wechat-content blockquote p {
    color: #444;
    margin: 0;
    text-indent: 0;
    font-style: italic;
}

.wechat-content ul,
.wechat-content ol {
    margin: 12px 0;
    padding-left: 30px;
}

.wechat-content li {
    color: #1a1a1a;
    font-size: 16px;
    line-height: 1.8;
    margin: 8px 0;
}

.wechat-content a {
    color: #555;
    text-decoration: none;
    border-bottom: 1px dotted #555;
    font-weight: 500;
}

.wechat-content a:hover {
    color: #333;
    border-bottom-color: #333;
}

.wechat-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wechat-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #666, transparent);
    margin: 25px 0;
}

.wechat-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
}

.wechat-content th,
.wechat-content td {
    border: 1px solid #e9ecef;
    padding: 10px;
    text-align: left;
}

.wechat-content th {
    background: #f5f5f5;
    font-weight: 600;
    color: #1a1a1a;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .title {
        font-size: 2rem;
    }

    #markdown-input,
    .preview {
        height: 450px;
    }

    .container {
        padding: 15px;
    }

    .header {
        padding: 30px 20px;
    }
}