/*
 * 智慧同城 · 操作手册 —— 视觉与「租户运营后台」一致
 *
 * 侧栏照抄后台的双列菜单（tmp_frontend/src/styles/index.css 的 .side-menu-*）：
 *   一级 168px / #1f2d3d，二级 148px / #18232f，行高 42 / 38，
 *   选中 #243447 + 3px 蓝色左条 #409eff，首字图标 22×22。
 * 内容区沿用后台的卡片风格：底 #f8f9fb、白卡 + 1px #edeef0、标题 16px 带橙色竖条。
 */
:root {
  --primary: #ff5200;
  --primary-weak: rgba(255, 82, 0, .10);
  --bg: #f8f9fb;
  --card: #fff;
  --border: #edeef0;
  --text: #333;
  --text-2: #666;
  --text-3: #999;
  --hd-h: 60px;

  /* 双列侧栏（与后台一致） */
  --l1-w: 168px;
  --l2-w: 148px;
  --side-w: 316px;
  --l1-bg: #1f2d3d;
  --l2-bg: #18232f;
  --l2-line: #2b3a4d;
  --item-hover: #243447;
  --item-text: #c0c8d3;
  --item-sub-text: #a9b4c2;
  --accent: #409eff;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.8 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 顶栏 ---------------- */
.hd {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--hd-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  background: #fff;
  border-bottom: 1px solid #ebeef5;
  z-index: 20;
}

.brand {
  width: var(--side-w);          /* 与侧栏总宽对齐（后台即此结构） */
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
}

.logo {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-text {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hd-right {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 13px;
}

.hd-tip { margin-right: 6px; }

.hd-link {
  padding: 5px 12px;
  border: 1px solid rgba(255, 82, 0, .35);
  border-radius: 4px;
  color: var(--primary);
  background: var(--primary-weak);
  font-size: 13px;
}
.hd-link:hover { background: rgba(255, 82, 0, .16); text-decoration: none; }

/* ---------------- 双列侧栏 ---------------- */
.body { min-height: 100%; padding-top: var(--hd-h); }

.side {
  position: fixed;
  top: var(--hd-h);
  bottom: 0;
  left: 0;
  width: var(--side-w);
  z-index: 10;
}

.side-menu { display: flex; height: 100%; }

.side-menu-col {
  padding: 6px 0;
  margin: 0;
  list-style: none;
  overflow-y: auto;
}

/* 一级：固定 168px */
.side-menu-l1 {
  flex: none;
  width: var(--l1-w);
  background: var(--l1-bg);
}

/* 二级：随一级切换（隐藏原生滚动条，与后台一致） */
.side-menu-l2 {
  flex: none;
  width: var(--l2-w);
  background: var(--l2-bg);
  border-left: 1px solid var(--l2-line);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.side-menu-l2::-webkit-scrollbar { width: 0; height: 0; }

/* 搜索框（放在二级列顶部，不破坏两列格局） */
.search-wrap { padding: 8px 10px 6px; }

#q {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #33465c;
  border-radius: 4px;
  background: #141d27;
  color: #dfe6ee;
  font-size: 12px;
  outline: none;
}
#q::placeholder { color: #6c7c8f; }
#q:focus { border-color: var(--accent); }

/* 菜单项 */
.side-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--item-text);
  cursor: pointer;
  user-select: none;
}

.side-menu-item:hover { color: #fff; background: var(--item-hover); }

.side-menu-item.is-active {
  color: #fff;
  background: var(--item-hover);
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-menu-mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  color: #9fb0c4;
}

.side-menu-item.is-active .side-menu-mark { background: var(--accent); color: #fff; }

.side-menu-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.side-menu-arrow {
  flex: none;
  font-size: 13px;
  color: #5d6b7c;
  transition: transform .18s ease;
}
.side-menu-item.is-active .side-menu-arrow { color: var(--accent); transform: rotate(90deg); }

/* 二级项 */
.l2-list { margin: 0; padding: 0 0 8px; list-style: none; }

.l2-list li > a {
  display: block;
  height: 38px;
  line-height: 38px;
  padding: 0 12px 0 16px;
  font-size: 13px;
  color: var(--item-sub-text);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.l2-list li > a:hover { color: #fff; background: var(--l1-bg); }

.l2-list li > a.is-active { color: var(--accent); background: var(--l1-bg); }

/* 搜索结果里的分组小标签 */
.l2-group { display: block; padding: 8px 12px 2px; font-size: 11px; color: #6c7c8f; letter-spacing: .5px; }

.l2-none { padding: 14px 12px; font-size: 12px; color: #6c7c8f; }

/* ---------------- 内容区 ---------------- */
.main {
  margin-left: var(--side-w);
  padding: 18px 24px 40px;
  min-width: 0;
}

.crumb {
  max-width: 980px;
  margin: 0 auto 10px;
  color: var(--text-3);
  font-size: 13px;
}
.crumb b { color: var(--text-2); font-weight: 600; }

.doc {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 32px 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.doc h1 { margin: 0 0 18px; font-size: 20px; font-weight: 700; color: #222; }

.doc h2 {
  position: relative;
  margin: 30px 0 12px;
  padding-left: 11px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}
.doc h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 2px;
  height: 16px;
  background: var(--primary);
  border-radius: 1px;
}
.doc h2:first-of-type { margin-top: 6px; }

.doc h3 { margin: 20px 0 8px; font-size: 14px; font-weight: 700; color: #444; }

.doc p { margin: 8px 0; }
.doc ul, .doc ol { margin: 8px 0; padding-left: 22px; }
.doc li { margin: 4px 0; }

.doc blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--primary);
  background: #fff8f4;
  color: var(--text-2);
  border-radius: 2px;
}
.doc blockquote p { margin: 4px 0; }

.doc code {
  padding: 1px 5px;
  border-radius: 3px;
  background: #f5f6f8;
  border: 1px solid #eceded;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #c7254e;
}

.doc pre {
  margin: 12px 0;
  padding: 12px 14px;
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-x: auto;
}
.doc pre code { padding: 0; border: 0; background: none; color: var(--text); }

.doc table { width: 100%; margin: 12px 0; border-collapse: collapse; font-size: 13px; }
.doc th, .doc td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.doc th { background: #fafbfc; font-weight: 700; color: var(--text-2); }

.doc hr { margin: 22px 0; border: 0; border-top: 1px solid var(--border); }

.doc .tag {
  display: inline-block;
  margin: 0 4px;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 12px;
  line-height: 18px;
  background: #f2f3f5;
  color: var(--text-2);
  vertical-align: 1px;
}
.doc .tag.warn { background: #fff4e6; color: #d46b08; }
.doc .tag.todo { background: #f1f1f1; color: #888; }

.loading { color: var(--text-3); }

.foot {
  max-width: 980px;
  margin: 18px auto 0;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.9;
  text-align: center;
}

.doc mark { background: #fff1b8; color: inherit; padding: 0 1px; }

/* ---------------- 手机端：一级变横向条，二级在下方 ---------------- */
@media (max-width: 900px) {
  .brand { width: auto; }
  .side { position: static; width: 100%; height: auto; }
  .body { display: block; }
  .side-menu { display: block; height: auto; }
  .side-menu-l1 {
    display: flex;
    width: 100%;
    overflow-x: auto;
    padding: 0;
    scrollbar-width: none;
  }
  .side-menu-l1::-webkit-scrollbar { height: 0; }
  .side-menu-l1 .side-menu-item { flex: none; height: 42px; padding: 0 10px; }
  .side-menu-l1 .side-menu-text { max-width: 84px; }
  .side-menu-l1 .side-menu-arrow { display: none; }
  .side-menu-l2 { width: 100%; border-left: 0; max-height: 42vh; }
  .main { margin-left: 0; padding: 14px 12px 32px; }
  .doc { padding: 18px 16px 24px; }
}
