/* 写个锤子官网 · Typora 式极简 + 品牌橙点缀 */

:root,
[data-theme="light"] {
  color-scheme: light;
  --brand: #f99b0a;
  --brand-soft: rgba(249, 155, 10, 0.14);
  --canvas: #ffffff;
  --canvas-muted: #f7f7f5;
  --ink: #111111;
  --body: #555555;
  --muted: #999999;
  --hairline: #e8e8e8;
  --comment: #c45c26;
  --shadow: rgba(0, 0, 0, 0.12);
  --font-ui: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Noto Serif SC", "Songti SC", serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
  --max: 68rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --brand: #f99b0a;
  --brand-soft: rgba(249, 155, 10, 0.16);
  --canvas: #0a0a0c;
  --canvas-muted: #121316;
  --ink: #f0f1f3;
  --body: #b4b8be;
  --muted: #7a8088;
  --hairline: #2e3036;
  --comment: #f99b0a;
  --shadow: rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--brand);
  color: #000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header — appears after scroll */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 3.25rem;
  border-bottom: 1px solid transparent;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    background 0.35s ease,
    border-color 0.35s ease;
}

.site-header.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  border-color: var(--hairline);
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(10px);
}

.site-header-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
}

.brand-logo {
  flex-shrink: 0;
}

.brand-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-stack strong {
  font-size: 0.875rem;
  font-weight: 600;
}

.brand-stack span {
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: none;
  gap: 0.35rem;
  margin-left: auto;
  font-size: 0.875rem;
}

.site-nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  color: var(--body);
  transition: background 0.15s ease;
}

.site-nav a:hover {
  background: var(--canvas-muted);
  color: var(--ink);
}

.theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--canvas);
  color: var(--body);
  cursor: pointer;
}

.site-nav + .theme-toggle {
  margin-left: 0;
}

/* Splash */

.splash {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 4rem;
  text-align: center;
}

.splash-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.splash-logo {
  width: clamp(3.5rem, 12vw, 4.5rem);
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(249, 155, 10, 0.18));
}

.splash-names {
  text-align: center;
}

.splash-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.splash-en {
  margin: 0.45rem 0 0;
  font-size: clamp(0.875rem, 2.2vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.splash-abbr {
  display: inline-block;
  margin-left: 0.55rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.72em;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

.splash-tagline {
  margin: 1.75rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(0.8125rem, 2.5vw, 0.9375rem);
  color: var(--comment);
  min-height: 1.6em;
}

.mono-prefix,
.mono-suffix {
  opacity: 0.75;
}

.type-cursor {
  animation: blink 1s step-end infinite;
  font-weight: 500;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  color: var(--muted);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

/* Blocks */

.block {
  padding: 5rem 1.5rem;
}

.block-readable {
  padding-top: 5.5rem;
  padding-bottom: 5.5rem;
}

.block-muted {
  background: var(--canvas-muted);
}

.block-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.block-centered {
  text-align: center;
}

.two-col {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.block-features {
  padding: 6rem 1.5rem 7rem;
}

.section-lead-center {
  max-width: 36rem;
  margin: 0 auto 2rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--body);
}

.section-lead-narrow {
  max-width: 32rem;
  margin-bottom: 2.5rem;
}

.block-copy h2,
.block-centered > h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}

.block-copy > p {
  margin: 0 0 1.75rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 32rem;
}

.section-comment {
  margin: 0.5rem 0 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--comment);
  letter-spacing: 0.02em;
}

.section-comment-bottom {
  margin: 2.5rem 0 0;
}

.icon-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.icon-list li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.icon-list-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.icon-list-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.icon-list strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.icon-list span {
  display: block;
  font-size: 0.875rem;
  color: var(--body);
  margin-top: 0.15rem;
}

/* Demo window */

.demo-wrap {
  width: 100%;
}

.demo-wrap-lg {
  max-width: 46rem;
  margin: 0 auto;
}

.demo-window {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  background: var(--canvas);
  box-shadow: 0 18px 50px var(--shadow);
}

.demo-titlebar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: var(--canvas-muted);
  border-bottom: 1px solid var(--hairline);
}

.demo-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.demo-dot:nth-child(1) {
  background: #ff5f57;
}
.demo-dot:nth-child(2) {
  background: #febc2e;
}
.demo-dot:nth-child(3) {
  background: #28c840;
}

.demo-title-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.35rem;
  min-width: 0;
}

.demo-title-logo {
  flex-shrink: 0;
  opacity: 0.92;
}

.demo-filename {
  font-size: 0.6875rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-body {
  min-height: 14rem;
  padding: 1.25rem 1.5rem 1.5rem;
  font-size: 0.8125rem;
  line-height: 1.65;
  text-align: left;
  color: var(--body);
}

.demo-window-feature .demo-body {
  min-height: 22rem;
}

.demo-editor-surface {
  background: var(--canvas);
  position: relative;
}

.readable-demo-body {
  min-height: 14rem;
}

.readable-demo-stack {
  position: relative;
}

.readable-demo-measure {
  visibility: hidden;
  pointer-events: none;
}

.readable-demo-live {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.readable-demo-live .demo-typing-surface.readable-plain-surface {
  min-height: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre-wrap;
  color: var(--body);
}

.demo-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 1px;
  vertical-align: baseline;
  background: var(--brand);
  animation: blink 1s step-end infinite;
}

.demo-body.is-switching {
  opacity: 0.55;
  transition: opacity 0.18s ease;
}

.demo-typing-surface {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  line-height: 1.75;
  white-space: pre-wrap;
  color: var(--ink);
  min-height: 12rem;
}

.demo-typing-caret {
  display: inline;
  color: var(--brand);
  font-weight: 300;
  margin-left: 1px;
  animation: blink 1s step-end infinite;
}

.demo-body.is-rich-mode.demo-rich-enter {
  animation: demoRichIn 0.48s ease;
}

@keyframes demoRichIn {
  from {
    opacity: 0.32;
  }
  to {
    opacity: 1;
  }
}

.demo-step {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.demo-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.demo-step + .demo-step {
  margin-top: 0.65rem;
}

.demo-prose h1,
.demo-prose h2,
.demo-prose h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
}

.demo-prose h1 {
  font-size: 1.35rem;
}
.demo-prose h2 {
  font-size: 1.1rem;
}
.demo-prose h3 {
  font-size: 0.95rem;
}

.demo-prose p,
.demo-prose li {
  margin: 0 0 0.5rem;
}

.demo-prose ul {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.1rem;
}

.demo-prose strong {
  color: var(--ink);
  font-weight: 600;
}

.demo-prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 0.1em 0.3em;
  border-radius: 3px;
  background: var(--canvas-muted);
  color: var(--ink);
}

.demo-prose .demo-formula {
  display: inline-block;
  margin: 0.35rem 0;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  background: var(--canvas-muted);
  font-family: var(--font-mono);
  color: var(--ink);
}

.demo-prose .demo-ai-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.65rem;
  box-shadow: 0 4px 14px var(--shadow);
}

.demo-ai-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.65rem;
  box-shadow: 0 4px 14px var(--shadow);
}

.demo-ai-bar span:first-child,
.demo-prose .demo-ai-bar span:first-child {
  padding: 0 0.2rem;
  color: var(--brand);
  font-weight: 700;
}

.demo-ai-bar span:not(:first-child),
.demo-prose .demo-ai-bar span:not(:first-child) {
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  background: var(--canvas-muted);
  color: var(--ink);
}

.demo-selection {
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--ink);
}

.demo-slash-menu {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  background: var(--canvas);
  box-shadow: 0 10px 28px var(--shadow);
  max-width: 16rem;
}

.demo-slash-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--hairline);
}

.demo-slash-item:last-child {
  border-bottom: none;
}

.demo-slash-item.is-active {
  background: var(--brand-soft);
}

.demo-slash-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
}

.demo-slash-desc {
  font-size: 0.6875rem;
  color: var(--muted);
}

.demo-diagram-preview {
  padding: 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--canvas-muted);
}

.demo-flow-svg {
  width: 100%;
  height: auto;
  display: block;
}

.flow-node {
  fill: var(--canvas);
  stroke: var(--hairline);
  stroke-width: 1.5;
}

.flow-label {
  fill: var(--ink);
  font-size: 11px;
  font-family: var(--font-ui);
}

.demo-katex-block {
  margin: 0.35rem 0;
  padding: 0.5rem 0;
  overflow-x: auto;
}

.demo-code-block {
  display: grid;
  grid-template-columns: auto 1fr;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hairline);
}

.demo-code-gutter {
  padding: 0.75rem 0.55rem;
  background: #252526;
  color: #858585;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.55;
  text-align: right;
  user-select: none;
}

.demo-code-gutter span {
  display: block;
}

.demo-code-block .demo-code {
  margin: 0;
  border-radius: 0;
}

.demo-tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.6875rem;
}

.demo-tag-muted {
  background: var(--canvas-muted);
  color: var(--muted);
}

.demo-tag-done {
  background: rgba(40, 200, 64, 0.12);
  color: #2da44e;
}

.demo-code {
  margin: 0;
  padding: 0.85rem;
  border-radius: 6px;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

[data-theme="dark"] .demo-code {
  background: #0d0d0f;
}

.demo-code .kw {
  color: #569cd6;
}
.demo-code .fn {
  color: #dcdcaa;
}
.demo-code .str {
  color: #ce9178;
}
.demo-code .cm {
  color: #6a9955;
}

.demo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.demo-table th,
.demo-table td {
  border: 1px solid var(--hairline);
  padding: 0.4rem 0.55rem;
  text-align: left;
}

.demo-table th {
  background: var(--canvas-muted);
  color: var(--ink);
  font-weight: 600;
}

.demo-caption {
  margin: 1.25rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--comment);
}

.caption-caret {
  color: var(--brand);
  animation: blink 1s step-end infinite;
}

.demo-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  font-style: italic;
}

/* Feature tabs */

.feature-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.35rem;
  margin: 0 0 2.25rem;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.feature-tab {
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--body);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.feature-tab:hover {
  background: color-mix(in srgb, var(--hairline) 60%, transparent);
}

.feature-tab.is-active {
  background: color-mix(in srgb, var(--hairline) 80%, transparent);
  color: var(--ink);
  font-weight: 500;
}

/* Feature grid */

.feature-grid {
  display: grid;
  gap: 2rem 1.5rem;
  text-align: left;
}

.feature-tile h3 {
  margin: 0.85rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.feature-tile p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.tile-visual {
  height: 5.5rem;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--canvas);
  position: relative;
  overflow: hidden;
}

.tile-visual-tree::before {
  content: "工作\A    周报.md\A    计划.md";
  white-space: pre;
  position: absolute;
  inset: 0.65rem;
  font-size: 0.65rem;
  line-height: 1.55;
  color: var(--body);
}

.tile-visual-open::before {
  content: "Ctrl+P  搜索…\A─────────────\A  教程示例.md\A  项目计划.md";
  white-space: pre;
  position: absolute;
  inset: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.55;
  color: var(--body);
}

.tile-visual-import::before {
  content: "txt  docx  xlsx\A     ↓\A  整理为 Markdown";
  white-space: pre;
  position: absolute;
  inset: 0.65rem;
  font-size: 0.65rem;
  line-height: 1.55;
  text-align: center;
  color: var(--body);
}

.tile-visual-md::before {
  content: ".md";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--brand);
}

.tile-visual-save::before {
  content: "● 已全部保存";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: var(--brand);
}

.tile-visual-theme::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0a0a0c 50%, #ffffff 50%);
}

[data-theme="dark"] .tile-visual-theme::before {
  background: linear-gradient(90deg, #0a0a0c 50%, #f0f1f3 50%);
}

/* Download */

.download-block {
  padding-bottom: 6rem;
}

.download-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 2rem;
}

.download-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem;
}

.download-logo {
  margin-bottom: 0.65rem;
}

.download-lead {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink);
}

.download-meta,
.download-footnote {
  margin: 0;
  font-size: 0.875rem;
  color: var(--body);
}

.download-buttons {
  margin: 0.5rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.btn:hover {
  opacity: 0.88;
}

.btn-dark {
  background: #333333;
  color: #ffffff;
}

[data-theme="dark"] .btn-dark {
  background: #f0f1f3;
  color: #0a0a0c;
}

.download-footnote {
  max-width: 20rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 0.75rem;
}

.site-footer {
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  border-top: 1px solid var(--hairline);
}

.site-footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.site-footer-feedback {
  margin-top: 0.5rem !important;
}

.site-footer-feedback a {
  color: var(--body);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer-feedback a:hover {
  color: var(--ink);
}

/* Responsive */

@media (min-width: 768px) {
  .site-nav {
    display: flex;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .two-col {
    grid-template-columns: 1fr 1fr;
  }

  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .type-cursor,
  .scroll-hint,
  .demo-caret {
    animation: none;
  }

  .demo-step {
    opacity: 1;
    transform: none;
  }
}
