/* HRMS 系分文档 - 统一增强样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #1f2937;
  line-height: 1.7;
}
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 48px;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0,0,0,0.06);
}
/* 标题 */
h1 { font-size: 26px; font-weight: 700; color: #111827; padding-bottom: 12px; border-bottom: 3px solid #3b82f6; margin-bottom: 24px; }
h2 { font-size: 20px; font-weight: 700; color: #1e40af; margin-top: 36px; margin-bottom: 14px; padding-left: 10px; border-left: 4px solid #3b82f6; }
h3 { font-size: 16px; font-weight: 600; color: #1f2937; margin-top: 24px; margin-bottom: 10px; }
h4 { font-size: 14px; font-weight: 600; color: #374151; margin-top: 16px; margin-bottom: 8px; }
p { margin-bottom: 10px; }
ul, ol { margin-left: 22px; margin-bottom: 10px; }
li { margin-bottom: 4px; }
/* 表格 */
table { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 13.5px; }
th { background: #1e40af; color: #fff; padding: 8px 12px; text-align: left; font-weight: 600; border: 1px solid #1e40af; }
td { padding: 7px 12px; border: 1px solid #e5e7eb; vertical-align: top; }
tr:nth-child(even) td { background: #f8fafc; }
/* === 统一代码块 === */
.code-block-wrapper {
  position: relative;
  margin: 14px 0 18px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  padding: 8px 16px;
  border-bottom: 1px solid #334155;
}
.code-lang-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.code-lang-label::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: #3b82f6;
}
.code-lang-label.lang-sql::before { background: #e34c26; }
.code-lang-label.lang-json::before { background: #f7df1e; }
.code-lang-label.lang-plantuml::before { background: #8b5cf6; }
.code-lang-label.lang-text::before { background: #64748b; }
.copy-btn {
  background: #334155;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.copy-btn:hover { background: #475569; color: #fff; }
.copy-btn.copied { background: #059669; color: #fff; border-color: #059669; }
.code-block-wrapper > pre {
  margin: 0 !important;
  border-radius: 0 !important;
  background: #1e293b !important;
  color: #e2e8f0 !important;
  padding: 16px 20px !important;
  overflow-x: auto;
  font-size: 13px !important;
  line-height: 1.55 !important;
}
.code-block-wrapper > pre code {
  font-family: "Fira Code", "JetBrains Mono", "Consolas", "Source Code Pro", monospace;
  background: none !important;
  color: #e2e8f0 !important;
  padding: 0 !important;
  font-size: 13px !important;
}
/* 行内 code */
p code, li code, td code {
  font-family: "Fira Code", "JetBrains Mono", "Consolas", monospace;
  background: #eff6ff;
  color: #1e40af;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
/* 独立 pre（无 wrapper 兜底） */
pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 10px 0 16px;
  font-size: 13px;
  line-height: 1.55;
}
pre code {
  font-family: "Fira Code", "JetBrains Mono", "Consolas", "Source Code Pro", monospace;
  background: none;
  padding: 0;
  color: #e2e8f0;
}
/* === 流程图统一样式 === */
.flow-chart {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #3b82f6;
  border-radius: 10px;
  padding: 18px 22px;
  margin: 14px 0 18px;
  font-family: "Fira Code", "JetBrains Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
  color: #334155;
  position: relative;
}
.flow-chart::before {
  content: 'FLOW';
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
}
/* === PlantUML 图表容器 === */
.diagram-container {
  margin: 14px 0 18px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f5f9;
  padding: 8px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.diagram-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.diagram-title::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: #8b5cf6;
}
.diagram-toggle {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #a5b4fc;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.diagram-toggle:hover { background: #c7d2fe; }
.diagram-toggle.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.diagram-body {
  position: relative;
  background: #fff;
}
.diagram-rendered {
  padding: 20px;
  text-align: center;
  min-height: 80px;
}
.diagram-rendered img {
  max-width: 100%;
  height: auto;
}
.diagram-rendered .loading-placeholder {
  color: #94a3b8;
  font-size: 14px;
  padding: 40px 0;
}
.diagram-rendered .loading-placeholder::after {
  content: '';
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid #cbd5e1;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.diagram-source {
  display: none;
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  font-family: "Fira Code", "JetBrains Mono", "Consolas", monospace;
}
.diagram-source.visible { display: block; }
.diagram-rendered.hidden { display: none; }
.diagram-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.diagram-link {
  color: #6366f1;
  font-size: 12px;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 6px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  transition: all 0.2s;
  cursor: pointer;
}
.diagram-link:hover { background: #e0e7ff; text-decoration: none; }
.fallback-notice {
  color: #92400e;
  font-size: 13px;
  padding: 24px 20px;
  background: #fef3c7;
  border-radius: 8px;
  margin: 16px;
  text-align: center;
  line-height: 1.6;
}
.diagram-source code {
  font-family: "Fira Code", "JetBrains Mono", "Consolas", monospace;
  background: none;
  padding: 0;
  color: #e2e8f0;
}
/* 提示框 */
.note { background: #fef3c7; border-left: 4px solid #f59e0b; padding: 10px 14px; border-radius: 4px; margin: 10px 0; font-size: 14px; }
.warn { background: #fee2e2; border-left: 4px solid #ef4444; padding: 10px 14px; border-radius: 4px; margin: 10px 0; font-size: 14px; }
/* 变更记录 */
.change-log td:first-child { white-space: nowrap; }
/* 目录 */
.toc { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px 24px; margin-bottom: 28px; }
.toc h2 { border: none; margin-top: 0; }
.toc ol { margin-left: 20px; }
.toc a { color: #1e40af; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
/* 排期 */
.schedule td:last-child { white-space: nowrap; text-align: right; }
strong { color: #1e40af; }
hr { border: none; border-top: 1px solid #e5e7eb; margin: 24px 0; }
/* 响应式 */
@media (max-width: 768px) {
  .container { padding: 20px 16px; }
  table { font-size: 12px; }
}