/* ===== 津达线缆培训系统 — 公共样式 ===== */
/* 复用自现有HTML手册模板，所有课程页统一引用 */

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

body {
    font-family: "Microsoft YaHei", "SimHei", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f0f2f5;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #fff;
    padding: 30px;
    border-radius: 6px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-bottom: 3px solid var(--primary, #2c5aa0);
}

h1 {
    font-size: 2.2em;
    color: var(--primary, #2c5aa0);
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1em;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

nav {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

nav h2 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--primary, #2c5aa0);
    border-bottom: 2px solid var(--primary, #2c5aa0);
    padding-bottom: 8px;
}

nav ul { list-style: none; }
nav ul li { margin-bottom: 10px; }

nav ul li a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

/* 导航底部返回首页按钮 */
.nav-back {
    display: block;
    margin-top: 20px;
    padding: 12px 15px;
    background: var(--primary, #2c5aa0);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-size: 0.92em;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}
.nav-back:hover {
    background: #fff;
    color: var(--primary, #2c5aa0) !important;
    border-color: var(--primary, #2c5aa0);
    transform: translateX(0);
}
.nav-back::before { content: "← "; }

nav ul li a:hover {
    background: var(--primary, #2c5aa0);
    color: white;
    transform: translateX(3px);
}

/* 返回首页链接 */
.back-home {
    display: inline-block;
    margin-bottom: 20px;
    padding: 8px 16px;
    background: #fff;
    color: var(--primary, #2c5aa0);
    text-decoration: none;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 0.9em;
    transition: all 0.3s ease;
}
.back-home:hover { background: var(--primary, #2c5aa0); color: #fff; }

main {
    background: #fff;
    border-radius: 6px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 2px dashed #e0e0e0;
    scroll-margin-top: 20px;
}
.section:last-child { border-bottom: none; margin-bottom: 0; }

h2 {
    font-size: 1.6em;
    color: var(--primary, #2c5aa0);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary, #2c5aa0);
    display: inline-block;
}

h3 {
    font-size: 1.2em;
    color: #333;
    margin: 20px 0 12px 0;
    padding-left: 12px;
    border-left: 3px solid var(--primary, #2c5aa0);
}

h4 {
    font-size: 1.1em;
    color: #555;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

p { margin-bottom: 15px; text-align: justify; }

ul, ol { margin: 15px 0; padding-left: 30px; }
li { margin-bottom: 10px; }

/* ===== 提示框组件 ===== */
.highlight-box {
    background: #e8f4fd;
    padding: 15px 20px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid var(--primary, #2c5aa0);
}

.info-box {
    background: #f0f7ff;
    padding: 15px 20px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid #1a73e8;
}

.warning-box {
    background: #fff8e1;
    padding: 15px 20px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid #f9a825;
}

.danger-box {
    background: #fdecea;
    padding: 15px 20px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid #d32f2f;
}

.success-box {
    background: #e8f5e9;
    padding: 15px 20px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid #43a047;
}

/* ===== 表格 ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

th {
    background: var(--primary, #2c5aa0);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 500;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

tr:hover { background: #f5f5f5; }
tr:nth-child(even) { background: #f9f9f9; }

/* ===== 卡片 ===== */
.card {
    background: #fafafa;
    border-radius: 6px;
    padding: 18px 22px;
    margin: 14px 0;
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--primary, #2c5aa0);
}
.card h4 { color: var(--primary, #2c5aa0); margin-top: 0; font-size: 1.05em; }

/* 编号圆形徽章 */
.num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary, #2c5aa0);
    color: #fff;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

/* 步骤流程 */
.step-list { list-style: none; padding-left: 0; counter-reset: step; }
.step-list li {
    counter-increment: step;
    position: relative;
    padding-left: 50px;
    margin-bottom: 18px;
}
.step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary, #2c5aa0);
    color: #fff;
    text-align: center;
    line-height: 34px;
    font-weight: bold;
}

/* 公式/代码 */
.formula {
    background: #f5f5f5;
    padding: 12px 15px;
    border-radius: 4px;
    font-family: "Courier New", monospace;
    margin: 12px 0;
    border-left: 3px solid #666;
    overflow-x: auto;
    font-size: 0.95em;
}

footer {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    margin-top: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
footer p { color: #666; }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .content-wrapper { grid-template-columns: 1fr; }
    nav { position: static; }
}
@media (max-width: 768px) {
    h1 { font-size: 1.8em; }
    .container { padding: 10px; }
    main { padding: 20px; }
}
