/* ============================================================
   DSSI 官网 · HTML 静态设计稿
   全局样式 + 设计变量（唯一事实来源，改全局只改这里）
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  /* 品牌 */
  --bg:           #0a0a0a;
  --surface:      #131316;
  --surface-2:    #1a1b1f;
  --green:        #4cd94c;
  --green-dim:    rgba(76, 217, 76, .12);
  --green-line:   rgba(76, 217, 76, .35);
  --blue:         #2e7ce6;
  --blue-dim:     rgba(46, 124, 230, .12);
  --blue-line:    rgba(46, 124, 230, .35);

  /* 文字 */
  --text:         #f0f2f4;
  --text-2:       #9ba3ab;
  --text-3:       #6b7278;

  /* 线与面 */
  --border:        rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);

  /* 圆角 */
  --radius:    14px;
  --radius-sm: 10px;

  /* 尺寸 */
  --nav-h:     64px;
  --container: 1160px;

  /* 字体 */
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", SFMono-Regular, ui-monospace, "JetBrains Mono",
          "Cascadia Mono", Consolas, monospace;

  /* 动效 */
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 通用布局 ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 56px 0; }
.section--tight { padding: 36px 0; }
/* 锚点跳转落点避让粘性顶栏：跳到「动态」时标题与顶栏保持舒适间距 */
#news { scroll-margin-top: 76px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.section-head h2 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.3;
}
.section-head .section-sub {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 15px;
}
.section-head .more {
  flex: none;
  color: var(--text-2);
  font-size: 14px;
  transition: color .2s var(--ease);
}
.section-head .more:hover { color: var(--green); }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  /* 顶栏与 Hero 共用底色：置顶时全透明融入 Hero 背景，滚动后浮出毛玻璃 */
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.nav.scrolled {
  background: rgba(10, 10, 10, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: var(--border);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand .brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}
.brand .brand-full {
  margin-left: 2px;
  padding-left: 12px;
  border-left: var(--border);
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--mono);
  letter-spacing: .3px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-2);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active {
  color: var(--green);
  background: var(--green-dim);
  font-weight: 600;
}
.nav-menu-btn {
  display: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  border: var(--border);
  color: var(--text-2);
}

/* ---------- Hero（首页首屏） ---------- */
.hero {
  position: relative;
  /* 垂直留白随视口高度自适应：保证笔记本一屏内 Hero 完整落地并露出下一板块 */
  padding: clamp(48px, 8vh, 128px) 0 clamp(40px, 7vh, 112px);
  overflow: hidden;
  text-align: center;
}
/* 页面级背景光晕：从文档顶端开始渲染，贯穿透明顶栏与 Hero，形成连续底色 */
.page-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 820px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  /* 顶部大面积浅蓝氛围层：让首屏底色从纯黑提亮为深蓝调 */
  background:
    radial-gradient(1100px 480px at 50% -120px, rgba(72, 152, 240, .30), transparent 68%),
    linear-gradient(180deg, rgba(46, 124, 230, .14) 0%, rgba(46, 124, 230, .05) 45%, transparent 78%);
}
.page-glow::before, .page-glow::after {
  content: "";
  position: absolute;
  width: 620px; height: 620px;
  border-radius: 50%;
  filter: blur(170px);
}
.page-glow::before { background: var(--green); top: -240px; left: -180px; opacity: .20; }
.page-glow::after  { background: var(--blue);  top: -240px; right: -180px; opacity: .30; }
.hero-logo {
  width: clamp(64px, 9vh, 88px);
  height: clamp(64px, 9vh, 88px);
  border-radius: 22px;
  margin: 0 auto clamp(20px, 3.5vh, 36px);
  border: var(--border-strong);
  box-shadow: 0 0 60px rgba(76, 217, 76, .18), 0 0 120px rgba(46, 124, 230, .14);
}
.hero-tag {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: .5px;
  margin-bottom: clamp(18px, 3vh, 28px);
}
.hero h1 {
  /* 主标语必须单行完整显示：字号随视口宽度自动收缩 */
  font-size: max(20px, min(58px, calc((100vw - 64px) / 16)));
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  margin: 0 auto;
}
.hero h1 .em-dev  { color: var(--blue); }
.hero h1 .em-bld  { color: var(--green); }
.hero h1 .em-mix {
  background: linear-gradient(90deg, var(--green) 20%, var(--blue) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  /* 副文案三行定稿：一句一行，按语义断行，不从中间截断 */
  margin: clamp(18px, 3vh, 28px) auto 0;
  max-width: 680px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.9;
}
.hero-sub .line, .footer-note .line { display: block; }
.hero-actions {
  margin-top: clamp(26px, 4.5vh, 44px);
  display: flex;
  justify-content: center;
  gap: 16px;
}
.hero-actions .btn {
  min-width: min(300px, 100%);
  justify-content: center;
  padding-left: 44px;
  padding-right: 44px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  transition: transform .2s var(--ease), filter .2s var(--ease),
              border-color .2s var(--ease), background .2s var(--ease);
}
.btn-primary {
  background: var(--green);
  color: #062b06;
  box-shadow: 0 8px 32px rgba(76, 217, 76, .25);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
}
.btn-ghost:hover { border-color: var(--blue-line); background: var(--blue-dim); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { transform: translateY(-2px); filter: brightness(1.1); }

/* ---------- 应用卡片 ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.app-card:hover {
  border-color: var(--green-line);
  transform: translateY(-4px);
}
.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.app-icon {
  width: 60px; height: 60px;
  flex: none;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.app-icon.ic-green { background: var(--green-dim); color: var(--green); }
.app-icon.ic-blue  { background: var(--blue-dim);  color: var(--blue); }
.app-icon.ic-mix   {
  background: linear-gradient(135deg, var(--green-dim), var(--blue-dim));
  color: var(--text);
}
.app-platform {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  border: var(--border);
  border-radius: 6px;
  padding: 2px 8px;
}
.app-card h3 {
  margin-top: 18px;
  font-size: 19px;
  font-weight: 700;
}
.app-card .app-desc {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
  min-height: 72px;
}
.app-tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.tag.t-green { color: var(--green); border-color: var(--green-line); background: var(--green-dim); }
.tag.t-blue  { color: var(--blue);  border-color: var(--blue-line);  background: var(--blue-dim); }
.app-card-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-dl {
  font-size: 13px;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.app-dl::before {
  content: "";
  width: 14px; height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  background-image:
    linear-gradient(90deg, currentColor 2px, transparent 2px),
    linear-gradient(0deg, currentColor 2px, transparent 2px);
  background-size: 7px 7px;
  opacity: .8;
}
.app-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  transition: opacity .2s;
}
.app-link:hover { opacity: .8; }

/* ---------- 精选应用（单卡横排 + 二维码直接露出） ---------- */
.app-featured {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 32px;
  display: flex;
  align-items: center;
  gap: 30px;
  transition: border-color .25s var(--ease);
}
.app-featured:hover { border-color: var(--green-line); }
.app-featured .app-icon { width: 68px; height: 68px; border-radius: 17px; font-size: 26px; }
img.app-icon { display: block; object-fit: cover; flex: none; }
.app-featured .app-main { flex: 1; min-width: 0; }
.app-featured h3 { font-size: 22px; font-weight: 800; }
.app-featured .app-desc {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.75;
  /* 每行最多 30 字（中文一字一字宽），超出提行；最多 2 行，再超出截断 */
  max-width: 30em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.app-meta-line { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.app-meta-line + .app-meta-line { margin-top: 5px; }
.app-platforms { font-family: var(--mono); letter-spacing: 1px; color: var(--text); }
.app-ver { color: var(--text-2); }
.app-featured .app-changelog {
  margin-top: 7px;
  color: var(--text-3);
  font-size: 12.5px;
  /* 版本更新摘要单行，超长截断 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-featured .app-link { display: inline-block; margin-top: 14px; }
.qr-wrap {
  flex: none;
  /* 宽度随码数自适应：1 码 128px，2 码 128px 原尺寸并列（共 266px），3 码以 266px 为上限均分（约 82px/个） */
  max-width: 266px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
}
.qr-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.qr-img {
  width: 100%;
  max-width: 128px;          /* 1-2 码均为完整 128px，3 码时随容器均分缩小 */
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background-color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px var(--border-strong);
  display: block;
}
.qr-item span { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.app-dl-btn { margin-top: 16px; padding: 10px 26px; font-size: 14px; }

/* ---------- 最新动态（焦点卡 + 列表） ---------- */
.news-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
}
.news-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .25s var(--ease);
}
.news-feature:hover { border-color: var(--blue-line); }
.news-feature .ph-img {
  aspect-ratio: 16 / 8;
  background:
    radial-gradient(ellipse at 30% 20%, var(--blue-dim), transparent 60%),
    radial-gradient(ellipse at 80% 90%, var(--green-dim), transparent 55%),
    var(--surface-2);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 13px;
  font-family: var(--mono);
  letter-spacing: 2px;
}

/* 焦点图：严格 2:1，图片绝对定位填充并截断超出部分 */
.news-feature .ph-img {
  position: relative;
}

.news-feature .ph-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-feature .news-body { padding: 24px 26px; }
.news-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 10px;
}
.news-meta .tag { flex: none; }
.news-feature h3 { font-size: 20px; font-weight: 700; line-height: 1.5; }
.news-feature p {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.news-item {
  padding: 18px 0;
  border-bottom: var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-item .news-meta { margin-bottom: 4px; }
.news-item h4 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  transition: color .2s;
}
.news-item:hover h4 { color: var(--green); }

/* ---------- 动态详情页 ---------- */
.article {
  max-width: 760px;
  margin: 0 auto;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-3);
}

.article h1 {
  margin-top: 14px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.45;
}

.article-img {
  position: relative;
  aspect-ratio: 16 / 8;
  margin: 24px 0 8px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-body {
  margin-top: 20px;
}

.article-body p {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.95;
}

.article-back {
  max-width: 760px;
  margin: 8px auto 0;
}

.article-back a {
  color: var(--text-3);
  font-size: 14px;
  transition: color .2s;
}

.article-back a:hover { color: var(--green); }

/* ---------- 博客列表 ---------- */
.post-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 32px;
}
.post-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 26px 0;
  border-bottom: var(--border);
}
.post-item:last-child { border-bottom: none; }
.post-cat {
  flex: none;
  width: 64px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 0;
  border-radius: 8px;
}
.post-cat.c-tech   { color: var(--green); background: var(--green-dim); }
.post-cat.c-view   { color: var(--blue);  background: var(--blue-dim); }
.post-cat.c-prac   { color: var(--green); background: transparent; border: 1px solid var(--green-line); }
.post-cat.c-prod   { color: var(--blue);  background: transparent; border: 1px solid var(--blue-line); }
.post-cat.c-research { color: var(--text-2); background: var(--surface-2); }
.post-main { flex: 1; min-width: 0; }
.post-main h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .2s;
}
.post-item:hover .post-main h3 { color: var(--blue); }
.post-main p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-date {
  flex: none;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: var(--border);
  padding: 56px 0 40px;
  background:
    radial-gradient(ellipse at 15% 0%, var(--green-dim), transparent 50%),
    radial-gradient(ellipse at 85% 0%, var(--blue-dim), transparent 50%);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.footer-brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer-brand span { font-weight: 800; letter-spacing: 1px; }

/* 页脚形象展示区（居中：Logo + 全称胶囊） */
.footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.footer-center .footer-brand { margin-bottom: 0; }
.footer-tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: .5px;
}
.footer-note {
  margin: 16px 0 0;
  max-width: 640px;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1.9;
}
.footer-desc {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.8;
  max-width: 300px;
}
.footer h5 {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.footer-links a {
  display: block;
  color: var(--text-2);
  font-size: 14px;
  padding: 4px 0;
  transition: color .2s;
}
.footer-links a:hover { color: var(--green); }
.footer-bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: var(--border);
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--text-3);
  font-size: 13px;
  flex-wrap: wrap;
}

.footer-bottom a {
  color: var(--text-3);
  transition: color .2s;
}

.footer-bottom a:hover { color: var(--text-2); }

/* ---------- 子页 Hero ---------- */
.page-hero {
  padding: 72px 0 48px;
  border-bottom: var(--border);
  background:
    radial-gradient(ellipse at 20% 0%, var(--green-dim), transparent 55%),
    radial-gradient(ellipse at 85% 20%, var(--blue-dim), transparent 55%);
}
.page-hero h1 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: .5px;
}
.page-hero p {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 15.5px;
  max-width: 640px;
}

/* ---------- 占位说明（设计稿阶段标记） ---------- */
.draft-note {
  margin: 48px auto;
  padding: 28px 32px;
  max-width: 720px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 14px;
  text-align: center;
}
.draft-note strong { color: var(--green); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-full { display: none; }
  .nav-links { display: none; }
  .nav-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .section { padding: 44px 0; }
  .hero { padding: 88px 0 80px; }
  .app-featured { flex-direction: column; align-items: flex-start; gap: 20px; }
}
@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
  .app-card .app-desc { min-height: 0; }
  .post-item { gap: 14px; }
  .post-cat { width: 52px; font-size: 11px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
