/* 红笔 · 小红书运营工具箱 —— 纸面 + 红笔批改 */

:root {
  --paper: #FAF8F4;
  --card: #FFFFFF;
  --ink: #221E1A;
  --muted: #6F675C;
  --red: #D8332F;
  --red-deep: #A82826;
  --red-soft: #FAEBEA;
  --green: #1E7A4A;
  --green-soft: #E9F4EE;
  --amber: #A96A0B;
  --amber-soft: #FBF3E4;
  --line: #E8E3DA;
  --line-dark: #D9D2C6;
  --radius-s: 4px;
  --radius-m: 10px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

a { color: inherit; }

::selection { background: var(--red-soft); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}

.brand-mark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  color: var(--red);
  letter-spacing: 2px;
}

.brand-sub {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 1px;
}

.topnav {
  display: flex;
  gap: 4px;
}

.topnav a {
  text-decoration: none;
  font-size: 13.5px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius-s);
}

.topnav a:hover { color: var(--ink); background: #F1EDE5; }

.topnav a[aria-current="page"] {
  color: var(--red-deep);
  background: var(--red-soft);
}

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topnav { order: 3; width: 100%; overflow-x: auto; }
  .topnav a { white-space: nowrap; }
}

/* ---------- 按钮 ---------- */

.btn {
  font-family: var(--sans);
  font-size: 14px;
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.btn:hover { border-color: var(--ink); }

.btn-red {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
}

.btn-red:hover { background: var(--red-deep); border-color: var(--red-deep); }

.btn-lg { font-size: 15.5px; padding: 11px 24px; }

.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-dark); }

/* ---------- 版心 ---------- */

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ---------- 落地页 hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 48px;
  align-items: start;
  padding: 56px 0 64px;
}

.hero > div { min-width: 0; }

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1.28;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
}

/* 断点放在基础规则之后，避免同优先级被后写的字号覆盖 */
@media (max-width: 1200px) {
  .hero { grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; }
  .hero h1 { font-size: 34px; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 28px; padding-bottom: 44px; }
  .hero h1 { font-size: clamp(28px, 5.5vw, 38px); }
  /* 单栏时稿纸卡不再被拉满宽，避免横线与文字错位显得空 */
  .hero .demo-card { max-width: 560px; width: 100%; }
}

.hero h1 .mark {
  position: relative;
  white-space: nowrap;
}

.hero h1 .mark::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: 4px;
  height: 34%;
  background: linear-gradient(transparent 55%, rgba(216, 51, 47, .18) 55%);
  transform: rotate(-.6deg);
  z-index: -1;
}

.hero .lede {
  margin-top: 20px;
  max-width: 34em;
  color: var(--muted);
  font-size: 15.5px;
}

.hero-cta {
  margin-top: 30px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-note {
  font-size: 12.5px;
  color: var(--muted);
}

/* 方格稿纸试玩卡：横线只画在输入区，行高严格对齐 */

.demo-card {
  background: var(--card);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-m);
  padding: 20px 20px 18px;
  box-shadow: 0 1px 0 var(--line-dark);
  max-width: 100%;
  min-width: 0;
}

.demo-card .demo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.demo-card .demo-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
}

.demo-card .demo-tag { font-size: 12px; color: var(--red); }

/* 稿纸：28px 一行，横线落在每行文字下方，不穿过其他区块 */
.demo-paper {
  margin-top: 12px;
  padding: 0 2px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    #EFEAE0 27px,
    #EFEAE0 28px
  );
  background-position: 0 0;
  border-bottom: 1px solid var(--line);
}

.demo-card textarea {
  display: block;
  width: 100%;
  height: 56px;              /* 2 行 × 28px，与横线步长一致 */
  border: none;
  padding: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 16px;           /* 16px 避免 iOS 聚焦时自动放大 */
  line-height: 28px;
  resize: none;
  color: var(--ink);
}

.demo-card textarea:focus { outline: none; }

.demo-card textarea::placeholder { color: #A29A8E; }

.demo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
}

.demo-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.demo-result { margin-top: 2px; }
.demo-result:not(:empty) {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ---------- 评分条 ---------- */

.scorerow {
  display: grid;
  grid-template-columns: 5.5em 1fr 2.4em;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}

.scorerow .s-name { color: var(--muted); }

.scorerow .s-bar {
  height: 7px;
  background: #F0ECE3;
  border-radius: 4px;
  overflow: hidden;
}

.scorerow .s-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--green);
  transition: width .5s cubic-bezier(.2, .7, .3, 1);
}

.scorerow.is-warn .s-fill { background: var(--amber); }
.scorerow.is-bad .s-fill { background: var(--red); }

.scorerow .s-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .scorerow .s-fill { transition: none; }
}

/* ---------- 落地页其余区块 ---------- */

.section { padding: 46px 0; border-top: 1px solid var(--line); }

.section h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
}

.section .section-lede {
  color: var(--muted);
  margin-top: 8px;
  max-width: 36em;
}

/* 工具目录：非对称两栏清单，不做同款卡片海 */

.tool-list { margin-top: 28px; }

.tool-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  padding: 20px 4px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  align-items: baseline;
}

.tool-row:last-child { border-bottom: 1px solid var(--line); }

.tool-row:hover .tool-go { color: var(--red); }

.tool-row .t-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
}

.tool-row .t-desc { grid-column: 1; color: var(--muted); font-size: 14px; max-width: 40em; }

.tool-row .t-meta {
  grid-row: 1;
  grid-column: 2;
  font-size: 12.5px;
  white-space: nowrap;
}

.tool-row .t-meta.free { color: var(--green); }
.tool-row .t-meta.pro { color: var(--amber); }

.tool-row .t-go {
  grid-column: 2;
  justify-self: end;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .tool-row { grid-template-columns: 1fr; }
  .tool-row .t-meta, .tool-row .t-go { grid-column: 1; justify-self: start; }
  .tool-row .t-meta { grid-row: auto; }
}

/* 定价 */

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
  max-width: 720px;
}

@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }

.plan {
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-m);
  background: var(--card);
  padding: 24px;
}

.plan.is-main {
  border-color: var(--red);
  border-width: 2px;
  padding: 23px;
  position: relative;
}

.plan .p-name { font-family: var(--serif); font-size: 18px; font-weight: 700; }

.plan .p-price {
  font-size: 32px;
  font-weight: 700;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.plan .p-price small { font-size: 13px; font-weight: 400; color: var(--muted); }

.plan ul {
  list-style: none;
  margin: 14px 0 20px;
}

.plan li {
  padding: 5px 0 5px 22px;
  position: relative;
  font-size: 14px;
  color: var(--muted);
}

.plan li::before {
  content: "";
  position: absolute;
  left: 2px; top: 13px;
  width: 11px; height: 7px;
  border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}

.plan .p-warn { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* 购买流程说明 */

.buy-flow {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px dashed var(--line-dark);
  border-radius: 10px;
  background: var(--card);
  max-width: 760px;
}

.buy-flow .bf-title {
  font-family: var(--serif);
  font-size: 16px;
  margin-bottom: 10px;
}

.buy-flow ol {
  margin: 0 0 0 20px;
  padding: 0;
}

.buy-flow li {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.9;
  padding: 2px 0;
}

.buy-flow li b { color: var(--ink); font-weight: 600; }

.buy-flow .bf-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

/* FAQ */

.faq { margin-top: 24px; max-width: 720px; }

.faq details {
  border-top: 1px solid var(--line);
  padding: 14px 4px;
}

.faq details:last-child { border-bottom: 1px solid var(--line); }

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  list-style: none;
  position: relative;
  padding-right: 28px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: -2px;
  color: var(--red);
  font-size: 18px;
}

.faq details[open] summary::after { content: "−"; }

.faq details p { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* 页脚 */

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- 工具页 ---------- */

.tool {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 44px;
  padding: 36px 0 80px;
  align-items: start;
}

@media (max-width: 860px) {
  .tool { grid-template-columns: 1fr; gap: 28px; }
}

.tool-side h1 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.35;
}

.tool-side .lede {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.dim-list { margin-top: 20px; }

.dim-list li {
  list-style: none;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}

.dim-list li b { font-family: var(--serif); }

.dim-list li span { color: var(--muted); display: block; }

.quota {
  margin-top: 22px;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--red-soft);
  color: var(--red-deep);
}

.quota.is-pro { background: var(--green-soft); color: var(--green); }

.tool-main {
  background: var(--card);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-m);
  padding: 24px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field label small { font-weight: 400; color: var(--muted); }

.field textarea,
.field input,
.field select {
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-s);
  padding: 10px 12px;
  background: #FDFCFB;
}

.field textarea { min-height: 110px; resize: vertical; }

.field textarea:focus,
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(216, 51, 47, .08);
}

.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* 批改结果区 */

.verdict {
  margin-top: 24px;
  border-top: 2px solid var(--ink);
  padding-top: 18px;
}

.verdict:empty { display: none; }

.verdict-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.verdict-head .v-total {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.verdict-head .v-label { font-size: 13px; color: var(--muted); }

.v-scoring { margin-top: 14px; }

.v-notes { margin-top: 18px; }

.v-note {
  padding: 12px 14px;
  border-left: 3px solid var(--line-dark);
  background: #FCFBF8;
  margin-bottom: 10px;
  font-size: 13.5px;
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
}

.v-note b { display: block; margin-bottom: 2px; }

.v-note.is-bad { border-left-color: var(--red); }
.v-note.is-warn { border-left-color: var(--amber); }
.v-note.is-good { border-left-color: var(--green); }

.v-note .fix { color: var(--muted); }

/* 改写模板 / 选题结果 */

.templates { margin-top: 18px; }

.tpl {
  border: 1px dashed var(--line-dark);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 14.5px;
  background: var(--paper);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.tpl .tpl-use { font-size: 12px; color: var(--muted); display: block; margin-top: 4px; }

.copy-btn {
  flex-shrink: 0;
  font-size: 12px;
  border: 1px solid var(--line-dark);
  background: var(--card);
  border-radius: var(--radius-s);
  padding: 4px 10px;
  cursor: pointer;
  color: var(--muted);
}

.copy-btn:hover { color: var(--red); border-color: var(--red); }

/* 去AI味结果 */

.deai-text {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.9;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 16px;
  margin-top: 14px;
}

.deai-text mark {
  background: var(--red-soft);
  color: var(--red-deep);
  padding: 1px 3px;
  border-radius: 2px;
  text-decoration: underline wavy var(--red) 1px;
  text-underline-offset: 3px;
}

/* 发布检查 */

.check-group { margin-top: 22px; }

.check-group h3 {
  font-family: var(--serif);
  font-size: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.check-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 14.5px;
}

.check-item input {
  width: 17px;
  height: 17px;
  margin-top: 4px;
  accent-color: var(--red);
  flex-shrink: 0;
}

.check-item input:checked + .check-body { color: var(--muted); }

.check-item input:checked + .check-body .c-title {
  text-decoration: line-through;
  text-decoration-color: var(--red);
}

.check-item .c-title { font-weight: 600; }

.check-item .c-body { display: block; font-size: 12.5px; color: var(--muted); }

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.progress-wrap .p-bar {
  flex: 1;
  height: 8px;
  background: #F0ECE3;
  border-radius: 4px;
  overflow: hidden;
}

.progress-wrap .p-fill {
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: 4px;
  transition: width .3s;
}

.progress-wrap .p-num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.time-suggest {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13.5px;
}

/* ---------- 弹窗 ---------- */

dialog.paywall {
  border: none;
  border-radius: var(--radius-m);
  padding: 0;
  max-width: 420px;
  width: calc(100% - 40px);
  box-shadow: 0 18px 60px rgba(30, 20, 15, .25);
}

dialog.paywall::backdrop { background: rgba(30, 25, 20, .45); }

.paywall-inner { padding: 26px; }

.paywall-inner h2 {
  font-family: var(--serif);
  font-size: 20px;
}

.paywall-inner .pw-text {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 8px;
}

.paywall-inner .pw-buy {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--red-soft);
  border-radius: var(--radius-s);
  font-size: 13.5px;
  color: var(--red-deep);
}

.paywall-inner .pw-field { margin-top: 16px; display: flex; gap: 8px; }

.paywall-inner input {
  flex: 1;
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-s);
  padding: 9px 12px;
}

.paywall-inner input:focus { outline: none; border-color: var(--red); }

.paywall-err { color: var(--red); font-size: 12.5px; margin-top: 8px; min-height: 1.2em; }

.paywall-foot {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}

.paywall-foot a { color: var(--muted); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius-s);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}

.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 激活页 ---------- */

.activate-box {
  max-width: 520px;
  margin: 56px auto 0;
  background: var(--card);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-m);
  padding: 32px;
}

.activate-box h1 { font-family: var(--serif); font-size: 26px; }

.activate-box .lede { color: var(--muted); margin-top: 10px; font-size: 14px; }

.activate-status {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-s);
  font-size: 14px;
  background: var(--red-soft);
  color: var(--red-deep);
}

.activate-status.is-pro { background: var(--green-soft); color: var(--green); }

/* ---------- 小屏适配 ---------- */

@media (max-width: 640px) {
  .wrap { padding: 0 16px 56px; }

  .topbar { padding: 12px 16px; }
  .brand-sub { font-size: 11px; }

  .hero { padding-top: 20px; gap: 28px; }
  .hero h1 { font-size: 30px; }
  .hero .lede { font-size: 14.5px; margin-top: 14px; }
  .hero-cta { margin-top: 22px; }
  .hero-cta .btn-lg { width: 100%; text-align: center; }

  .demo-card { padding: 16px 14px 14px; }
  .demo-card .demo-title { font-size: 16px; }
  .demo-card .demo-tag { font-size: 11.5px; }
  .demo-card textarea { font-size: 16px; line-height: 28px; height: 56px; }
  .demo-foot .btn-red { width: 100%; }

  .section { padding: 34px 0; }
  .section h2 { font-size: 22px; }
  .tool-row .t-name { font-size: 17px; }
  .plans { gap: 14px; }
  .plan, .plan.is-main { padding: 20px; }

  .tool { padding-top: 22px; gap: 22px; }
  .tool-main { padding: 16px; }
  .tool-side h1 { font-size: 23px; }
  .v-total { font-size: 34px; }
  .scorerow { grid-template-columns: 4.5em 1fr 2.2em; gap: 8px; }
  .tpl { flex-direction: column; gap: 8px; }

  .activate-box { margin-top: 28px; padding: 22px 18px; }
  .activate-box h1 { font-size: 22px; }
  .paywall-inner { padding: 20px; }
  .paywall-inner .pw-field { flex-direction: column; }
}
