/* ==========================================================================
   深色主题（仅移动端生效）
   --------------------------------------------------------------------------
   - 全部深色规则集中在 @media (max-width: 900px) 内，桌面端与平板不受任何影响；
   - 通过 html[data-theme="dark"] 选择器提升优先级，可覆盖各页面行内 <style>；
   - 仅在 html 带 data-theme="dark" 时启用，缺省（无该属性）时视为浅色，页面保持原样；
   - 属性由 js/theme.js 在 <head> 内按视口宽度提前写入，避免刷新闪烁。
   ========================================================================== */

@media screen and (max-width: 900px) {
  /* ---------- 设计令牌 ---------- */
  html[data-theme="dark"] {
    --dark: #050d17; /* 原 --dark 用于深色底，深色主题下转为页面底色 */
    --light: #f2f3f5; /* 原 --light 用于浅色文字/浅色块 */
    --banner-bg: #050d17;
    --banner-text: #f2f3f5;

    --dk-bg: #050d17; /* 页面底色（渐变最深色，用于纯色场景兜底） */
    --dk-surface: rgba(10, 26, 43, 0.62); /* 区块底（半透明，透出页面渐变） */
    --dk-card: #0d2033; /* 卡片/面板 */
    --dk-line: #21405c; /* 主分隔线 */
    --dk-line-soft: #182f45; /* 次分隔线 */
    --dk-text: #f2f3f5; /* 主文字 */
    --dk-text-2: #9ea3ab; /* 次要文字 */
    --dk-text-3: #8a8f97; /* 弱化文字/图注 */
    --dk-accent: #4da3ff; /* 强调色（链接/选中） */

    color-scheme: dark;
  }

  html[data-theme="dark"] body {
    background-color: var(--dk-bg);
    background-image: radial-gradient(ellipse at 15% 10%, rgba(20, 80, 140, 0.35) 0%, rgba(6, 18, 32, 0) 55%),
      radial-gradient(ellipse at 85% 85%, rgba(0, 120, 180, 0.18) 0%, rgba(4, 12, 24, 0) 60%),
      linear-gradient(135deg, #0a1a2b 0%, #071320 45%, #050d17 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--dk-text);
  }

  /* ---------- 全局文字色映射 ---------- */
  html[data-theme="dark"] a {
    color: var(--dk-text);
  }

  html[data-theme="dark"] h1,
  html[data-theme="dark"] h2,
  html[data-theme="dark"] h3,
  html[data-theme="dark"] h4,
  html[data-theme="dark"] h5,
  html[data-theme="dark"] h6,
  html[data-theme="dark"] p,
  html[data-theme="dark"] li,
  html[data-theme="dark"] dd,
  html[data-theme="dark"] dt,
  html[data-theme="dark"] strong,
  html[data-theme="dark"] b {
    color: inherit;
  }

  /* ---------- 顶栏 ---------- */
  html[data-theme="dark"] .design-bg {
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: rgba(0, 0, 0, 0.5) 0px 2px 10px;
  }

  html[data-theme="dark"] .left-icon,
  html[data-theme="dark"] .inside-header .left-icon {
    color: var(--dk-text) !important;
  }

  html[data-theme="dark"] .search-btn,
  html[data-theme="dark"] .inside-header .search-btn {
    color: var(--dk-text) !important;
    background: var(--dk-card) !important;
    border: var(--dk-line) 1px solid !important;
  }

  html[data-theme="dark"] .search-btn:hover,
  html[data-theme="dark"] .inside-header .search-btn:hover {
    color: var(--dk-bg) !important;
    background: var(--dk-text) !important;
    border-color: var(--dk-text) !important;
  }

  html[data-theme="dark"] .search-icon,
  html[data-theme="dark"] .hamburger--emphatic,
  html[data-theme="dark"] .inside-header .hamburger--emphatic {
    color: var(--dk-text) !important;
    background: var(--dk-card) !important;
    border-color: var(--dk-line) !important;
  }

  html[data-theme="dark"] .search-icon:hover,
  html[data-theme="dark"] .hamburger--emphatic:hover,
  html[data-theme="dark"] .inside-header .hamburger--emphatic:hover {
    color: var(--dk-bg) !important;
    background: var(--dk-text) !important;
    border-color: var(--dk-text) !important;
  }

  /* 语言切换 */
  html[data-theme="dark"] .lang-btn,
  html[data-theme="dark"] .lang-split {
    color: var(--dk-text-2) !important;
  }

  html[data-theme="dark"] .lang-btn.active {
    color: var(--dk-bg) !important;
    background-color: var(--dk-text) !important;
  }

  html[data-theme="dark"] .set-color {
    color: var(--dk-text) !important;
  }

  /* ---------- 通用区块容器 ---------- */
  html[data-theme="dark"] .main_Warp,
  html[data-theme="dark"] .software-intro,
  html[data-theme="dark"] .contactUs,
  html[data-theme="dark"] .cta-section,
  html[data-theme="dark"] .mail-section,
  html[data-theme="dark"] .evaluate-summarize,
  html[data-theme="dark"] .leftpart,
  html[data-theme="dark"] .rightpart,
  html[data-theme="dark"] .productIntroduction,
  html[data-theme="dark"] .productDetail,
  html[data-theme="dark"] .capabilityOverview,
  html[data-theme="dark"] .environmental-protection,
  html[data-theme="dark"] .main-box,
  html[data-theme="dark"] .news-detail-page {
    background-color: transparent;
  }

  html[data-theme="dark"] .defense-section,
  html[data-theme="dark"] .evaluate-summarize,
  html[data-theme="dark"] .software-intro,
  html[data-theme="dark"] .p_listItem,
  html[data-theme="dark"] .contactUs,
  html[data-theme="dark"] .partners,
  html[data-theme="dark"] footer {
    /* background: var(--dk-surface);
    background-color: var(--dk-surface); */
    background-image: radial-gradient(ellipse at 15% 10%, rgba(20, 80, 140, 0.35) 0%, rgba(6, 18, 32, 0) 55%),
      radial-gradient(ellipse at 85% 85%, rgba(0, 120, 180, 0.18) 0%, rgba(4, 12, 24, 0) 60%),
      linear-gradient(135deg, #0a1a2b 0%, #071320 45%, #050d17 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
  }

  /* html[data-theme="dark"] .evaluate-summarize {
    background-color: var(--dk-surface) !important;
  } */
   
  html[data-theme="dark"] .software-intro .company-positioning {
    color: var(--dk-text);
  }

  html[data-theme="dark"] .p_listItem::before {
    border-left-color: var(--dk-surface);
    border-top-color: var(--dk-bg);
  }

  html[data-theme="dark"] .contactUs {
    border-top-color: var(--dk-line-soft);
  }

  html[data-theme="dark"] .cu_leftPart p {
    border-top-color: var(--dk-line);
  }

  /* ---------- 通用分隔线 ---------- */
  html[data-theme="dark"] .line,
  html[data-theme="dark"] .borderTop,
  html[data-theme="dark"] .rl_line::after,
  html[data-theme="dark"] .product-item .line {
    background-color: var(--dk-line);
  }

  html[data-theme="dark"] .showLine::before,
  html[data-theme="dark"] .showLine::after {
    background: var(--dk-text);
  }

  /* ---------- 标题文字描边动画（渐变裁切文字） ---------- */
  html[data-theme="dark"] .showWord span {
    background-image: linear-gradient(to right, var(--dk-text), var(--dk-text), var(--dk-text));
  }

  /* ---------- 首页轮播 ---------- */
  html[data-theme="dark"] .swiper-slide {
    background: rgba(255, 255, 255, 0.04) !important;
  }

  html[data-theme="dark"] .swiper-wrapper .swiper-slide .swiper-text-container p,
  html[data-theme="dark"] .swiper-wrapper .swiper-slide .swiper-text-container h3 {
    color: var(--dk-text) !important;
  }

  html[data-theme="dark"] .swiper-wrapper .swiper-slide .swiper-text-container svg path {
    fill: var(--dk-text) !important;
  }

  html[data-theme="dark"] .card-selector {
    background-color: var(--dk-card);
    color: var(--dk-text-2);
  }

  html[data-theme="dark"] .card-selector span {
    background: var(--dk-line);
  }

  /* ---------- 通用内容块 ---------- */
  html[data-theme="dark"] .p_itemHead,
  html[data-theme="dark"] .p_itemMid,
  html[data-theme="dark"] .product-description p,
  html[data-theme="dark"] .product-title h3,
  html[data-theme="dark"] .title-number,
  html[data-theme="dark"] .nav_content,
  html[data-theme="dark"] .nav_head,
  html[data-theme="dark"] .cur_head,
  html[data-theme="dark"] .cu_tips,
  html[data-theme="dark"] .description-number {
    color: var(--dk-text);
  }

  html[data-theme="dark"] .p_itemMid,
  html[data-theme="dark"] .cur_head {
    color: var(--dk-text-3);
  }

  html[data-theme="dark"] .cur_item:hover {
    color: var(--dk-text-2);
  }

  html[data-theme="dark"] .description-icon path,
  html[data-theme="dark"] .description-icon rect {
    fill: var(--dk-text);
  }

  /* ---------- 关于 / 招聘 / 搜索 / 菜单等深底页面 ---------- */
  html[data-theme="dark"] .search-page {
    background-color: var(--dk-bg);
    color: var(--dk-text);
  }

  html[data-theme="dark"] .search-page .design-bg {
    background-color: rgba(255, 255, 255, 0.06);
  }

  html[data-theme="dark"] .search-input {
    color: var(--dk-text);
    border-color: var(--dk-line);
    background-color: transparent;
  }

  html[data-theme="dark"] .search-input::placeholder {
    color: var(--dk-text-3);
  }

  html[data-theme="dark"] .msg-heading {
    color: var(--dk-text-3);
  }

  html[data-theme="dark"] .intro-transition a {
    color: var(--dk-text);
  }

  html[data-theme="dark"] .pageContant {
    color: var(--dk-text-2);
  }

  html[data-theme="dark"] .left-menu::before {
    background-color: var(--dk-line);
  }

  html[data-theme="dark"] .nl_item {
    color: var(--dk-text-2);
  }

  html[data-theme="dark"] .nl_item:hover {
    color: var(--dk-accent);
  }

  /* ---------- Newsroom ---------- */
  html[data-theme="dark"] .nh_item {
    color: var(--dk-text-2);
  }

  html[data-theme="dark"] .nh_item:hover {
    color: var(--dk-text);
  }

  html[data-theme="dark"] .nlTitle,
  html[data-theme="dark"] .nlMore .text {
    color: var(--dk-text);
  }

  html[data-theme="dark"] .nlMore,
  html[data-theme="dark"] .newsroom-list .main_Box {
    border-top-color: var(--dk-line);
    border-bottom-color: var(--dk-line);
  }

  html[data-theme="dark"] .nlMore:hover .text {
    color: var(--dk-text-2);
  }

  html[data-theme="dark"] .clickItem {
    color: var(--dk-text);
    border-bottom-color: var(--dk-line);
  }

  html[data-theme="dark"] .nlWarp {
    border-top-color: var(--dk-line);
  }

  /* ---------- 新闻详情 ---------- */
  html[data-theme="dark"] .news-detail-page .detail-container,
  html[data-theme="dark"] .news-detail-page .detail-top-container {
    color: var(--dk-text);
  }

  html[data-theme="dark"] .news-detail-page .detail-container p,
  html[data-theme="dark"] .news-detail-page .detail-top-container p {
    color: var(--dk-text-2);
  }

  html[data-theme="dark"] .news-detail-page .title {
    color: var(--dk-text);
  }

  /* ---------- 方案总览 capabilityOverView ---------- */
  html[data-theme="dark"] .capabilityOverview .line-code,
  html[data-theme="dark"] .capabilityOverview .solution-code,
  html[data-theme="dark"] .capabilityOverview .package-code,
  html[data-theme="dark"] .capabilityOverview .package-item-code,
  html[data-theme="dark"] .capabilityOverview .solution-name,
  html[data-theme="dark"] .capabilityOverview .package-name,
  html[data-theme="dark"] .capabilityOverview .package-item-name,
  html[data-theme="dark"] .capabilityOverview .solution-summary,
  html[data-theme="dark"] .capabilityOverview .product-name,
  html[data-theme="dark"] .capabilityOverview .overflow,
  html[data-theme="dark"] .capabilityOverview .text-animation,
  html[data-theme="dark"] .capabilityOverview .title-animation {
    color: var(--dk-text);
  }

  html[data-theme="dark"] .capabilityOverview .line-en,
  html[data-theme="dark"] .capabilityOverview .solution-en,
  html[data-theme="dark"] .capabilityOverview .package-en,
  html[data-theme="dark"] .capabilityOverview .package-item-en,
  html[data-theme="dark"] .capabilityOverview .product-en,
  html[data-theme="dark"] .capabilityOverview .desc,
  html[data-theme="dark"] .capabilityOverview .media-caption,
  html[data-theme="dark"] .capabilityOverview .item_content {
    color: var(--dk-text-2);
  }

  html[data-theme="dark"] .capabilityOverview .product-item .line,
  html[data-theme="dark"] .capabilityOverview .package-line,
  html[data-theme="dark"] .capabilityOverview .product-content2 .content-item .line {
    padding-left: 12px;
    background-color: var(--dk-line);
    border-bottom-color: var(--dk-line-soft);
  }

  /* 场景包/智能体条目：由浅色实心块改为半透明卡片，避免整屏压成深色 */}
  html[data-theme="dark"] .capabilityOverview .package-item {
    background-color: rgba(255, 255, 255, 0.04);
    border-bottom-color: var(--dk-line-soft);
  }

  /* ---------- 图片在深色下轻微压暗，避免刺眼 ---------- */
  html[data-theme="dark"] .capabilityOverview img,
  html[data-theme="dark"] .productIntroduction img,
  html[data-theme="dark"] .productDetail img,
  html[data-theme="dark"] .main-box img,
  html[data-theme="dark"] .nlBox img {
    filter: brightness(0.92) contrast(1.02);
  }
}
