:root{
  --bg:#E9E9E5;
  --ink:#20211F;
  --accent:#2452D6;
  --paper:#F8F7F2;
  --muted:#60615D;
  --line:rgba(32,33,31,.16);
}
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion:reduce){
  *{ transition:none !important; animation:none !important; }
  html{ scroll-behavior:auto; }
}
body{
  margin:0;
  min-height:100vh;
  display:flex;
  background:var(--bg);
  color:var(--ink);
  font-family:"Noto Sans SC",-apple-system,"Segoe UI",sans-serif;
  padding-inline:clamp(20px,4vw,48px);
}
a{ color:inherit; text-decoration:none; }
a:focus-visible, summary:focus-visible{ outline:3px solid var(--accent); outline-offset:2px; }

/* .page is the overall content column: this is the width to adjust when the
   whole layout should read narrower/wider, independent of the internal hero grid.
   It's a flex column so the footer pins to the viewport bottom on short pages
   instead of leaving dead space below it on tall screens. */
.page{
  max-width:1280px;
  width:100%;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  min-height:100vh;
  container-type:inline-size;
}
.page > main{ flex:1 0 auto; }

/* ---- header ---- */
header.site{
  display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center; min-height:90px; border-bottom:1px solid var(--line);
  gap:16px; padding-block:16px; position:relative;
}
nav.primary{
  grid-column:2; display:flex; align-items:center; gap:12px;
}
header.site > .btn-hi{ grid-column:3; justify-self:end; }
nav.primary a{
  display:inline-flex; align-items:center; justify-content:center;
  min-height:44px; font-size:0.95rem; font-weight:700; padding:10px 18px;
  border:0; border-radius:2px; white-space:nowrap;
  transition:background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
nav.primary a[aria-current="page"]{
  background:var(--accent); color:var(--paper);
  transform:rotate(-2deg); box-shadow:0 3px 0 rgba(32,33,31,.12);
}
@media (hover:hover){
  nav.primary a:not([aria-current="page"]):hover{
    background:var(--paper); transform:translateY(-3px) rotate(-1deg);
    box-shadow:0 4px 10px rgba(32,33,31,.08);
  }
  nav.primary a[aria-current="page"]:hover{ transform:translateY(-2px) rotate(0deg); }
}
.btn-hi{
  background:var(--accent); color:var(--paper); font-weight:700; font-size:0.9rem;
  padding:10px 18px; border-radius:6px; display:inline-flex; align-items:center; gap:6px;
  border:none; font-family:inherit; cursor:pointer;
}
.btn-hi:hover{ filter:brightness(1.08); }

/* ---- contact dialog ---- */
.contact-dialog{
  position:relative; border:1.5px solid var(--ink); border-radius:4px;
  padding:30px 32px 26px; background:var(--paper); color:var(--ink);
  box-shadow:0 16px 32px rgba(0,0,0,.2); max-width:320px; width:calc(100% - 40px);
}
.contact-dialog::backdrop{ background:rgba(32,33,31,.45); }
.contact-dialog .dialog-close{
  position:absolute; top:8px; right:8px; background:none; border:none;
  font-size:1.3rem; line-height:1; cursor:pointer; color:var(--muted); padding:8px;
  font-family:inherit;
}
.contact-dialog .dialog-close:hover{ color:var(--ink); }
.contact-dialog .dialog-label{
  font-size:0.78rem; color:var(--muted); margin:0 0 6px; letter-spacing:.03em;
}
.contact-dialog .dialog-email{
  font-size:1.15rem; font-weight:700; margin:0 0 20px; word-break:break-all;
}
.contact-dialog .dialog-copy{
  background:var(--accent); color:var(--paper); border:none; border-radius:4px;
  padding:9px 18px; font-weight:700; font-size:0.85rem; cursor:pointer; font-family:inherit;
}
.contact-dialog .dialog-copy:hover{ filter:brightness(1.08); }

.nav-mobile{ display:none; position:relative; margin-left:auto; }
.nav-mobile summary{
  list-style:none; cursor:pointer; font-weight:700; font-size:0.92rem;
  padding:10px 14px; border:1.5px solid var(--ink); border-radius:6px;
}
.nav-mobile summary::-webkit-details-marker{ display:none; }
.mobile-menu{
  position:absolute; right:0; top:calc(100% + 8px); z-index:10;
  background:var(--paper); border-radius:8px; box-shadow:0 12px 24px rgba(0,0,0,.16);
  padding:10px; display:flex; flex-direction:column; gap:4px; min-width:160px;
}
.mobile-menu a{ padding:10px 12px; border-radius:6px; }
.mobile-menu a[aria-current="page"]{ background:var(--accent); color:var(--paper); font-weight:700; transform:rotate(-2deg); border-radius:2px; }
.mobile-menu .btn-hi{ justify-content:center; margin-top:4px; }

@media (max-width:860px){
  nav.primary, .btn-hi.desktop-only{ display:none; }
  header.site{ display:flex; justify-content:flex-end; }
  .nav-mobile{ display:block; }
}

/* ---- hero ---- */
main.hero{
  display:grid; grid-template-columns:1.35fr 1fr; gap:20px;
  padding-block:min(9vw,72px) 40px; align-items:start;
  align-content:center; /* on tall viewports, center the hero row in the
    leftover space instead of leaving a gap above the footer */
}
@media (max-width:860px){
  main.hero{ grid-template-columns:1fr; padding-block:36px 8px; align-content:start; }
}

.identity{ min-width:0; }
.wordmark{
  font-family:"Archivo Black","Arial Black",sans-serif;
  font-size:clamp(3.2rem, 22cqw, 24rem);
  line-height:0.82;
  position:relative; display:inline-block;
  color:var(--ink); margin:0;
}
.wordmark .star{
  position:absolute; top:0.02em; right:-0.52em;
  font-size:0.34em; color:var(--accent); line-height:1;
}
.tag{
  display:inline-block; background:var(--accent); color:var(--paper);
  font-weight:700; font-size:clamp(1rem,2.4cqw,1.3rem);
  padding:8px 16px; margin:22px 0 20px; transform:rotate(-1.5deg);
}
.intro{
  font-size:clamp(1rem,2cqw,1.2rem); line-height:1.65; color:var(--ink);
  max-width:30ch; margin:0;
}

/* ---- entry cards ---- */
.entries{ position:relative; min-height:0; }
@media (max-width:860px){
  .entries{ display:flex; flex-direction:column; gap:20px; margin-top:12px; }
}
@media (min-width:861px){
  .entries{ min-height:420px; }
  .entries::before{
    content:""; position:absolute; top:-16px; right:-16px; width:200px; height:200px; z-index:0;
    background-image:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size:22px 22px;
  }
}

.card{
  display:block; background:var(--paper); border-radius:4px;
  box-shadow:0 12px 24px rgba(0,0,0,.12);
  padding:18px 20px; width:min(220px,80%);
  position:relative;
}
.card h3{ margin:0 0 10px; font-size:1rem; font-weight:700; display:flex; align-items:center; gap:6px; }
.card .lines span{ display:block; height:2px; background:currentColor; opacity:.35; margin-bottom:8px; border-radius:1px; }
.card .lines span:last-child{ width:60%; margin-bottom:0; }

@media (min-width:861px){
  .card.paper1{ position:absolute; top:0; right:32%; transform:rotate(-6deg); z-index:1; }
  .card.folder{ position:absolute; top:130px; right:6%; transform:rotate(4deg); z-index:2; }
  .card.notebook{ position:absolute; top:270px; right:26%; transform:rotate(-3deg); z-index:1; }
}

.card.paper1::after{
  content:""; position:absolute; top:0; right:0; width:0; height:0;
  border-style:solid; border-width:0 18px 18px 0;
  border-color:transparent var(--bg) transparent transparent;
}
.card.folder{ background:var(--accent); color:var(--paper); }
.card.folder::before{
  content:""; position:absolute; top:-10px; left:16px; width:56px; height:14px;
  background:var(--accent); border-radius:4px 4px 0 0;
}
.card.notebook{ padding-left:30px; }
.card.notebook .rings{
  position:absolute; left:8px; top:14px; bottom:14px;
  display:flex; flex-direction:column; justify-content:space-between;
}
.card.notebook .rings span{
  width:8px; height:8px; border-radius:50%; border:2px solid var(--muted);
  background:var(--bg); display:block;
}

.card:hover{
  transform:translateY(-3px) rotate(0deg);
  box-shadow:0 16px 30px rgba(0,0,0,.16);
  transition:transform 180ms ease, box-shadow 180ms ease;
}

/* ---- footer row ---- */
.foot{
  display:flex; justify-content:space-between; align-items:center;
  flex-wrap:wrap; gap:16px; padding-block:28px 40px; border-top:1px solid var(--line);
  margin-top:8px;
}
.social{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.social a{
  display:inline-flex; align-items:center; justify-content:center;
  width:44px; height:44px; border:1.5px solid var(--ink); border-radius:4px;
  transition:background 150ms ease;
}
.social a img{ width:20px; height:20px; display:block; }
.social a:hover{ background:var(--ink); }
.social a:hover img{ filter:invert(1); }
.welcome{ font-size:0.82rem; color:var(--muted); display:flex; align-items:center; gap:10px; }
.welcome .rule{ width:40px; height:1px; background:var(--line); display:inline-block; }

/* ==================================================
   关于我 page
   ================================================== */

.about-hero{
  padding-block:56px 40px;
  border-bottom:1px solid var(--line);
}
.about-hero h1{
  font-size:0.85rem; font-weight:700; color:var(--muted);
  letter-spacing:0.04em; margin:0 0 18px;
}
.about-hero .statement{
  font-weight:900;
  font-size:clamp(1.7rem, 6.4cqw, 3.1rem);
  line-height:1.3;
  max-width:18ch;
  margin:0 0 26px;
  text-wrap:balance;
}
.about-hero .statement .hl{
  background:var(--accent); color:var(--paper); padding:0 8px;
  display:inline-block; transform:rotate(-1deg);
}
.about-hero .body{
  font-size:clamp(1rem, 2cqw, 1.15rem);
  line-height:1.85; color:var(--ink);
  max-width:56ch; margin:0;
}

.timeline-section{ padding-block:48px 72px; }
.timeline-section h2{
  font-weight:900;
  font-size:clamp(1.5rem, 5.5cqw, 2.3rem);
  margin:0 0 48px;
}

.timeline{ position:relative; padding-block:8px; }
.timeline::before{
  content:""; position:absolute; left:50%; top:0; bottom:0;
  width:2px; background:var(--accent); transform:translateX(-1px); z-index:0;
}
.t-node{ position:relative; width:calc(50% - 30px); margin-bottom:56px; z-index:1; }
.t-node:last-child{ margin-bottom:0; }
.t-node:nth-child(odd){ margin-left:0; text-align:right; }
.t-node:nth-child(even){ margin-left:calc(50% + 30px); text-align:left; }

.t-node .dot{
  position:absolute; top:10px; width:14px; height:14px; border-radius:50%;
  background:var(--accent); border:3px solid var(--bg);
}
.t-node:nth-child(odd) .dot{ right:-37px; }
.t-node:nth-child(even) .dot{ left:-37px; }

.t-card{
  display:inline-block; text-align:left; background:var(--paper);
  border-radius:4px; box-shadow:0 12px 24px rgba(0,0,0,.12);
  padding:18px 20px; max-width:320px;
}
.t-node:nth-child(odd) .t-card{ transform:rotate(-2deg); }
.t-node:nth-child(even) .t-card{ transform:rotate(2deg); }
.t-card:hover{ transform:translateY(-2px) rotate(0deg); transition:transform 160ms ease; }

.t-card .num{
  font-family:"Archivo Black","Arial Black",sans-serif;
  color:var(--accent); font-size:1.5rem; display:block; margin-bottom:8px; line-height:1;
}
.t-card p{ margin:0; font-size:0.95rem; line-height:1.55; color:var(--ink); }

.t-node.now .dot{ background:var(--ink); }
.t-node.now .t-card{ background:var(--accent); }
.t-node.now .t-card .num,
.t-node.now .t-card p{ color:var(--paper); }

@media (max-width:760px){
  .timeline::before{ left:20px; transform:none; }
  .t-node,
  .t-node:nth-child(odd),
  .t-node:nth-child(even){
    width:auto; margin-left:52px; margin-right:0; text-align:left;
  }
  .t-node:nth-child(odd) .dot,
  .t-node:nth-child(even) .dot{ left:-38px; right:auto; }
  .t-node:nth-child(odd) .t-card,
  .t-node:nth-child(even) .t-card{ transform:none; }
}

/* ==================================================
   产品 page
   ================================================== */

.products-hero{
  padding-block:56px 40px;
  border-bottom:1px solid var(--line);
}
.products-hero h1{
  font-size:0.85rem; font-weight:700; color:var(--muted);
  letter-spacing:0.04em; margin:0 0 18px;
}
.products-hero .statement{
  font-weight:900;
  font-size:clamp(1.7rem, 6.4cqw, 3.1rem);
  line-height:1.3;
  max-width:22ch;
  margin:0 0 26px;
  text-wrap:balance;
}
.products-hero .statement .hl{
  background:var(--accent); color:var(--paper); padding:0 8px;
  display:inline-block; transform:rotate(-1deg);
}
.products-hero .body{
  font-size:clamp(1rem, 2cqw, 1.15rem);
  line-height:1.85; color:var(--ink);
  max-width:56ch; margin:0;
}

.product-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:24px;
  padding-block:40px 72px;
}
@media (max-width:860px){
  .product-grid{ grid-template-columns:1fr; }
}

.product-card{
  background:var(--paper); border-radius:4px; padding:26px 20px 20px;
  box-shadow:0 12px 24px rgba(0,0,0,.12); position:relative;
  display:flex; flex-direction:column; gap:10px; min-height:220px;
}
.product-card::before{
  content:""; position:absolute; top:-10px; left:16px; width:44px; height:12px;
  background:var(--accent); border-radius:4px 4px 0 0;
}
.product-card .kind{
  font-size:0.72rem; font-weight:700; color:var(--accent);
  text-transform:uppercase; letter-spacing:.04em;
}
.product-card h3{ margin:0; font-size:1.3rem; font-weight:900; }
.product-card .desc{ margin:0; font-size:0.92rem; line-height:1.6; color:var(--ink); flex:1; }
.product-card .access{
  font-size:0.85rem; font-weight:700; color:var(--accent); margin-top:auto;
  background:none; border:none; padding:0; font-family:inherit; cursor:pointer; text-align:left;
}
.product-card .access-note{ font-size:0.82rem; color:var(--muted); margin:0; margin-top:auto; }

.qr-trigger{ position:relative; margin-top:auto; }
.qr-trigger .qr-popup{
  position:absolute; bottom:calc(100% + 10px); left:0;
  background:var(--paper); border-radius:8px; box-shadow:0 12px 24px rgba(0,0,0,.18);
  padding:10px; opacity:0; visibility:hidden; transform:translateY(6px);
  transition:opacity 160ms ease, transform 160ms ease; z-index:20;
}
.qr-trigger:hover .qr-popup,
.qr-trigger:focus-within .qr-popup{
  opacity:1; visibility:visible; transform:translateY(0);
}
.qr-popup img{ display:block; width:150px; height:150px; border-radius:4px; }
.product-card:hover{
  transform:translateY(-3px); box-shadow:0 16px 30px rgba(0,0,0,.16);
  transition:transform 160ms ease, box-shadow 160ms ease;
}

/* ==================================================
   随手写写 page
   ================================================== */

.writing-hero{
  padding-block:56px 40px;
  border-bottom:1px solid var(--line);
}
.writing-hero h1{
  font-size:0.85rem; font-weight:700; color:var(--muted);
  letter-spacing:0.04em; margin:0 0 18px;
}
.writing-hero .statement{
  font-weight:900;
  font-size:clamp(1.7rem, 6.4cqw, 3.1rem);
  line-height:1.3;
  max-width:18ch;
  margin:0 0 26px;
  text-wrap:balance;
}
.writing-hero .statement .hl{
  background:var(--accent); color:var(--paper); padding:0 8px;
  display:inline-block; transform:rotate(-1deg);
}
.writing-hero .body{
  font-size:clamp(1rem, 2cqw, 1.15rem);
  line-height:1.85; color:var(--ink);
  max-width:56ch; margin:0;
}

.notes-empty{
  position:relative; max-width:480px; margin:36px auto 80px;
  padding:40px 28px 40px 54px;
  background-color:var(--paper);
  background-image:repeating-linear-gradient(var(--paper) 0px, var(--paper) 27px, var(--line) 28px);
  border-radius:4px; box-shadow:0 12px 24px rgba(0,0,0,.12);
  transform:rotate(-1deg);
}
.notes-empty .rings{
  position:absolute; left:16px; top:24px; bottom:24px;
  display:flex; flex-direction:column; justify-content:space-between;
}
.notes-empty .rings span{
  width:9px; height:9px; border-radius:50%; border:2px solid var(--muted);
  background:var(--bg); display:block;
}
.notes-empty p{ margin:0; font-size:1rem; line-height:1.8; color:var(--muted); }

/* Future post cards can reuse this shape once there is real content to place. */
.note-card{
  background:var(--paper); border-radius:4px; box-shadow:0 12px 24px rgba(0,0,0,.12);
  padding:22px 24px; margin-bottom:24px;
}
.note-card time{ font-size:0.78rem; color:var(--muted); }
.note-card h3{ margin:8px 0 8px; font-size:1.15rem; font-weight:900; }
.note-card p{ margin:0; font-size:0.95rem; line-height:1.7; color:var(--ink); }

/* ==================================================
   产品 page · 免费小工具 (lighter tier, below the main grid)
   ================================================== */

.tools-section{
  padding-block:8px 72px; margin-top:8px; border-top:1px solid var(--line);
}
.tools-section h2{
  font-weight:900; font-size:clamp(1.3rem, 4.5cqw, 1.8rem); margin:32px 0 24px;
}

.tool-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:20px;
}
@media (max-width:860px){
  .tool-grid{ grid-template-columns:1fr; }
}
.tool-card{
  background:var(--paper); border:1.5px dashed var(--muted); border-radius:4px;
  padding:20px 18px; display:flex; flex-direction:column; gap:8px; min-height:150px;
}
.tool-card h3{ margin:0; font-size:1.05rem; font-weight:900; }
.tool-card h3 a{ color:inherit; }
.tool-card h3 a:hover{ color:var(--accent); text-decoration:underline; }
.tool-card p{ margin:0; font-size:0.88rem; line-height:1.5; color:var(--ink); flex:1; }
.tool-card .tool-pending{ font-size:0.85rem; color:var(--muted); margin-top:auto; }
.tool-card .tool-download{
  display:inline-flex; align-items:center; justify-content:center;
  align-self:flex-start; margin-top:auto;
  background:var(--accent); color:var(--paper); font-weight:700; font-size:0.82rem;
  padding:8px 14px; border-radius:4px;
}
.tool-card .tool-download:hover{ filter:brightness(1.08); }
