/* ============ Tokens ============ */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fc;
  --card-bg: #ffffff;
  --text: #0b1633;
  --text-2: #4b5a76;
  --text-3: #8a97b0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eef4ff;
  /* 实心蓝底（按钮、横幅）单独一套 token。深色下 --accent 要提亮才看得清文字，
     但白字压在被提亮的蓝上对比度不够，所以实心底固定用品牌蓝，两种主题都不变。 */
  --accent-solid: #2563eb;
  --accent-solid-hover: #1d4ed8;
  --line: #e6eaf2;
  --header-bg: rgba(255, 255, 255, .82);
  --glow-a: rgba(37, 99, 235, .14);
  --glow-b: rgba(37, 99, 235, .10);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, .3);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 22, 51, .06);
  --shadow-lift: 0 18px 40px rgba(11, 22, 51, .10);
  --container: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

/* 深色主题：值取自 danji-web/landing/index.html 现成的深色定义，不另造一套。
   [data-theme="dark"] 与 :root 特异性相同，靠源码顺序覆盖，必须写在 :root 之后。
   未设置 data-theme（无 JS）时本块不匹配，页面走上面的浅色 :root。 */
[data-theme="dark"] {
  --bg: #0b1120;
  --bg-alt: #0f1729;
  --card-bg: #131d33;
  --text: #e8eefc;
  --text-2: #a9b6cf;
  --text-3: #7688a8;
  --accent: #6b9cff;
  --accent-hover: #8fb4ff;
  --accent-soft: rgba(107, 156, 255, .14);
  --accent-solid: #2563eb;
  --accent-solid-hover: #1d4ed8;
  --line: #1e2a44;
  --header-bg: rgba(11, 17, 32, .82);
  --glow-a: rgba(107, 156, 255, .16);
  --glow-b: rgba(107, 156, 255, .12);
  --focus-ring: 0 0 0 3px rgba(107, 156, 255, .35);
  --shadow: 0 10px 30px rgba(0, 0, 0, .38);
  --shadow-lift: 0 18px 40px rgba(0, 0, 0, .5);
}

/* ============ Reset & base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .16s, color .16s;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: var(--accent-soft); }

/* ============ Layout primitives ============ */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head .kicker {
  display: inline-block; font-size: 13px; letter-spacing: 2px;
  color: var(--accent); font-weight: 600; text-transform: uppercase; margin-bottom: 12px;
}
.section-head .title { font-size: clamp(28px, 4vw, 40px); line-height: 1.2; }
.section-head .sub { margin-top: 14px; color: var(--text-2); font-size: 17px; }
section.section .section-head + .grid-cards,
section.section .section-head + .feat-grid { margin-top: 0; }

/* ============ Pill ============ */
.pill {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 14px; font-weight: 600; letter-spacing: 1px;
}

/* 落在深色渐变横幅上的胶囊：反白，不跟随主题 */
.pill--invert { background: rgba(255, 255, 255, .16); color: #fff; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 30px; border-radius: 999px; border: 1px solid transparent;
  font-size: 16px; font-weight: 600; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent-solid); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .25); }
.btn-primary:hover { background: var(--accent-solid-hover); color: #fff; }
.btn-ghost { border-color: var(--text); color: var(--text); background: transparent; }
/* 深色下 --text 是近白色，hover 底色跟着变白，字必须跟着翻成深色底 */
.btn-ghost:hover { background: var(--text); color: var(--bg); }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.site-header.scrolled { box-shadow: var(--shadow); }
.header-in { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { flex: 0 0 auto; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; font-size: 17px; letter-spacing: .4px; }
.brand-name small { font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: 1px; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a { padding: 8px 14px; border-radius: 999px; color: var(--text-2); font-size: 15px; font-weight: 500; }
.site-nav a:hover { color: var(--text); }
.site-nav a.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* 键盘焦点环。下拉靠 :focus-within 展开，焦点必须看得见。 */
.site-nav a:focus-visible,
.nav-toggle:focus-visible,
.theme-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ============ 导航下拉（纯 CSS，无 JS 也能展开） ============ */
.has-sub { position: relative; }
.nav-parent { display: inline-flex; align-items: center; gap: 6px; }
.nav-parent .caret { width: 12px; height: 12px; flex: 0 0 auto; transition: transform .18s ease; }
.has-sub:hover .caret, .has-sub:focus-within .caret { transform: rotate(180deg); }

/* 不能用 display:none / visibility:hidden 藏子项：那样元素不可聚焦，Tab 会直接跳过，
   :focus-within 永远不成立，键盘用户打不开下拉。只能保留可聚焦性地「视觉隐藏」。
   定位贴住父项底边（top:100%），中间不留悬停断档。 */
.site-nav .subnav {
  position: absolute; top: 100%; left: 0; z-index: 1; min-width: 250px;
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: var(--card-bg); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .16s ease;
}
.has-sub:hover .subnav,
.has-sub:focus-within .subnav { opacity: 1; pointer-events: auto; }
.site-nav .subnav a { padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--text-2); }
.site-nav .subnav a:hover { color: var(--text); background: var(--accent-soft); }

/* ============ 主题切换按钮 ============
   无 JS 时点了没用，所以只在 html.has-js 下显示。 */
.header-right { display: flex; align-items: center; gap: 6px; }
.theme-toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.has-js .theme-toggle { display: inline-flex; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.theme-toggle svg {
  width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* 浅色显示月亮（点了切到深色），深色显示太阳 */
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ============ Hero ============ */
.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 104px 0 128px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
}
.hero::before {
  width: 560px; height: 560px; top: -180px; left: 50%; transform: translateX(-70%);
  background: radial-gradient(circle, var(--glow-a), transparent 65%);
}
.hero::after {
  width: 480px; height: 480px; bottom: -200px; right: 8%; transform: translateX(30%);
  background: radial-gradient(circle, var(--glow-b), transparent 65%);
}
.hero .pill { margin-bottom: 26px; }
.hero-title {
  margin: 0 0 20px; font-size: clamp(34px, 6vw, 60px); line-height: 1.14;
  letter-spacing: 1px; font-weight: 800;
}
.hero-sub { margin: 0 auto 36px; max-width: 620px; color: var(--text-2); font-size: clamp(16px, 2vw, 19px); }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============ Cards grid ============ */
.grid-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.grid-cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cards.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: rgba(37, 99, 235, .35); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent); margin-bottom: 18px;
}
.card-title { font-size: 19px; margin-bottom: 10px; }
.card-text { color: var(--text-2); font-size: 15px; }

/* ============ DANJI band ============ */
.band {
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--accent-solid), var(--accent-solid-hover));
  color: #fff; border-radius: 22px; padding: 52px 56px;
  box-shadow: 0 22px 50px rgba(37, 99, 235, .28);
}
.band .btn-ghost { border-color: rgba(255, 255, 255, .85); color: #fff; }
.band .btn-ghost:hover { background: #fff; color: var(--accent-solid); }
.band h2 { font-size: clamp(24px, 3vw, 32px); }

/* ============ Feature grid ============ */
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.feat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.feat { border-top: 2px solid var(--line); padding-top: 18px; }
.feat h3 { font-size: 18px; margin-bottom: 8px; }
.feat p { color: var(--text-2); font-size: 15px; }

/* ============ Check list ============ */
.check-list { margin-top: 18px; }
.check-list li { position: relative; padding-left: 26px; margin-bottom: 10px; color: var(--text-2); font-size: 15px; }
.check-list li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }

/* ============ Contact ============ */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.contact-card .contact-label { font-size: 13px; color: var(--text-3); letter-spacing: 1px; margin-bottom: 8px; }
.contact-card .contact-value { font-size: 16px; font-weight: 600; color: var(--text); word-break: break-word; }

/* ============ Inner page hero ============ */
.page-hero { padding: 84px 0 60px; text-align: center; background: var(--bg-alt); }
.page-hero .page-title { font-size: clamp(30px, 5vw, 46px); line-height: 1.2; margin-bottom: 14px; }
.page-hero .page-lead { color: var(--text-2); font-size: 17px; }

/* ============ 企业 IT 服务页 ============ */
.page-hero .pill { margin-bottom: 16px; }

.feat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--bg-alt); color: var(--text-3); margin-bottom: 14px;
}

.prose { max-width: 760px; color: var(--text-2); font-size: 16px; line-height: 2; margin-bottom: 16px; }

.outsource-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 32px; }
.out-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card-bg);
  color: var(--text-2); font-size: 15px;
}
.out-item.is-us { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; font-weight: 600; }

.idea-highlight {
  max-width: 760px; margin-top: 8px; color: var(--accent);
  font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; line-height: 1.7;
}

/* ============ Footer ============ */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 44px 0; text-align: center; }
.site-footer p { color: var(--text-3); font-size: 14px; line-height: 1.9; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--accent); }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .grid-cards, .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .feat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cards.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .section { padding: 72px 0; }
  .grid-cards, .grid-cards.cols-2, .grid-cards.cols-3, .feat-grid, .feat-grid.cols-3, .contact-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px 20px 16px; display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 14px; border-radius: 10px; }
  /* 移动端 .site-nav 是绝对定位浮层，下拉必须回到文档流，否则会在浮层里再飘一层。
     这里不折叠——DANJI 作为缩进子项平铺，一次点得到。 */
  .has-sub { position: static; }
  .site-nav .subnav {
    position: static; opacity: 1; pointer-events: auto;
    min-width: 0; padding: 0; margin-top: 2px;
    background: transparent; border: 0; border-radius: 0; box-shadow: none;
  }
  .nav-parent .caret { display: none; }
  .site-nav .subnav a { padding: 12px 14px 12px 28px; font-size: 15px; }
  .band { padding: 40px 28px; }
}
@media (max-width: 560px) {
  .hero { padding: 72px 0 96px; }
  .section { padding: 60px 0; }
  .hero-actions .btn { width: 100%; }
}
