@layer reset, base, layout, parts, responsive, motion;

@font-face { font-family: "JD Brush"; src: url(/fonts/title.woff2?h=73523df0) format("woff2"); font-display: swap; }

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
  ol, ul { padding: 0; list-style: none; }
  img, picture { display: block; max-width: 100%; }
  img { height: auto; }
  button { font: inherit; color: inherit; cursor: pointer; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    --ink: #151312;
    --ink-2: #201c1a;
    --ink-3: #2c2623;
    --washi: #ece3cf;
    --washi-2: rgb(236 227 207 / .7);
    --line: rgb(236 227 207 / .14);
    --shu: #c8372d;
    --lantern: #f0b04a;
    --police: #1f3554;
    --police-2: #182a44;
    --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
    --brush: "JD Brush", "KaiTi", "STKaiti", serif;
    color-scheme: dark;
    scroll-padding-top: 72px;
  }
  html { background: var(--ink); }
  body { font: 16px/1.8 var(--sans); color: var(--washi); background: var(--ink); -webkit-font-smoothing: antialiased; text-wrap: pretty; }
  h1, h2, h3 { line-height: 1.2; font-weight: 400; text-wrap: balance; }
  .t { font-family: var(--brush); letter-spacing: .02em; }
  a { color: inherit; }
  :focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; border-radius: 3px; }
  .skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 8px 14px; background: var(--lantern); color: var(--ink); border-radius: 4px; }
  .skip:focus { left: 12px; }
}

@layer layout {
  .wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }
  main > section { padding-block: clamp(64px, 8vw, 112px); }
  main > .hero { padding: 0; }
  h2.t { font-size: clamp(44px, 5.4vw, 66px); color: var(--washi); }
  .sub { margin-top: 10px; color: var(--washi-2); }
}

@layer parts {
  .bar { position: fixed; inset: 0 0 auto; z-index: 30; display: flex; align-items: center; gap: 26px; height: 60px; padding-inline: max(24px, (100% - 1120px) / 2);
    background: rgb(21 19 18 / .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .brand { font-size: 30px; text-decoration: none; }
  .bar nav { display: flex; gap: 20px; margin-left: auto; font-size: 14px; }
  .bar nav a { text-decoration: none; color: var(--washi-2); }
  .bar nav a:hover { color: var(--washi); }
  .pill { border: 0; border-radius: 4px; padding: 7px 16px; font-size: 14px; font-weight: 700; background: var(--shu); color: #fff; }

  /* 首屏: 夜街 + 竖排大字 */
  .hero { position: relative; min-height: max(660px, 100svh); overflow: hidden; isolation: isolate; display: grid; align-items: center; }
  .street { position: absolute; inset: 0; z-index: -1; }
  .street picture, .street img { width: 100%; height: 100%; object-fit: cover; }
  .street::after { content: ""; position: absolute; inset: 0;
    background: radial-gradient(30% 40% at 18% 30%, rgb(240 176 74 / .18), transparent 70%), linear-gradient(0deg, var(--ink) 2%, rgb(21 19 18 / .55) 45%, rgb(21 19 18 / .75)); }
  .hero-in { width: min(1120px, 100% - 48px); margin-inline: auto; padding: 100px 0 64px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(28px, 6vw, 90px); align-items: center; }
  .ink { writing-mode: vertical-rl; font-size: clamp(110px, 17vh, 190px); line-height: .95; color: var(--washi); text-shadow: 0 6px 40px rgb(0 0 0 / .6); }
  .ex-name { display: flex; align-items: baseline; gap: 14px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; color: var(--washi); }
  .ex-name .t { font-size: clamp(54px, 6vw, 80px); line-height: 1; color: var(--shu); font-weight: 400; }
  .en { color: var(--washi-2); font-size: 14px; letter-spacing: .04em; }
  .officer { width: min(460px, 100%); margin-top: 18px; border-radius: 6px; overflow: hidden; box-shadow: 0 18px 40px rgb(0 0 0 / .5), 0 0 0 1px var(--line); }
  .officer img { width: 100%; }
  .lead { margin-top: 16px; max-width: 30em; font-size: 17px; }
  .card { display: grid; grid-template-columns: repeat(4, auto); width: fit-content; margin-top: 18px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
  .card div { padding: 10px 16px; border-left: 1px solid var(--line); background: rgb(21 19 18 / .55); }
  .card div:first-child { border-left: 0; }
  .card dt { font-size: 12px; color: var(--washi-2); }
  .card dd { font-weight: 700; }
  .cta { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
  .dl-btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; padding: 14px 32px; font-size: 17px; font-weight: 700;
    letter-spacing: .08em; background: var(--shu); color: #fff; text-decoration: none; box-shadow: 0 10px 30px rgb(200 55 45 / .35); }
  .dl-btn:hover { background: #d9463b; }
  .ghost { display: inline-flex; align-items: center; border: 1px solid rgb(236 227 207 / .35); border-radius: 6px; padding: 12px 20px; font-size: 15px;
    text-decoration: none; background: rgb(21 19 18 / .4); }
  .ghost:hover { border-color: var(--washi); }

  /* EX */
  .ex-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 50px; align-items: center; margin-top: 26px; }
  .ex-text p { margin-top: 14px; font-size: 17px; }
  .credit { margin-top: 24px; display: grid; gap: 4px; font-size: 14px; color: var(--washi-2); }
  .credit div { display: grid; grid-template-columns: 100px 1fr; }
  .credit dd { color: var(--washi); }
  .frame { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--ink-2); }
  .frame figcaption { padding: 10px 14px; font-size: 13px; color: var(--washi-2); }

  /* 巡逻考核表 */
  .patrol { background: linear-gradient(180deg, var(--police), var(--police-2)); }
  .log { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; }
  .log li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; padding: 20px; border-radius: 8px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12); }
  .stamp-day { display: grid; place-items: center; height: 34px; border-radius: 4px; background: var(--washi); color: var(--police); font-weight: 800; font-size: 14px; letter-spacing: .1em; }
  .log h3 { font-size: 19px; margin-bottom: 4px; }
  .log p { color: var(--washi-2); font-size: 15px; }

  /* 系列 */
  .works { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; }
  .work { display: grid; gap: 14px; align-content: start; padding: 24px; border-radius: 10px; background: var(--ink-2); border: 1px solid var(--line); }
  .work.now { border-color: rgb(200 55 45 / .6); box-shadow: inset 0 3px 0 var(--shu); }
  .work-tag { font-size: 13px; color: var(--lantern); }
  .work h3 { font-size: 40px; }
  .work p { color: var(--washi-2); }
  .work-pic { border-radius: 6px; overflow: hidden; }

  /* 画面 */
  .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 16px; margin-top: 28px; }
  .grid .wide { grid-column: span 2; }
  .shot { display: block; width: 100%; border: 0; padding: 0; background: none; text-align: left; }
  .shot picture { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; border: 1px solid var(--line); }
  .shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
  .shot:hover img { transform: scale(1.03); }
  .cap { display: block; margin-top: 8px; font-size: 14px; color: var(--washi-2); }

  /* 配置 */
  .spec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 24px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
  .spec div { padding: 16px 18px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .spec div:nth-child(3n + 1) { border-left: 0; }
  .spec div:nth-child(-n + 3) { border-top: 0; }
  .spec dt { font-size: 13px; color: var(--lantern); }
  .spec dd { margin-top: 4px; font-weight: 600; }

  /* 安装 */
  .setup { background: var(--ink-2); }
  .setup-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; align-items: start; }
  .steps { counter-reset: s; display: grid; gap: 14px; margin-top: 26px; }
  .steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
  .steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center; font-weight: 800; background: var(--shu); color: #fff; }
  .file { padding: 24px; border-radius: 10px; background: var(--ink-3); border: 1px solid var(--line); }
  .file h3 { font-size: 34px; margin-bottom: 4px; }
  .file dl div { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
  .file dt { color: var(--washi-2); }
  .file dd { font-weight: 600; overflow-wrap: anywhere; }
  .file code { font: 500 13px/1.6 ui-monospace, Menlo, Consolas, monospace; }
  .file-act { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
  .fine { margin-top: 12px; font-size: 13px; color: var(--washi-2); }

  /* 问答 */
  .qa { display: grid; margin-top: 24px; max-width: 840px; border-top: 1px solid var(--line); }
  .qa details { border-bottom: 1px solid var(--line); }
  .qa summary { cursor: pointer; list-style: none; padding: 17px 40px 17px 0; position: relative; font-weight: 600; }
  .qa summary::-webkit-details-marker { display: none; }
  .qa summary::after { content: "+"; position: absolute; right: 6px; top: 50%; translate: 0 -50%; font-size: 24px; color: var(--shu); transition: rotate .25s; }
  .qa details[open] summary::after { rotate: 45deg; }
  .qa p { padding: 0 0 18px; color: var(--washi-2); }

  /* 页脚 */
  .foot { padding: 52px 0 70px; background: #0e0c0b; border-top: 1px solid var(--line); color: var(--washi-2); font-size: 14px; }
  .foot-title { font-size: 44px; color: var(--washi); margin-bottom: 6px; }
  .links { display: flex; gap: 20px; margin-top: 8px; }

  /* 弹窗 */
  dialog { border: 0; padding: 0; color: var(--washi); }
  dialog::backdrop { background: rgb(0 0 0 / .75); backdrop-filter: blur(4px); }
  .x { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 4px; background: rgb(255 255 255 / .08); font-size: 22px; line-height: 1; }
  .dlg { width: min(440px, 100% - 32px); padding: 30px 28px 28px; border-radius: 10px; background: var(--ink-3); border: 1px solid var(--line); text-align: center; }
  .dlg h2 { font-size: 44px; }
  .dlg-file { margin: 6px 0 18px; color: var(--washi-2); font-size: 14px; }
  #ts-box { min-height: 70px; display: grid; place-items: center; }
  #dl-status { margin-top: 14px; font-size: 15px; }
  #dl-link { margin-top: 16px; }
  .lb { width: min(1280px, 100% - 24px); max-height: calc(100svh - 24px); padding: 0; background: transparent; overflow: visible; }
  .lb picture img { width: 100%; height: auto; max-height: calc(100svh - 120px); object-fit: contain; border-radius: 8px; background: #000; }
  #lb-cap { margin-top: 12px; text-align: center; }
  .lb-nav { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 10px; color: var(--washi-2); }
  .lb-nav button { width: 40px; height: 40px; border-radius: 4px; border: 1px solid var(--line); background: rgb(255 255 255 / .06); color: #fff; font-size: 22px; }
  .lb .x { top: -46px; right: 0; }

  /* 隐私 / 条款 / 404 */
  .doc { max-width: 720px; padding-block: 96px 80px; }
  .doc h1 { font-size: clamp(44px, 7vw, 60px); margin: 18px 0 26px; }
  .doc h2 { font-size: 20px; margin: 30px 0 8px; }
  .doc p { margin-top: 10px; color: var(--washi-2); }
  .doc .dl-btn { margin-top: 18px; }
  .doc .date { margin-top: 36px; font-size: 14px; }
  .back { color: var(--washi-2); text-decoration: none; }
}

@layer responsive {
  @media (max-width: 1000px) {
    .bar nav { display: none; }
    .bar .pill { margin-left: auto; }
    .ex-grid, .setup-grid, .works { grid-template-columns: 1fr; }
    .log { grid-template-columns: 1fr; }
  }
  @media (max-width: 760px) {
    .hero-in { grid-template-columns: 1fr; gap: 10px; padding-top: 84px; }
    .ink { writing-mode: horizontal-tb; font-size: clamp(64px, 19vw, 96px); }
    .card { grid-template-columns: 1fr 1fr; }
    .card div:nth-child(3) { border-left: 0; }
    .card div:nth-child(n + 3) { border-top: 1px solid var(--line); }
    .grid { grid-template-columns: 1fr; }
    .grid .wide { grid-column: auto; }
    .spec { grid-template-columns: 1fr 1fr; }
    .spec div { border-left: 1px solid var(--line) !important; border-top: 1px solid var(--line) !important; }
    .spec div:nth-child(odd) { border-left: 0 !important; }
    .spec div:nth-child(-n + 2) { border-top: 0 !important; }
  }
  @media (max-width: 520px) {
    .wrap, .hero-in { width: calc(100% - 36px); }
    .dl-btn { flex: 1; }
    .log li { grid-template-columns: 1fr; gap: 10px; }
    .stamp-day { width: 64px; }
  }
}

@layer motion {
  @media (prefers-reduced-motion: no-preference) {
    .ink { animation: brush 1.6s cubic-bezier(.2, .7, .2, 1) both; }
    @keyframes brush { from { clip-path: inset(0 0 100% 0); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
    .hero-side { animation: fade 1s .8s ease-out both; }
    @keyframes fade { from { opacity: 0; translate: 0 14px; } }
    .qa details::details-content { block-size: 0; overflow: hidden; transition: block-size .3s, content-visibility .3s allow-discrete; }
    .qa details[open]::details-content { block-size: auto; }
    :root { interpolate-size: allow-keywords; }
    dialog[open] { animation: pop .25s ease-out; }
    @keyframes pop { from { opacity: 0; scale: .97; } }
  }
}
