/* ASC 脚本写作大全（guide-asc.html）专属样式。页面由 build/asc-guide/build_page.py 生成，不要手改 html。
   布局：顶部标题 + 吸顶搜索条；左侧目录（手机上变成横向滚动的分类条）；右侧正文：语法、命令卡片、对照表。 */
.asc-page { position: relative; z-index: 1; flex: 1; width: min(100% - 32px, 1240px); margin: 0 auto 48px; }

.asc-hero { margin: 26px 0 18px; padding: 26px 30px 22px; border: 2px solid var(--line); border-radius: var(--radius-xl);
  background: var(--paper); box-shadow: var(--shadow-hard); }
.asc-eyebrow { margin: 0 0 6px; color: var(--orange-deep); font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.asc-hero h1 { margin: 0; font-family: var(--font-title); font-size: clamp(28px, 4vw, 40px); font-weight: 400; color: var(--leaf); }
.asc-lead { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.asc-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.asc-badges li { padding: 4px 12px; border-radius: 999px; background: #eef7e9; color: var(--leaf); font-size: 13px; font-weight: 600; }
.asc-badges li.warn { background: #fff1dc; color: var(--orange-deep); }

/* 吸顶搜索条 */
.asc-search { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; margin: 0 0 18px;
  padding: 10px 14px; border: 2px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 253, 247, .96);
  box-shadow: 0 6px 18px -12px rgba(90, 52, 23, .5); backdrop-filter: blur(6px); }
.asc-search input { flex: 1; min-width: 0; padding: 9px 14px; border: 2px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); font: inherit; font-size: 15px; outline: none; }
.asc-search input:focus { border-color: var(--orange); }
.asc-search .count { flex: none; color: var(--muted); font-size: 13px; white-space: nowrap; }
.asc-search kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: #fff; font-size: 12px; }

.asc-layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 22px; align-items: start; }

/* 左侧目录 */
.asc-toc { position: sticky; top: 74px; max-height: calc(100vh - 92px); overflow: auto; padding: 14px 10px 14px 14px;
  border: 2px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); font-size: 14px; }
.asc-toc h2 { margin: 0 0 8px; color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.asc-toc ol { margin: 0; padding: 0; list-style: none; }
.asc-toc li a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; line-height: 1.35; }
.asc-toc li a:hover { background: #fff1dc; }
.asc-toc li a.on { background: var(--leaf); color: #fff; }
.asc-toc li li a { padding-left: 22px; color: var(--muted); font-size: 13px; }
.asc-toc li li a.on { color: #fff; }

/* 正文 */
.asc-main { min-width: 0; }
.asc-sec { margin: 0 0 22px; padding: 22px 26px; border: 2px solid var(--line); border-radius: var(--radius-lg); background: var(--paper);
  box-shadow: 0 4px 0 rgba(90, 52, 23, .06); scroll-margin-top: 74px; }
.asc-sec > h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 12px; font-family: var(--font-title); font-weight: 400;
  font-size: 26px; color: var(--leaf); }
.asc-sec > h2 small { font-family: var(--font-body); font-size: 13px; color: var(--muted); }
.asc-sec h3 { margin: 20px 0 8px; font-size: 17px; color: var(--ink); scroll-margin-top: 74px; }
.asc-sec p, .asc-sec li { font-size: 15px; line-height: 1.75; }
.asc-sec p { margin: 6px 0; }
.asc-sec ul.dots { margin: 6px 0; padding-left: 20px; }
.asc-note { margin: 10px 0; padding: 10px 14px; border-left: 4px solid var(--blue); border-radius: 8px; background: #eef6ff; font-size: 14px; }
.asc-warn { margin: 10px 0; padding: 10px 14px; border-left: 4px solid var(--orange); border-radius: 8px; background: #fff3e2; font-size: 14px; }
.asc-ext { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 6px; background: #f3ecff; color: #6a4bc9; font-size: 12px;
  font-weight: 700; vertical-align: middle; }

code, .mono { font-family: Consolas, "Cascadia Mono", "Courier New", "Microsoft YaHei UI", monospace; }
.asc-sec code { padding: 1px 6px; border-radius: 5px; background: #f4efe2; color: #8a3b12; font-size: .92em; }

/* 代码块 */
.code { position: relative; margin: 8px 0 12px; }
.code pre { margin: 0; padding: 12px 16px; overflow-x: auto; border-radius: 12px; background: #2b2a26; color: #f5ecd7; font-size: 14px;
  line-height: 1.65; white-space: pre; tab-size: 4; }
.code pre .c { color: #9a9483; }      /* 注释 */
.code pre .k { color: #ffcf6a; }      /* 命令名 */
.code pre .l { color: #8fd18a; }      /* 标签 */
.code pre .v { color: #8cc8ff; }      /* @变量 */
.code .copy { position: absolute; top: 8px; right: 8px; padding: 3px 10px; border: 0; border-radius: 7px; background: rgba(255, 255, 255, .14);
  color: #f5ecd7; font: inherit; font-size: 12px; cursor: pointer; opacity: .75; }
.code .copy:hover { opacity: 1; background: rgba(255, 255, 255, .24); }
.code .copy.done { background: var(--leaf); opacity: 1; }

/* 表格 */
.tbl { width: 100%; margin: 8px 0 12px; overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.6; }
.tbl th { position: sticky; top: 0; background: #f7f0de; color: var(--ink); font-weight: 700; white-space: nowrap; }
.tbl tr:hover td { background: #fffaf0; }
.tbl td.nw, .tbl td:first-child { white-space: nowrap; }
.tbl td code { white-space: nowrap; }
/* CHECK 大全：对象、字段两列在“ / ”处换行，说明列占剩余宽度 */
.tbl.chk td:first-child { white-space: normal; width: 9em; }
.tbl.chk td:first-child code { white-space: normal; }
.tbl.chk td:nth-child(2) { width: 9.5em; }
.tbl.chk td:nth-child(3) { white-space: nowrap; }
/* 速查表：分类不换行 */
.tbl.qk td:nth-child(2) { white-space: nowrap; color: var(--muted); }
.tbl a { color: var(--leaf); font-weight: 700; text-decoration: none; }
.tbl a:hover { text-decoration: underline; }

/* 命令卡片 */
.cmd { margin: 14px 0; padding: 16px 18px; border: 2px solid #eee4cf; border-radius: 16px; background: #fff; scroll-margin-top: 74px; }
.cmd:target { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 155, 47, .18); }
.cmd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.cmd-head h3 { margin: 0; font-family: Consolas, "Cascadia Mono", monospace; font-size: 19px; color: #8a3b12; }
.cmd-head .alias { color: var(--muted); font-size: 13px; }
.tag { padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.tag.quick { background: #e6f5ea; color: var(--leaf); }
.tag.act { background: #e9f2ff; color: #2563b8; }
.tag.wait { background: #fff1dc; color: var(--orange-deep); }
.tag.ext { background: #f3ecff; color: #6a4bc9; }
.cmd-sum { margin: 0 0 6px; font-size: 15px; }
.cmd dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; font-size: 14px; }
.cmd dt { color: #8a3b12; font-weight: 700; font-family: Consolas, "Cascadia Mono", "Microsoft YaHei UI", monospace; white-space: nowrap; }
.cmd dd { margin: 0; line-height: 1.65; }
.cmd .tips { margin: 6px 0 0; padding-left: 18px; color: #6b5a3c; font-size: 14px; }
.cmd .tips li { line-height: 1.7; }

.hit { background: #ffe58f; border-radius: 3px; }
/* 搜索中：每节只留大标题、命中的块与表格、以及有命中内容的小标题 */
.asc-main.searching .asc-sec > :not(h2):not([data-s]):not(.tbl):not(h3.keep) { display: none; }
.asc-empty { padding: 40px 10px; text-align: center; color: var(--muted); }

.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: none; width: 44px; height: 44px; border: 2px solid var(--line);
  border-radius: 50%; background: var(--paper); color: var(--leaf); font-size: 20px; line-height: 40px; text-align: center; text-decoration: none;
  box-shadow: var(--shadow-hard); }
.to-top.show { display: block; }

@media (max-width: 900px) {
  .asc-layout { grid-template-columns: minmax(0, 1fr); }
  .asc-toc { position: static; max-height: none; padding: 8px; overflow-x: auto; }
  .asc-toc h2 { display: none; }
  .asc-toc > ol { display: flex; gap: 6px; width: max-content; }
  .asc-toc > ol > li > ol { display: none; }
  .asc-toc li a { white-space: nowrap; background: #fff8ea; }
  .asc-sec { padding: 18px 16px; }
  .asc-hero { padding: 20px 18px; }
  .cmd { padding: 14px 12px; }
  .cmd dl { grid-template-columns: 1fr; gap: 2px; }
  .cmd dt { margin-top: 6px; }
  .asc-search .count { display: none; }
  .asc-search kbd { display: none; }
  .tbl td code { white-space: normal; word-break: break-all; }
  .tbl td.nw, .tbl td:first-child { white-space: normal; }
  .tbl td:first-child code { white-space: nowrap; }
  .code .copy { position: static; display: block; margin: 0 0 4px auto; background: #4a463d; }
}
@media (hover: hover) and (pointer: fine) {
  .cmd { transition: border-color .15s; }
  .cmd:hover { border-color: #e2cfa8; }
}
