/**
 * 心镜台样式
 * 
 * 设计理念：
 * - 禅意简约
 * - 现代卡片式布局
 * - 良好的阅读体验
 */

/* ========================================
   1. 容器和布局
   ======================================== */

.mirror-container {
    max-width: var(--container-max-width-lg);
    margin: 0 auto;
    padding: var(--container-padding-top) var(--container-padding-horizontal);
}

/* ========================================
   2. 页头
   ======================================== */

/* Mirror-specific styles are now in page-header.css */
/* Keeping only page-specific overrides here if needed */

/* ========================================
   3. 提问表单
   ======================================== */

.question-form-container {
    max-width: 800px;
    margin: 0 auto 3rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-form {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.question-form h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.form-hint {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.question-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.question-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.char-count {
    font-size: 0.875rem;
    color: #95a5a6;
}

.question-type {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.form-actions-buttons {
    display: flex;
    gap: 1rem;
}

.anonymous-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    color: #5a6c7d;
}

.anonymous-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.btn-cancel,
.btn-submit {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-cancel {
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-cancel:hover {
    background: #d5dbdb;
}

.btn-submit {
    background: #667eea;
    color: white;
}

.btn-submit:hover {
    background: #5568d3;
}

.submit-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.submit-status.success {
    background: #d4edda;
    color: #155724;
}

.submit-status.error {
    background: #f8d7da;
    color: #721c24;
}

.submit-status.warning {
    background: #fff3cd;
    color: #856404;
}

/* 登录提示 */
.login-hint {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.25);
    animation: slideIn 0.3s ease;
}

.login-hint .hint-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.login-hint .hint-icon {
    flex-shrink: 0;
    opacity: 0.9;
}

.login-hint a {
    color: white;
    font-weight: 600;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.login-hint a:hover {
    opacity: 0.8;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   4. 控制栏
   ======================================== */

.mirror-controls {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tags-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tags-label {
    font-weight: 400;
    color: #999;
    font-size: 0.9rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.tags-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #95a5a6;
    font-size: 0.9rem;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.tag-item:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #d0d0d0;
}

.tag-item.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tag-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    padding: 0 0.3rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: #999;
}

.tag-item.active .tag-count {
    color: rgba(255, 255, 255, 0.9);
}

.tag-all {
    font-weight: 500;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-select {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
}

/* ========================================
   5. 文章网格
   ======================================== */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.article-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.article-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-card-summary {
    color: #5a6c7d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.article-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #95a5a6;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.meta-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.meta-icon {
    flex-shrink: 0;
    color: #95a5a6;
}

.stat-icon {
    flex-shrink: 0;
    color: #95a5a6;
}

.article-card-stats {
    display: flex;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ========================================
   6. 加载和空状态
   ======================================== */

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 3rem;
    grid-column: 1 / -1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #95a5a6;
    /* 在grid布局中占据所有列 */
    grid-column: 1 / -1;
    /* 确保内容居中 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* ========================================
   7. 分页
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

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

.page-info {
    color: #5a6c7d;
    font-size: 0.9rem;
}

/* ========================================
   8. 我的提问
   ======================================== */

.my-questions-section {
    margin-top: 4rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.my-questions-section h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.my-questions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.my-question-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.my-question-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-retry_failed {
    background: #fff8f0;
    color: #e67e22;
}

/* ========================================
   9. 响应式
   ======================================== */

@media (max-width: 768px) {
    .mirror-title {
        font-size: 2rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .mirror-controls {
        padding: 1rem;
    }
    
    .tags-section {
        gap: 0.75rem;
    }
    
    .tags-label {
        font-size: 0.9rem;
    }
    
    .tag-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .tag-count {
        min-width: 1.25rem;
        height: 1.25rem;
        font-size: 0.7rem;
    }
}
