/* 免费效率工具箱 - 全局样式 */

/* 变量定义 */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

/* 头部导航 */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span { color: var(--primary); }

.nav {
    display: flex;
    gap: 8px;
}

.nav a {
    padding: 8px 16px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav a:hover, .nav a.active {
    background: var(--primary);
    color: white;
}

/* 搜索框 */
.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--bg);
}

/* 主内容区 */
.main { padding: 40px 0; }

/* 页面标题 */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-desc {
    color: var(--text-light);
    font-size: 16px;
}

/* 分类标签 */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.category-tag {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text);
}

.category-tag:hover, .category-tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 卡片 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-preview {
    height: 160px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
}

.card-body { padding: 20px; }

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-desc {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.card-tag {
    padding: 2px 8px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-light);
}

/* 工具卡片 */
.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.tool-info { flex: 1; }

.tool-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tool-desc {
    color: var(--text-light);
    font-size: 14px;
}

/* 热门推荐 */
.section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 统计徽章 */
.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-light);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

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

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

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

.btn-secondary:hover {
    background: var(--border);
}

/* 面包屑 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-light);
}

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

.breadcrumb a:hover { text-decoration: underline; }

/* 页脚 */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.footer-section a {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    padding: 4px 0;
    font-size: 14px;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-body { padding: 20px; }

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* 搜索结果页 */
.search-results {
    margin-top: 32px;
}

.result-group { margin-bottom: 32px; }

.result-group-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.2s;
}

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

.result-icon {
    width: 48px;
    height: 48px;
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.result-info { flex: 1; }

.result-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.result-type {
    font-size: 12px;
    color: var(--primary);
}

/* 收藏面板 */
.favorites-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: right 0.3s;
}

.favorites-panel.open { right: 0; }

.favorite-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
}

.favorite-item:hover {
    background: var(--bg);
}

/* 最近使用 */
.recent-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.recent-item {
    flex-shrink: 0;
    width: 140px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
}

.recent-icon {
    width: 80px;
    height: 80px;
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 8px;
}

.recent-name {
    font-size: 14px;
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-top: 12px;
    }
    
    .search-box {
        order: 2;
        max-width: none;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .favorites-panel {
        width: 100%;
        right: -100%;
    }
}

/* 模板详情页 */
.template-detail {
    max-width: 800px;
    margin: 0 auto;
}

.template-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    color: white;
    margin-bottom: 32px;
}

.template-hero h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.template-hero p {
    opacity: 0.9;
    margin-bottom: 24px;
}

.template-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.template-meta {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
    font-size: 14px;
    opacity: 0.9;
}

.template-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.template-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.example-box {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.example-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.tips-list {
    list-style: none;
}

.tips-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.tips-list li:last-child {
    border-bottom: none;
}

.mistake-item {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.mistake-wrong {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 8px;
}

.mistake-right {
    color: var(--success);
    font-size: 14px;
}

/* FAQ手风琴 */
.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    padding: 16px 0;
    background: none;
    border: none;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-answer {
    padding: 0 0 16px 0;
    color: var(--text-light);
    display: none;
}

.faq-item.open .faq-answer {
    display: block;
}

/* 相关推荐 */
.related-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.related-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
}

.related-item:hover {
    background: var(--border);
}

.related-icon {
    font-size: 24px;
}

/* 教程页面 */
.guide-content {
    max-width: 800px;
    margin: 0 auto;
}

.guide-toc {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.guide-toc h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.guide-toc ol {
    padding-left: 24px;
}

.guide-toc li {
    padding: 8px 0;
}

.guide-toc a {
    color: var(--primary);
    text-decoration: none;
}

.guide-toc a:hover {
    text-decoration: underline;
}

.chapter {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.chapter h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.chapter p {
    margin-bottom: 16px;
    line-height: 1.8;
}

/* 广告占位符 */
.ad-placeholder {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    color: var(--text-light);
    margin: 24px 0;
}

/* 工具页面 */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
}

.tool-preview {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
}

.drop-zone-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.drop-zone-text {
    color: var(--text-light);
    margin-bottom: 16px;
}

.tool-options {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.option-group {
    margin-bottom: 20px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

.option-hint {
    font-size: 12px;
    color: var(--text-light);
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .page-title { font-size: 24px; }
    .template-hero { padding: 24px; }
    .template-actions { flex-direction: column; }
    .chapter { padding: 20px; }
}
/* ===== 增强样式 ===== */

/* 工具使用说明 */
.tool-guide {
    background: linear-gradient(135deg, #667eea10, #764ba210);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0;
}
.tool-guide-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tool-guide-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.tool-guide-step {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}
.tool-guide-step-num {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin: 0 auto 8px;
}
.tool-guide-step-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.tool-guide-step-desc { font-size: 12px; color: var(--text-light); }

/* 工具特色标签 */
.tool-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}
.tool-feature-tag {
    background: #e0e7ff;
    color: #4338ca;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* 反馈入口 */
.feedback-bar {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    margin: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.feedback-bar-text {
    font-size: 14px;
    color: #92400e;
}
.feedback-bar-btn {
    padding: 8px 16px;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
.feedback-bar-btn:hover { background: #d97706; }

/* 错误状态 */
.error-state {
    text-align: center;
    padding: 40px 20px;
    background: #fef2f2;
    border-radius: var(--radius-lg);
    margin: 20px 0;
}
.error-state-icon { font-size: 32px; margin-bottom: 12px; }
.error-state-title { font-size: 16px; font-weight: 600; color: #dc2626; margin-bottom: 8px; }
.error-state-desc { font-size: 14px; color: #666; }
.error-state-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: #dc2626;
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 14px;
}

@media (max-width: 768px) {
    .tool-guide-steps { grid-template-columns: 1fr; }
    .feedback-bar { flex-direction: column; text-align: center; }
}
