/* ========================================
   狗屁不通文本生成器样式
   ======================================== */

html, body { height: 100%; overflow: hidden; margin: 0; }
body { display: flex; align-items: center; justify-content: center; padding-top: 70px; }

/* 主内容 */
.main-content {
    width: 100%;
    max-width: 1000px;
    height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    padding: 0 20px;
    padding-bottom: 50px;
    z-index: 10;
}
.container { width: 100%; height: 100%; }
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* 输入区 */
.input-section {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.input-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}
.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.input-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.input-field {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.input-field:focus {
    border-color: var(--primary-color);
}
.input-field::placeholder {
    color: var(--text-muted);
}
#topicInput { width: 220px; }
#lengthSelect { width: 160px; cursor: pointer; }

/* 操作栏 */
.action-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.action-group { display: flex; gap: 8px; }
.btn-action {
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.btn-action:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.btn-action.btn-blue {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.btn-action.btn-blue:hover {
    background: rgba(16, 185, 129, 0.3);
}

/* 文章展示区 */
.article-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.panel-header {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}
.article-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 2;
}
.article-content h2 {
    color: var(--text-primary);
    font-size: 20px;
    text-align: center;
    margin-bottom: 16px;
    font-weight: 700;
}
.article-content p {
    margin-bottom: 12px;
    text-indent: 2em;
}

.placeholder-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 12px;
}
.placeholder-text i { font-size: 48px; }
.placeholder-text p { font-size: 14px; }

/* 响应式 */
@media (max-width: 768px) {
    .input-row { flex-direction: column; align-items: stretch; }
    #topicInput, #lengthSelect { width: 100%; }
    .action-bar { justify-content: center; }
}

/* 隐藏浏览器打印默认页眉页脚 */
@page {
    size: auto;
    margin: 0;
}

/* 打印样式 - 仅打印文章内容 */
@media print {
    body { background: white !important; color: black !important; }
    .bg-grid, .navbar, .footer, .input-section, .action-bar, .panel-header { display: none !important; }
    html, body { height: auto; overflow: visible; margin: 0; padding: 0; display: block !important; }
    .main-content {
        max-width: none !important;
        height: auto !important;
        padding: 1cm;
        display: block !important;
        align-items: normal !important;
    }
    .container { height: auto; }
    .tool-card {
        box-shadow: none;
        border: none;
        background: white;
        border-radius: 0;
        height: auto;
        overflow: visible;
    }
    .article-section {
        overflow: visible;
    }
    .article-content {
        color: black;
        font-size: 14px;
        line-height: 1.8;
        padding: 0;
    }
    .article-content h2 {
        color: black;
        text-align: center;
        margin-top: 0;
        margin-bottom: 24px;
    }
    .article-content p { margin-bottom: 8px; }
    .placeholder-text { display: none; }
}
