/* ============================================================
   jvm 官网样式 —— 暖白纸感亮色主题
   ============================================================ */

:root {
  --bg: #fbfaf7;
  --bg-soft: #f4f2ec;
  --bg-card: #ffffff;
  --border: #e6e2d8;
  --text: #1c1917;
  --text-dim: #6b655c;
  --accent: #c2410c;          /* Java 橙（深一度，白底上对比度够） */
  --accent-bright: #ea580c;
  --accent-2: #1d4ed8;
  --accent-grad: linear-gradient(120deg, #ea580c 0%, #dc2626 100%);
  --code-bg: #f8f6f1;         /* 代码块浅米色，与纸感底色协调 */
  --code-bar: #efece4;        /* 代码块顶栏 */
  --code-border: #e6e2d8;
  --code-text: #38352f;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, .05);
  --shadow-lg: 0 12px 32px -8px rgba(28, 25, 23, .12);
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "Fira Code", "Cascadia Code", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(234, 88, 12, .2); }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-logo { font-size: 1.3rem; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { color: var(--text-dim); font-size: .95rem; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.btn { color: #fff; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 10px;
  font-weight: 600; font-size: 1rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent-bright); color: #fff; }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(234, 88, 12, .3); background: var(--accent); }
.btn-ghost { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text-dim); box-shadow: var(--shadow-sm); }
.btn-sm { padding: 7px 16px; font-size: .9rem; border-radius: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 110px 0 90px;
  text-align: center;
  overflow: hidden;
  /* 细点阵纹理，增加纸感 */
  background-image: radial-gradient(rgba(28, 25, 23, .055) 1px, transparent 1px);
  background-size: 22px 22px;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(620px 320px at 18% -5%, rgba(234, 88, 12, .10), transparent 60%),
    radial-gradient(620px 320px at 82% 0%, rgba(29, 78, 216, .07), transparent 60%);
  pointer-events: none;
}
.hero > .container { position: relative; }
.hero-badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-dim); font-size: .82rem; margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.25;
}
.hero h1 .grad {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub {
  margin: 20px auto 0; max-width: 640px;
  color: var(--text-dim); font-size: 1.12rem;
}

/* 一键安装命令框 */
.install-cmd {
  display: inline-flex; align-items: center; gap: 14px;
  margin: 36px auto 0; max-width: 100%;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 18px;
  font-family: var(--font-mono); font-size: .88rem;
  text-align: left;
  box-shadow: var(--shadow-lg);
}
.install-cmd code {
  color: var(--accent); white-space: nowrap; overflow-x: auto;
  scrollbar-width: none;
}
.install-cmd code::-webkit-scrollbar { display: none; }
.copy-btn {
  flex: none; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 7px; padding: 6px 12px;
  font-size: .8rem; cursor: pointer; font-family: var(--font-sans);
  transition: color .15s, border-color .15s, background .15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--text-dim); }
.copy-btn.copied { color: #166534; border-color: #166534; }

.hero-actions { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 14px; color: var(--text-dim); font-size: .85rem; }
.hero-note a { color: var(--accent); text-decoration: none; }
.hero-note a:hover { text-decoration: underline; }

/* Hero 双栏：左文案右终端（桌面端） */
.hero-split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero-text, .hero-term { min-width: 0; }   /* 允许 grid 子项收缩，防长命令撑破布局 */
.hero-term { margin: 0; max-width: none; width: 100%; }
@media (min-width: 961px) {
  .hero { text-align: left; padding: 80px 0 76px; }
  .hero-sub { margin-left: 0; margin-right: 0; }
  .hero-actions { justify-content: flex-start; }
}
@media (max-width: 960px) {
  .hero-split { grid-template-columns: 1fr; gap: 44px; }
  .hero-term { max-width: 680px; margin: 0 auto; }
}

/* ---------- Section 通用 ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { text-align: center; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em; }
.section-sub { text-align: center; color: var(--text-dim); margin: 12px auto 48px; max-width: 560px; }

/* 入场动画（JS 加 .visible） */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.fade-in.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
}

/* ---------- 特性 grid ---------- */
.feature-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.feature-card:hover { border-color: rgba(234, 88, 12, .5); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-card .icon { font-size: 1.6rem; }
.feature-card h3 { margin: 12px 0 8px; font-size: 1.08rem; }
.feature-card p { color: var(--text-dim); font-size: .93rem; }
.feature-card code { font-family: var(--font-mono); font-size: .85em; background: #fdf0e7; color: var(--accent); padding: 1px 6px; border-radius: 5px; }

/* ---------- 快速开始 ---------- */
.terminal {
  max-width: 680px; margin: 0 auto;
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px; background: var(--code-bar); border-bottom: 1px solid var(--code-border);
}
.terminal-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ef4444; } .dot.y { background: #f59e0b; } .dot.g { background: #22c55e; }
.terminal-bar .term-title { margin-left: 10px; color: var(--text-dim); font-size: .78rem; font-family: var(--font-mono); }
.terminal pre { padding: 20px 22px; overflow-x: auto; font-family: var(--font-mono); font-size: .9rem; line-height: 1.8; text-align: left; }
.terminal .c { color: #8a857b; }   /* 注释 */
.terminal .p { color: #c2410c; }   /* 命令 */
.terminal .o { color: #166534; }   /* 输出 */
.terminal .dim { color: #6b655c; } /* 次要输出 */

/* 演示终端动画 */
#demo-term { min-height: 300px; }
#demo-term .cursor {
  display: inline-block; width: 8px; height: 1.05em;
  background: #c2410c; vertical-align: -0.15em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #demo-term .cursor { animation: none; }
}

/* ---------- 发行版卡片 ---------- */
.distro-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.distro-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.distro-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.distro-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.distro-card .vendor { color: var(--text-dim); font-size: .85rem; margin-bottom: 16px; }
.distro-card code {
  display: block; background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: 8px; padding: 10px; font-family: var(--font-mono);
  font-size: .85rem; color: var(--accent);
}
.distro-note { text-align: center; color: var(--text-dim); font-size: .9rem; margin-top: 26px; }
.distro-note code { font-family: var(--font-mono); font-size: .85em; background: #fdf0e7; color: var(--accent); padding: 1px 6px; border-radius: 5px; }

/* ---------- CTA ---------- */
.cta { text-align: center; }
.cta .section-sub { margin-bottom: 32px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 44px 0 36px; background: var(--bg-soft); }
.footer-inner { text-align: center; }
.footer-brand { font-weight: 600; margin-bottom: 16px; }
.footer-links { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links a { color: var(--text-dim); font-size: .9rem; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-copy { color: #a39e93; font-size: .8rem; }

/* ---------- 文档页 ---------- */
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 48px; padding-top: 40px; padding-bottom: 80px; }
.docs-sidebar { position: sticky; top: 84px; align-self: start; }
.docs-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-title { color: #a39e93; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 6px; }
.sidebar-title:first-child { margin-top: 0; }
.docs-sidebar a {
  color: var(--text-dim); font-size: .92rem; padding: 7px 12px;
  border-radius: 7px;
}
.docs-sidebar a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.docs-sidebar a.active { color: var(--accent); background: #fdf0e7; }

.docs-content { min-width: 0; }
.docs-content h1 { font-size: 1.9rem; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.docs-content h2 { font-size: 1.35rem; margin: 40px 0 14px; }
.docs-content h3 { font-size: 1.1rem; margin: 28px 0 10px; }
.docs-content p, .docs-content li { color: #44403a; font-size: .97rem; }
.docs-content ul, .docs-content ol { padding-left: 24px; margin: 10px 0; }
.docs-content a { color: var(--accent-2); }
.docs-content strong { color: var(--text); }
.docs-content blockquote {
  background: #fdf0e7;
  padding: 12px 18px; border-radius: 8px; margin: 16px 0;
}
.docs-content blockquote p { color: var(--text-dim); font-size: .92rem; }
.docs-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .92rem; background: var(--bg-card); }
.docs-content th, .docs-content td { border: 1px solid var(--border); padding: 9px 14px; text-align: left; }
.docs-content th { background: var(--bg-soft); }
.docs-content code { font-family: var(--font-mono); font-size: .86em; background: #fdf0e7; color: var(--accent); padding: 2px 7px; border-radius: 5px; }
.docs-content pre {
  background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 10px;
  padding: 16px 20px; overflow-x: auto; margin: 16px 0;
  font-size: .88rem;
}
.docs-content pre code { background: none; color: var(--code-text); padding: 0; font-size: inherit; line-height: 1.75; }
.docs-content hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

/* 带顶栏的代码块（JS 自动包装：语言标签 + 常驻复制按钮） */
.code-block {
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: 10px; margin: 16px 0; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-block pre { margin: 0; border: 0; border-radius: 0; background: transparent; }
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px; background: var(--code-bar); border-bottom: 1px solid var(--code-border);
}
.code-lang {
  font-family: var(--font-mono); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); user-select: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .docs-sidebar { position: static; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
  .docs-sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .sidebar-title { width: 100%; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 10px 24px 18px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .site-nav a.btn { margin-top: 12px; justify-content: center; border-bottom: 0; }
  .hero { padding: 70px 0 60px; }
  .install-cmd { font-size: .76rem; gap: 10px; padding: 11px 14px; }
  .section { padding: 56px 0; }
}
