/**
 * 千五网络 · 官网首页样式
 *
 * 设计规范来自 Vercel 风格（黑白墨色 + 大面积留白 + 顶部一处多色网格渐变），
 * 具体取值见项目根目录 DESIGN 说明：
 *   - 主色（墨色）#171717：标题、主要按钮
 *   - 页面底色 #fafafa，卡片纯白 #ffffff，分隔线 #ebebeb
 *   - 正文 #4d4d4d，弱化文字 #6f6f6f
 *   - 渐变是本页唯一的装饰，只出现在首屏顶部，色标不拆分、不缩小
 *   - 等宽字体只用于「技术层」：字段名、代码、IP、时间
 */

/* ------------------------------ 设计变量 ------------------------------ */
:root {
  --ink: #171717;
  --body: #4d4d4d;
  --mute: #6f6f6f;
  --hairline: #ebebeb;
  --hairline-strong: #a1a1a1;
  --canvas: #ffffff;
  --canvas-soft: #fafafa;
  --canvas-soft-2: #f5f5f5;
  --link: #0070f3;

  /* 品牌渐变三组色标（首屏网格渐变用，整体使用，不拆色） */
  --g-develop-a: #007cf0;
  --g-develop-b: #00dfd8;
  --g-preview-a: #7928ca;
  --g-preview-b: #ff0080;
  --g-ship-a: #ff4d4d;
  --g-ship-b: #f9cb28;

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 100px;

  /* 叠层阴影：小偏移多层叠加 + 内描边，不用单层大模糊 */
  --shadow-2: 0 1px 1px rgba(0, 0, 0, 0.02), 0 2px 2px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.06) inset;
  --shadow-3: 0 2px 2px rgba(0, 0, 0, 0.04), 0 8px 8px -8px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.07) inset;
  --shadow-4: 0 2px 2px rgba(0, 0, 0, 0.04), 0 8px 16px -4px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.07) inset;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --nav-h: 64px;
  --page: 1200px;
}

/* ------------------------------ 基础 ------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 锚点跳转时给顶部导航留出空间 */
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--canvas-soft);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 浏览器自带的那些「没画过」的地方，也按这套配色来 */
::selection {
  background: var(--ink);
  color: #f2f2f2;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

input,
button {
  caret-color: var(--ink);
  font-family: inherit;
}

/* 滚动条（Webkit）跟随配色，避免一条系统蓝 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: #dcdcdc;
  border: 2px solid var(--canvas-soft);
  border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--hairline-strong);
}

a {
  color: var(--ink);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}

/* 等宽小标签：只给「数据」用（时间和 IP 这类），页面上不出现接口名或字段名 */
.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
}

.num {
  font-variant-numeric: tabular-nums;
}

/* 数字与英文用等宽，中文保持正文（列表里的 IP / 短码） */
.code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}

/* ------------------------------ 顶部导航 ------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  background: rgba(250, 250, 250, 0.82);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  padding: 6px 10px;
  border-radius: var(--r-pill);
  color: var(--body);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.nav-links a:hover {
  background: var(--canvas-soft-2);
  color: var(--ink);
  text-decoration: none;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--canvas);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--body);
  white-space: nowrap;
}

.nav-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0070f3;
}

/* ------------------------------ 首屏 ------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 72px;
}

/* 品牌渐变：本页唯一的装饰，铺在首屏顶部，向下淡出 */
.hero-mesh {
  position: absolute;
  inset: -18% -10% auto -10%;
  height: 620px;
  pointer-events: none;
  filter: blur(56px) saturate(120%);
  opacity: 0.5;
  background: radial-gradient(38% 46% at 22% 34%, var(--g-develop-a) 0%, transparent 70%),
    radial-gradient(34% 42% at 48% 18%, var(--g-develop-b) 0%, transparent 72%),
    radial-gradient(40% 48% at 74% 30%, var(--g-preview-a) 0%, transparent 72%),
    radial-gradient(32% 40% at 88% 52%, var(--g-preview-b) 0%, transparent 74%),
    radial-gradient(36% 44% at 34% 62%, var(--g-ship-a) 0%, transparent 74%),
    radial-gradient(30% 38% at 62% 70%, var(--g-ship-b) 0%, transparent 76%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 52%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 52%, transparent 100%);
}

.hero-inner {
  position: relative;
}

.hero h1 {
  max-width: 15ch;
  font-size: clamp(34px, 5.4vw, 64px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 62ch;
  margin-top: 20px;
  color: var(--body);
  font-size: 18px;
  line-height: 1.7;
}

/* 首屏里的「变短」演示：产品最核心的那一步，直接上手试 */
.shorten {
  margin-top: 36px;
  max-width: 760px;
  background: var(--canvas);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-4);
}

.shorten-row {
  display: flex;
  gap: 10px;
}

.shorten input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
}

.shorten input::placeholder {
  color: var(--mute);
  font-size: 15px;
}

.shorten input:focus {
  border-color: var(--hairline-strong);
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: #333;
}

.btn:active {
  transform: translateY(1px);
}

.btn-ghost {
  height: 32px;
  padding: 0 12px;
  border-color: var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  font-size: 13px;
}

.btn-ghost:hover {
  background: var(--canvas-soft-2);
}

.shorten-out {
  margin-top: 16px;
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
}

.shorten-out-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.shorten-url {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--ink);
  word-break: break-all;
}

.shorten-url .code-part {
  color: var(--ink);
  background: #f0f7ff;
  border-radius: var(--r-xs);
  padding: 1px 4px;
}

.shorten-url .base-part {
  color: var(--mute);
}

.shorten-note {
  margin-top: 12px;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.6;
}

.shortcut-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 18px;
  color: var(--mute);
  font-size: 13px;
}

.shortcut-hint span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ------------------------------ 通用分节 ------------------------------ */
.section {
  padding: 88px 0;
}

.section-soft {
  background: var(--canvas-soft-2);
}

.section h2 {
  max-width: 22ch;
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.section-lead {
  max-width: 64ch;
  margin-top: 14px;
  color: var(--body);
  font-size: 17px;
}

/* ------------------------------ 短链解剖 ------------------------------ */
.anatomy {
  margin-top: 40px;
  background: var(--canvas);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-3);
}

.anatomy-long {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.9;
  color: var(--body);
}

.anatomy-long b {
  font-weight: 400;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: var(--canvas-soft-2);
  color: var(--ink);
}

.anatomy-arrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--mute);
  font-size: 13px;
}

.anatomy-arrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--hairline-strong);
}

.anatomy-short {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mono);
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: -0.01em;
}

.anatomy-short .base-part {
  color: var(--mute);
}

.anatomy-short .code-part {
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}

.anatomy-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  color: var(--mute);
  font-size: 13px;
}

.anatomy-facts b {
  color: var(--ink);
  font-weight: 500;
}

/* ------------------------------ 统计演示 ------------------------------ */
.panel {
  margin-top: 40px;
  background: var(--canvas);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-4);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
  background: var(--canvas-soft);
}

.panel-dots {
  display: flex;
  gap: 6px;
}

.panel-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e2e2e2;
}

.panel-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.panel-col {
  padding: 22px 20px;
}

.panel-col + .panel-col {
  border-left: 1px solid var(--hairline);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}

.metric-label {
  font-size: 13px;
  color: var(--mute);
}

.metric-value {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.metric-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--mute);
}

.chart-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--mute);
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 132px;
  margin-top: 14px;
  padding-top: 8px;
  border-bottom: 1px solid var(--hairline);
}

.chart-bar {
  flex: 1;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: #d7d7d7;
  transition: background-color 0.15s ease;
}

.chart-bar.is-peak {
  background: var(--ink);
}

.chart-bar:hover {
  background: var(--link);
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}

.click-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 13px;
}

.click-table th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  text-align: left;
}

.click-table td {
  padding: 8px;
  border-bottom: 1px solid var(--hairline);
  color: var(--body);
  white-space: nowrap;
}

.click-table td:first-child {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}

.click-table tr:last-child td {
  border-bottom: 0;
}

.panel-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--hairline);
  background: var(--canvas-soft);
  color: var(--mute);
  font-size: 12px;
}

/* ------------------------------ 页脚（整块居中） ------------------------------ */
.footer {
  padding: 56px 0 40px;
  background: var(--canvas);
  border-top: 1px solid var(--hairline);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.footer-desc {
  max-width: 46ch;
  color: var(--mute);
  font-size: 14px;
  line-height: 1.7;
}

.footer-copy {
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  width: 100%;
  color: var(--mute);
  font-size: 13px;
}

/* 备案号：两个号码并排居中（在后台「系统设置 → 备案信息」里填写；都空时整块不显示） */
.beian {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 12px;
  color: var(--mute);
  font-size: 13px;
}

.beian:empty {
  display: none;
}

.beian a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--mute);
}

/* 备案号前面的小图标（服务端内联 SVG，跟随文字颜色） */
.beian-icon {
  flex: 0 0 auto;
  opacity: 0.9;
}

/* ------------------------------ 入场动效 ------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* 短码生成时的一下轻微跳动，全页只此一处动效 */
@keyframes code-pop {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.code-part.is-new {
  animation: code-pop 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 960px) {
  .panel-body {
    grid-template-columns: 1fr;
  }

  .panel-col + .panel-col {
    border-left: 0;
    border-top: 1px solid var(--hairline);
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .nav-badge {
    margin-left: auto;
  }

  .hero {
    padding: 56px 0 48px;
  }

  .hero-mesh {
    height: 460px;
    filter: blur(44px) saturate(120%);
  }

  .section {
    padding: 64px 0;
  }

  .shorten-row {
    flex-direction: column;
  }

  .shorten .btn {
    width: 100%;
  }

  .metrics {
    gap: 14px 16px;
  }

  .metric-value {
    font-size: 24px;
  }
}

/* 用户系统里关掉了动效就完全不动 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .code-part.is-new {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}
