/* 十大海运危险品编码详解 - 通用样式表 */
/* 适用于 imdgcode.cn 网站 */

:root {
    --primary-color: #1a5276;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #27ae60;
    --text-color: #2c3e50;
    --text-light: #5d6d7e;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--bg-light);
}

/* 容器 */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    min-height: 100vh;
}

/* 头部 */
header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin: -20px -20px 40px -20px;
    border-radius: 0 0 20px 20px;
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 15px;
    font-weight: 700;
}

header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 300;
}

/* 导航 */
.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 20px;
    transition: color 0.3s;
}

.nav-back:hover {
    color: var(--primary-color);
}

/* 主标题 */
h1 {
    font-size: 2em;
    color: var(--primary-color);
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--secondary-color);
}

/* 二级标题 */
h2 {
    font-size: 1.6em;
    color: var(--primary-color);
    margin: 35px 0 15px 0;
    padding-left: 15px;
    border-left: 4px solid var(--secondary-color);
}

/* 三级标题 */
h3 {
    font-size: 1.3em;
    color: var(--text-color);
    margin: 25px 0 12px 0;
}

/* 段落 */
p {
    margin: 15px 0;
    text-align: justify;
}

/* 引用块 - 用于重点提示 */
blockquote {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-left: 4px solid var(--warning-color);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

blockquote p {
    margin: 0;
}

/* 危险警示框 */
.danger-box {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-left: 4px solid var(--accent-color);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.danger-box strong {
    color: #721c24;
}

/* 安全提示框 */
.safe-box {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-left: 4px solid var(--success-color);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.safe-box strong {
    color: #155724;
}

/* 信息框 */
.info-box {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border-left: 4px solid var(--secondary-color);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.95em;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

tr:nth-child(even) {
    background-color: var(--bg-light);
}

tr:hover {
    background-color: #e8f4f8;
}

/* 列表 */
ul, ol {
    margin: 15px 0 15px 25px;
}

li {
    margin: 8px 0;
}

/* 代码块 */
pre {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

code {
    background-color: #edf2f7;
    color: #2d3748;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9em;
}

pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

/* 水平线 */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 40px 0;
}

/* 强调 */
strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 链接 */
a {
    color: var(--secondary-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--secondary-color);
    transition: all 0.3s;
}

a:hover {
    color: var(--primary-color);
    border-bottom-style: solid;
}

/* 复选框列表（用于检查清单） */
.checklist {
    list-style: none;
    margin-left: 0;
}

.checklist li {
    padding-left: 30px;
    position: relative;
}

.checklist li::before {
    content: "☐";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-size: 1.2em;
}

/* 案例框 */
.case-study {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: var(--shadow);
}

.case-study h4 {
    color: var(--accent-color);
    font-size: 1.2em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.case-study h4::before {
    content: "📋";
}

/* FAQ样式 */
.faq-item {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.faq-item strong {
    color: var(--secondary-color);
    display: block;
    margin-bottom: 10px;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 2px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.9em;
}

footer a {
    color: var(--text-light);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 30px 15px;
        margin: -15px -15px 30px -15px;
    }
    
    header h1 {
        font-size: 1.6em;
    }
    
    h1 {
        font-size: 1.6em;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    h3 {
        font-size: 1.1em;
    }
    
    table {
        font-size: 0.85em;
    }
    
    th, td {
        padding: 10px 12px;
    }
}

/* 打印优化 */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
        max-width: 100%;
    }
    
    header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* 索引页面特殊样式 */
.index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.index-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.index-card:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.index-card .un-number {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 10px;
}

.index-card h3 {
    margin: 10px 0;
    color: var(--primary-color);
}

.index-card p {
    color: var(--text-light);
    font-size: 0.95em;
    margin: 0;
}
