/* ===== 全局样式 ===== */ * { margin: 0; padding: 0; box-sizing: border-box; } :root { --primary: #2563eb; --primary-dark: #1d4ed8; --secondary: #64748b; --success: #10b981; --warning: #f59e0b; --danger: #ef4444; --bg: #f8fafc; --card-bg: #ffffff; --text: #1e293b; --text-light: #64748b; --border: #e2e8f0; --code-bg: #1e293b; --code-text: #e2e8f0; --shadow: 0 1px 3px rgba(0,0,0,0.1); --shadow-lg: 0 10px 25px rgba(0,0,0,0.1); --radius: 12px; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; } a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; } /* ===== 导航栏 ===== */ .navbar { background: var(--card-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); } .navbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 64px; } .logo { font-size: 20px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; } .logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--primary), #8b5cf6); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-size: 18px; } .nav-links { display: flex; gap: 24px; list-style: none; } .nav-links a { color: var(--text-light); font-size: 15px; font-weight: 500; transition: color 0.2s; } .nav-links a:hover, .nav-links a.active { color: var(--primary); text-decoration: none; } /* ===== Hero区域 ===== */ .hero { background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 100%); color: white; padding: 60px 20px; text-align: center; } .hero h1 { font-size: 36px; font-weight: 800; margin-bottom: 16px; } .hero p { font-size: 18px; opacity: 0.9; max-width: 600px; margin: 0 auto 24px; } .hero-badges { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; } .hero-badge { background: rgba(255,255,255,0.15); backdrop-filter: blur(10px); padding: 6px 16px; border-radius: 20px; font-size: 14px; } /* ===== 容器 ===== */ .container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; } .container-narrow { max-width: 800px; margin: 0 auto; padding: 40px 20px; } /* ===== 区块标题 ===== */ .section-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; } .section-subtitle { color: var(--text-light); margin-bottom: 24px; } /* ===== 卡片网格 ===== */ .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; } .card { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); transition: all 0.3s; border: 1px solid var(--border); } .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); } .card-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 16px; } .card-icon.blue { background: #dbeafe; color: #2563eb; } .card-icon.green { background: #d1fae5; color: #059669; } .card-icon.orange { background: #fed7aa; color: #ea580c; } .card-icon.purple { background: #ede9fe; color: #7c3aed; } .card-icon.red { background: #fee2e2; color: #dc2626; } .card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; } .card p { color: var(--text-light); font-size: 14px; margin-bottom: 16px; } .card-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-light); } .card-meta span { display: flex; align-items: center; gap: 4px; } /* ===== 教程页面 ===== */ .tutorial-header { background: var(--card-bg); border-radius: var(--radius); padding: 32px; margin-bottom: 24px; box-shadow: var(--shadow); border: 1px solid var(--border); } .tutorial-header h1 { font-size: 28px; font-weight: 700; margin-bottom: 12px; } .tutorial-meta { display: flex; gap: 20px; color: var(--text-light); font-size: 14px; flex-wrap: wrap; } .tutorial-meta span { display: flex; align-items: center; gap: 6px; } .difficulty { padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; } .difficulty.easy { background: #d1fae5; color: #059669; } .difficulty.medium { background: #fef3c7; color: #d97706; } .difficulty.hard { background: #fee2e2; color: #dc2626; } .tutorial-content { background: var(--card-bg); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); border: 1px solid var(--border); } .tutorial-content h2 { font-size: 22px; font-weight: 700; margin: 32px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--border); } .tutorial-content h2:first-child { margin-top: 0; } .tutorial-content h3 { font-size: 18px; font-weight: 600; margin: 24px 0 12px; } .tutorial-content p { margin-bottom: 16px; color: #334155; } .tutorial-content ul, .tutorial-content ol { margin: 12px 0 16px 24px; } .tutorial-content li { margin-bottom: 8px; color: #334155; } /* 代码块 */ .code-block { background: var(--code-bg); color: var(--code-text); padding: 16px 20px; border-radius: 8px; overflow-x: auto; margin: 16px 0; font-family: 'Consolas', 'Monaco', monospace; font-size: 14px; line-height: 1.6; } .code-block .comment { color: #64748b; } .code-block .keyword { color: #c084fc; } .code-block .string { color: #86efac; } /* 提示框 */ .alert { padding: 16px 20px; border-radius: 8px; margin: 16px 0; border-left: 4px solid; } .alert-info { background: #eff6ff; border-color: #3b82f6; color: #1e40af; } .alert-warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; } .alert-danger { background: #fef2f2; border-color: #ef4444; color: #991b1b; } .alert-success { background: #f0fdf4; border-color: #22c55e; color: #166534; } .alert strong { display: block; margin-bottom: 4px; } /* 步骤 */ .step { display: flex; gap: 16px; margin: 24px 0; } .step-number { flex-shrink: 0; width: 36px; height: 36px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; } .step-content { flex: 1; } .step-content h4 { font-size: 17px; font-weight: 600; margin-bottom: 8px; } /* 表格 */ .table-wrap { overflow-x: auto; margin: 16px 0; } table { width: 100%; border-collapse: collapse; font-size: 14px; } th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); } th { background: #f1f5f9; font-weight: 600; color: var(--text); } tr:hover { background: #f8fafc; } /* ===== 对比表格 ===== */ .compare-table { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); } .compare-table table { margin: 0; } .compare-table .recommended { background: #f0fdf4; } .compare-table .recommended td:first-child { font-weight: 700; color: #166534; } /* ===== 底部 ===== */ .footer { background: #1e293b; color: #94a3b8; padding: 40px 20px; margin-top: 60px; } .footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; } .footer h4 { color: white; font-size: 16px; margin-bottom: 16px; } .footer ul { list-style: none; } .footer li { margin-bottom: 8px; } .footer a { color: #94a3b8; font-size: 14px; } .footer a:hover { color: white; } .footer-bottom { max-width: 1200px; margin: 32px auto 0; padding-top: 24px; border-top: 1px solid #334155; text-align: center; font-size: 13px; } /* ===== 响应式 ===== */ @media (max-width: 768px) { .nav-links { display: none; } .hero h1 { font-size: 28px; } .hero p { font-size: 16px; } .card-grid { grid-template-columns: 1fr; } .footer-inner { grid-template-columns: 1fr; gap: 24px; } .tutorial-content { padding: 20px; } .tutorial-header { padding: 20px; } }