* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* 与桌面端 --font-chrome 一致的系统字体栈 */
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  background: #fff;
  color: #1f2328;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 英文界面正文加一点字距（与桌面端规范一致） */
html[lang="en"] body {
  letter-spacing: 0.01em;
}

/* 右上角语言切换（默认英文） */
/* 满屏布局：贴屏幕右上角（屏幕边即内容边） */
.lang-switch {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 24px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(8px);
}

.lang-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #5c5c5c;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-btn:hover {
  color: #111;
  background: rgba(0, 0, 0, 0.04);
}

.lang-btn--active {
  color: #0a0a0a;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.06);
}

.lang-sep {
  color: #c8c8c8;
  user-select: none;
  font-weight: 300;
  padding: 0 1px;
}

/* Notepad++ 式：左侧栏 + 黑色竖线 + 右侧主内容 */
/* 响应式比例布局：整页铺满屏幕。基准比例 1:4（侧栏 20vw，参考 VS Code 等桌面工具的经典比例），
   下限 260px 保护小屏下的品牌区/导航；宽屏不设上限，侧栏随屏幕等比例变宽。
   实际效果：1440→288px 1920→384px 2560→512px 3440→688px，始终约 1:4。 */
.layout {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.sidebar {
  flex: 0 0 max(260px, 20vw);
  background: #fff;
  border-right: 2px solid #000;
  padding: 38px clamp(18px, 2.2vw, 32px) 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  container-type: inline-size;
}

/* 品牌区（非链接） */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #111;
  margin-bottom: 28px;
}

.brand-logo-img {
  display: block;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #1f2328;
}

.sidebar-tagline {
  margin: 0 0 38px;
  max-width: 100%;
  font-size: min(1rem, 5.6cqi);
  font-weight: 600;
  line-height: 1.4;
  color: #1f2328;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: #8c959f;
  white-space: nowrap;
}

.sidebar-navs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 4px;
}

.sidebar-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: #1f2328;
  text-decoration: none;
  padding: 2px 0;
}

.sidebar-nav .nav-ico {
  width: 16px;
  height: 20px;
  flex-shrink: 0;
  color: #57606a;
}

.sidebar-nav:hover {
  color: #0969da;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.sidebar-nav:hover .nav-ico {
  color: #0969da;
}

.main {
  flex: 1;
  min-width: 0;
  background: #fff;
}

.content {
  width: 100%;
  /* 满屏比例布局下放宽正文上限，让文字区随主栏变宽；仍保留上限保护长文可读性 */
  max-width: min(100%, 1180px);
  /* 与下方 .about 一致，使「下载」与「什么是 Logpad」左对齐 */
  margin: 0 auto;
  padding: 46px clamp(28px, 4.5vw, 72px) 72px;
}

.content h1 {
  margin: 0 0 16px;
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.content p {
  margin: 0 0 12px;
  font-size: 1rem;
}

.actions {
  margin: 20px 0 16px !important;
}

.actions--ubuntu {
  margin-top: 12px !important;
}

.platform-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.platform-title--spaced {
  margin-top: 28px;
}

.platform-desc {
  margin: 0 0 4px;
  color: #57606a;
  font-size: 0.98rem;
}

.btn-disabled {
  pointer-events: none;
  opacity: 0.55;
  cursor: default;
}

.muted {
  color: #57606a;
  font-size: 0.92rem;
}

.install-cmds {
  margin: 4px 0 8px;
}

.install-cmd-label {
  margin: 0 0 6px;
  color: #57606a;
  font-size: 0.85rem;
  font-weight: 600;
}

.install-cmd--split {
  margin-top: 6px;
}

.cmdbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 8px 8px 14px;
  background: #f4f5f7;
  border-radius: 8px;
  min-height: 44px;
}

.install-cmds.is-dark .cmdbar {
  background: #1c2128;
}

.cmdbar-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  color: #24292f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.5;
}

.install-cmds.is-dark .cmdbar-text {
  color: #e6edf3;
}

.cmdbar-prompt {
  margin-right: 8px;
  color: #8b949e;
}

.cmdbar-tools {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
}

.cmdbar-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #656d76;
  cursor: pointer;
}

.cmdbar-btn svg {
  width: 16px;
  height: 16px;
}

.cmdbar-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #24292f;
}

.install-cmds.is-dark .cmdbar-btn {
  color: #8b949e;
}

.install-cmds.is-dark .cmdbar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e6edf3;
}

.cmdbar-btn:hover::after,
.cmdbar-btn.is-copied::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 2;
  padding: 4px 8px;
  border-radius: 6px;
  background: #24292f;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 6px;
  background: #1f6feb;
  color: #fff;
  text-decoration: none;
  margin: 0 10px 10px 0;
  font-weight: 500;
  font-size: 0.98rem;
  line-height: 1.4;
  border: 1px solid #1f6feb;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: #1a5fd0;
  border-color: #1a5fd0;
}

.btn.secondary {
  background: #fff;
  color: #1f2328;
  border-color: #d0d7de;
}

.btn.secondary:hover {
  background: #f6f8fa;
  border-color: #afb8c1;
}

code {
  background: #f6f8fa;
  border: 1px solid #d8dee4;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.88em;
  color: #1f2328;
}

/* —— 「什么是 Logpad」+ 亮点 + 截图区 —— */
.about {
  padding-top: 8px;
  border-top: 1px solid #ddd;
}

.about h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.about-sub {
  margin: 22px 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
}

.highlights {
  margin: 0 0 24px;
  padding-left: 1.2em;
  color: #2a2f36;
}

.highlights li {
  margin-bottom: 8px;
}

.hero-shot {
  margin: 0;
  padding: 0;
}

.hero-image {
  display: block;
  width: 100%;
  max-width: min(100%, 1180px);
  height: auto;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.hero-caption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #57606a;
  line-height: 1.5;
}

/* 侧栏图 + 时间过滤图 并排 */
.shot-pair {
  display: flex;
  gap: 18px;
  margin-top: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.shot-pair .hero-image {
  border: 1px solid #d0d7de;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.shot-pair-item {
  flex: 0 1 auto;
  min-width: 0;
}

.shot-pair-item img {
  height: auto;
}

/* 侧栏窄图限制高度，与右图视觉平衡 */
.shot-pair-item:first-child img {
  max-height: 430px;
  width: auto;
}

.shot-pair-item:last-child {
  flex: 1 1 420px;
}

/* 与桌面端 +layout 色板对齐的界面示意（无实机图时展示） */
.ui-mock {
  --m-bg: #1e1e1e;
  --m-surface: #252526;
  --m-border: #3c3c3c;
  --m-text: #d4d4d4;
  --m-muted: #858585;
  --m-accent: #569cd6;
  --m-accent2: #4ec9b0;
  --m-warn: #dcdcaa;
  --m-err: #f48771;
  max-width: min(100%, 1180px);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #333;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
  font-family: "Segoe UI", "Microsoft YaHei", ui-monospace, monospace;
  font-size: 11px;
}

.ui-mock-inner {
  background: var(--m-bg);
  color: var(--m-text);
}

.mock-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 28px;
  padding: 0 10px;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
}

.mock-traffic {
  display: flex;
  gap: 5px;
}

.mock-traffic i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5a5a5a;
}

.mock-traffic i:first-child {
  background: #ff5f57;
}

.mock-traffic i:nth-child(2) {
  background: #febc2e;
}

.mock-traffic i:nth-child(3) {
  background: #28c840;
}

.mock-title {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--m-muted);
  margin-right: 48px;
}

.mock-menubar {
  padding: 4px 10px 6px;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
  color: var(--m-text);
  letter-spacing: 0.02em;
}

.mock-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #1f1f1f;
  border-bottom: 1px solid var(--m-border);
}

.mock-toolbar span {
  width: 18px;
  height: 14px;
  border-radius: 2px;
  background: #3c3c3c;
}

.mock-toolbar .mock-tb-wide {
  width: 56px;
  margin-left: 4px;
  background: #454545;
}

.mock-body {
  display: flex;
  min-height: 200px;
}

.mock-sidebar {
  width: 118px;
  flex-shrink: 0;
  padding: 8px;
  background: #1a1a1a;
  border-right: 1px solid var(--m-border);
  color: var(--m-muted);
}

.mock-side-h {
  font-weight: 600;
  color: var(--m-text);
  margin: 6px 0 4px;
  font-size: 10px;
}

.mock-pill {
  display: inline-block;
  padding: 2px 6px;
  margin: 2px 0;
  border-radius: 3px;
  background: #2a2a2a;
  color: var(--m-accent);
  font-size: 10px;
}

.mock-pill.dim {
  color: var(--m-muted);
}

.mock-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  background: #3d3a1f;
  color: #f5d76e;
  font-size: 10px;
}

.mock-editor {
  flex: 1;
  padding: 8px 10px 12px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.45;
}

.mock-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-line.dim {
  color: var(--m-muted);
}

.ln {
  display: inline-block;
  width: 1.6em;
  margin-right: 6px;
  color: var(--m-muted);
  text-align: right;
  user-select: none;
}

.code-date {
  color: var(--m-accent2);
}

.code-info {
  color: var(--m-accent);
  margin-left: 4px;
}

.code-warn {
  color: var(--m-warn);
  margin-left: 4px;
}

.code-err {
  color: var(--m-err);
  margin-left: 4px;
}

.code-txt {
  color: #cecece;
  margin-left: 4px;
}

.mock-badge {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #264f78;
  color: #9cdcfe;
  font-size: 10px;
}

.mock-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 5px 10px;
  background: #007acc;
  color: #fff;
  font-size: 10px;
}

.mock-foot-accent {
  font-weight: 600;
}

/* 右下角回到顶部 */
.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  z-index: 1900;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d0d7de;
  box-shadow: 0 1 2px rgba(0, 0, 0, 0.08), 0 6px 20px rgba(0, 0, 0, 0.12);
  color: #1f2328;
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease,
    color 0.15s ease, border-color 0.15s ease;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  color: #0969da;
  border-color: #0969da;
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-width: none;
    border-right: none;
    border-bottom: 2px solid #000;
    padding: 24px 16px;
  }
}
