/* md2word.com - Component Stylesheet */
/* 按钮组件、代码块、FAQ等组件样式 */

/* ===================
   按钮组件
   =================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 主要按钮 */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:focus-visible {
    outline-color: var(--primary-color);
    outline-offset: 2px;
}

/* 次要按钮 */
.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* 成功按钮 */
.btn-success {
    background: var(--accent-green);
    color: white;
    box-shadow: var(--shadow);
}

.btn-success:hover:not(:disabled) {
    background: #2f855a;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* 危险按钮 */
.btn-danger {
    background: var(--accent-red);
    color: white;
    box-shadow: var(--shadow);
}

.btn-danger:hover:not(:disabled) {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* 按钮尺寸 */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ===================
   代码块组件
   =================== */
.code-block {
    position: relative;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.code-block pre {
    background: var(--gray-900);
    color: #e2e8f0;
    padding: 1.5rem;
    margin: 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
}

.code-block code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

/* 代码块头部 */
.code-header {
    background: var(--gray-800);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-700);
}

.code-language {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* 复制按钮 */
.copy-btn {
    background: var(--gray-700);
    color: var(--gray-300);
    border: 1px solid var(--gray-600);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.copy-btn:hover {
    background: var(--gray-600);
    color: white;
    border-color: var(--gray-500);
}

.copy-btn.copied {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

/* 内联代码 */
:not(pre) > code {
    background: var(--gray-100);
    color: var(--accent-red);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.875em;
}

/* ===================
   FAQ 组件
   =================== */
.faq-section {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-top: 3rem;
}

.faq-section h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2rem;
    text-align: center;
}

.faq-item {
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-question::before {
    content: "❓";
    font-size: 1rem;
}

.faq-answer {
    color: var(--gray-600);
    line-height: 1.7;
}

/* ===================
   卡片组件
   =================== */
.guide-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: block;
}

.guide-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.guide-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.guide-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ===================
   CTA 按钮组
   =================== */
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    min-width: 140px;
    justify-content: center;
}

/* ===================
   相关指南区域
   =================== */
.related-guides {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-top: 3rem;
}

.related-guides h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    text-align: center;
}

.related-guides .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* ===================
   内容样式增强
   =================== */
.prose {
    max-width: none;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--gray-900);
}

.prose h1 {
    font-size: 2.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h2 {
    font-size: 1.875rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.prose h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.prose p {
    margin-top: 1rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.prose ul,
.prose ol {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--gray-50);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.prose th,
.prose td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.prose th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-900);
}

.prose tbody tr:hover {
    background: var(--gray-50);
}

/* ===================
   移动端优化
   =================== */
@media (max-width: 768px) {
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .faq-section {
        padding: 1.5rem;
    }

    .faq-item {
        padding: 1rem;
    }

    .related-guides {
        padding: 1.5rem;
    }

    .related-guides .grid {
        grid-template-columns: 1fr;
    }

    .prose h1 {
        font-size: 1.875rem;
    }

    .prose h2 {
        font-size: 1.5rem;
    }

    .prose h3 {
        font-size: 1.25rem;
    }

    .code-block pre {
        padding: 1rem;
        font-size: 0.75rem;
    }
}

/* ===================
   加载和动画效果
   =================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===================
   悬浮提示
   =================== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}