/* ============================================
   FOC学习平台 - 全局样式
   专业科技风，浅色主题
   ============================================ */

/* CSS变量 */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --accent: #00c853;
    --accent-dark: #009624;
    --warning: #ff9800;
    --danger: #f44336;
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --bg-code: #f1f3f4;
    --text: #202124;
    --text-secondary: #5f6368;
    --text-muted: #9aa0a6;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 6px 10px rgba(0,0,0,0.08);
    --radius: 8px;
    --radius-lg: 12px;
    --nav-height: 64px;
    --max-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   导航栏
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.navbar-inner {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.navbar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #4fc3f7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

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

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-links a {
    display: block;
    padding: 8px 16px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.navbar-links a:hover,
.navbar-links a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: 0.3s;
}

/* ============================================
   主内容区
   ============================================ */
.main {
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height) - 200px);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Hero区域（首页）
   ============================================ */
.hero {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 40%, #1976d2 70%, #42a5f5 100%);
    color: white;
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 40%),
        radial-gradient(circle at 60% 80%, rgba(255,255,255,0.05) 0%, transparent 45%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero h1 .highlight {
    background: linear-gradient(90deg, #80d8ff, #b3e5fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 18px;
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 32px;
    max-width: 560px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    color: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline:hover {
    border-color: white;
    background: rgba(255,255,255,0.1);
    color: white;
}

.hero-visual {
    position: relative;
    height: 360px;
}

.hero-canvas {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
}

/* ============================================
   特性卡片
   ============================================ */
.features {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 56px;
}

.section-title h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.section-title p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
}

.feature-icon.blue { background: var(--primary-light); color: var(--primary); }
.feature-icon.green { background: #e8f5e9; color: var(--accent-dark); }
.feature-icon.orange { background: #fff3e0; color: #e65100; }
.feature-icon.purple { background: #f3e5f5; color: #7b1fa2; }
.feature-icon.teal { background: #e0f2f1; color: #00695c; }
.feature-icon.red { background: #ffebee; color: #c62828; }

.feature-card h3 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}

.feature-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================
   内容路径（学习路线）
   ============================================ */
.learning-path {
    padding: 80px 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.path-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.path-timeline::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.path-item {
    position: relative;
    padding-left: 80px;
    margin-bottom: 40px;
}

.path-item:last-child {
    margin-bottom: 0;
}

.path-number {
    position: absolute;
    left: 0;
    top: 0;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    z-index: 1;
}

.path-item h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.path-item p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.path-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary-dark);
}

.tag.green { background: #e8f5e9; color: var(--accent-dark); }
.tag.orange { background: #fff3e0; color: #e65100; }

/* ============================================
   文章卡片列表
   ============================================ */
.content-section {
    padding: 80px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.article-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

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

.article-cover {
    height: 160px;
    background: linear-gradient(135deg, var(--primary), #4fc3f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    position: relative;
}

.article-cover.green { background: linear-gradient(135deg, #00c853, #69f0ae); }
.article-cover.orange { background: linear-gradient(135deg, #ff9800, #ffcc80); }
.article-cover.purple { background: linear-gradient(135deg, #7c4dff, #b388ff); }
.article-cover.teal { background: linear-gradient(135deg, #00bcd4, #80deea); }
.article-cover.red { background: linear-gradient(135deg, #ef5350, #ff8a80); }

.article-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-category {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.article-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
    line-height: 1.4;
}

.article-body h3 a {
    color: var(--text);
}

.article-body h3 a:hover {
    color: var(--primary);
}

.article-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.article-meta .read-more {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   工具卡片
   ============================================ */
.tool-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

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

.tool-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.tool-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.tool-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.tool-card .tool-desc {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
    margin-bottom: 20px;
    line-height: 1.7;
}

.tool-card .btn {
    align-self: flex-start;
    padding: 10px 22px;
    font-size: 14px;
}

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

.btn-tool:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
}

/* ============================================
   文章详情页
   ============================================ */
.article-header {
    padding: 60px 0 40px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.article-header .container {
    max-width: 860px;
}

.article-breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.article-breadcrumb a {
    color: var(--text-secondary);
}

.article-header h1 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--text);
}

.article-header .article-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.article-info {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.article-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.article-content h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 48px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
    color: var(--text);
}

.article-content h3 {
    font-size: 21px;
    font-weight: 600;
    margin: 36px 0 16px;
    color: var(--text);
}

.article-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--text);
}

.article-content p {
    margin-bottom: 18px;
    line-height: 1.85;
    color: var(--text);
}

.article-content ul,
.article-content ol {
    margin-bottom: 18px;
    padding-left: 28px;
}

.article-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.article-content strong {
    color: var(--text);
    font-weight: 600;
}

/* 公式 */
.formula {
    background: var(--bg-code);
    border-left: 4px solid var(--primary);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    overflow-x: auto;
}

.formula-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 代码块 */
.code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 24px 0;
    overflow-x: auto;
    font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace;
    font-size: 14px;
    line-height: 1.7;
}

.code-block .comment { color: #6c7086; }
.code-block .keyword { color: #cba6f7; }
.code-block .type { color: #89b4fa; }
.code-block .string { color: #a6e3a1; }
.code-block .number { color: #fab387; }
.code-block .function { color: #89dceb; }

/* 提示框 */
.callout {
    padding: 20px 24px;
    border-radius: var(--radius);
    margin: 24px 0;
    border-left: 4px solid;
}

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

.callout.info {
    background: var(--primary-light);
    border-color: var(--primary);
}
.callout.info .callout-title { color: var(--primary-dark); }

.callout.warning {
    background: #fff3e0;
    border-color: var(--warning);
}
.callout.warning .callout-title { color: #e65100; }

.callout.tip {
    background: #e8f5e9;
    border-color: var(--accent);
}
.callout.tip .callout-title { color: var(--accent-dark); }

.callout.danger {
    background: #ffebee;
    border-color: var(--danger);
}
.callout.danger .callout-title { color: #c62828; }

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th {
    background: var(--primary);
    color: white;
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--primary-light);
}

/* 交互式画布容器 */
.interactive-demo {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 32px 0;
    box-shadow: var(--shadow);
}

.demo-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-title::before {
    content: '⚡';
    font-size: 18px;
}

.demo-canvas {
    width: 100%;
    border-radius: var(--radius);
    background: #fafbfc;
    border: 1px solid var(--border-light);
    display: block;
}

.demo-controls {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.control-group label .value {
    color: var(--primary);
    font-weight: 700;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.demo-info {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--bg-code);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-secondary);
    font-family: "Cascadia Code", Consolas, monospace;
}

/* 文章导航（上一篇/下一篇） */
.article-nav {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.nav-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: all 0.2s;
}

.nav-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.nav-card .nav-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.nav-card .nav-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.nav-card.next {
    text-align: right;
}

/* ============================================
   工具页面布局
   ============================================ */
.tool-page {
    padding: 40px 0 80px;
}

.tool-page-header {
    margin-bottom: 32px;
}

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

.tool-page-header p {
    font-size: 17px;
    color: var(--text-secondary);
}

.tool-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.tool-main {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.tool-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.sidebar-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-card p,
.sidebar-card li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.sidebar-card ul {
    padding-left: 20px;
}

.sidebar-card li {
    margin-bottom: 6px;
}

/* 表单输入 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* 结果展示 */
.result-box {
    background: linear-gradient(135deg, var(--primary-light), #f0f7ff);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-top: 20px;
}

.result-box h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.result-item {
    background: white;
    border-radius: 6px;
    padding: 12px 14px;
}

.result-item .result-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.result-item .result-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: "Cascadia Code", Consolas, monospace;
}

.result-item .result-unit {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
}

/* ============================================
   目录页（理论/工具列表）
   ============================================ */
.directory-page {
    padding: 60px 0 80px;
}

.directory-header {
    text-align: center;
    margin-bottom: 48px;
}

.directory-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.directory-header p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.directory-list {
    max-width: 860px;
    margin: 0 auto;
}

.directory-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.2s;
}

.directory-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.directory-number {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.directory-info {
    flex: 1;
}

.directory-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.directory-info h3 a {
    color: var(--text);
}

.directory-info h3 a:hover {
    color: var(--primary);
}

.directory-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.directory-meta {
    text-align: right;
    flex-shrink: 0;
}

.directory-meta .level {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.level.beginner { background: #e8f5e9; color: #2e7d32; }
.level.intermediate { background: #fff3e0; color: #e65100; }
.level.advanced { background: #ffebee; color: #c62828; }

.directory-meta .read-time {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   页脚
   ============================================ */
.footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    padding: 48px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand h3 {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
}

.footer-col h4 {
    color: white;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 968px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .hero-visual {
        height: 280px;
    }
    .features-grid,
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tool-layout {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .navbar-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .navbar-links.open {
        display: flex;
    }
    .navbar-toggle {
        display: block;
    }
    .hero h1 {
        font-size: 32px;
    }
    .hero p {
        font-size: 16px;
    }
    .features-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .article-nav {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .directory-item {
        flex-direction: column;
        text-align: center;
    }
    .directory-meta {
        text-align: center;
    }
}

/* ============================================
   交互演示：下拉框 / 复选框（齿槽转矩补偿等）
   ============================================ */
.control-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg-card);
    outline: none;
    cursor: pointer;
}

.control-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.control-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.control-group input[type="checkbox"]:checked {
    accent-color: var(--primary);
}

/* ============================================
   交互演示：命令按钮（CiA 402 状态机等）
   ============================================ */
.control-group .demo-btn {
    padding: 7px 14px;
    margin: 3px 4px 3px 0;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.control-group .demo-btn:hover {
    background: var(--primary);
    color: #fff;
}

.control-group .demo-btn:active {
    transform: scale(0.97);
}

/* 专题卡片文章列表 */
.topic-list {
    list-style: none;
    padding: 12px 0 0;
    margin: 0 0 16px;
    border-top: 1px solid var(--border-light);
}
.topic-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13.5px;
    line-height: 1.7;
    padding: 3px 0;
}
.topic-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    align-self: center;
    opacity: 0.75;
}
.topic-list li a {
    color: var(--text-secondary);
    transition: color 0.15s;
}
.topic-list li a:hover {
    color: var(--primary);
}
