/* 灵感成稿 · IdeaDraft —— 多文件 H5 原型
   视觉基线：对齐 traedemo.lfzy.top 的浅色「贴纸」风格
   约束：无 CDN、无外部字体、无第三方依赖 */

:root {
  --bg: #f4f8f9;
  --card: #ffffff;
  --ink: #0a0b0d;
  --muted: #5b6b72;
  --line: #dce5e9;
  --lime: #d7fcae;
  --lime-deep: #6ca83c;
  --lime-wash: rgba(215, 252, 174, 0.16);
  --danger: #d14343;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Courier New",
    monospace;
  --shadow-sm: 3px 3px 0 rgba(10, 11, 13, 0.16);
  --shadow-md: 4px 4px 0 rgba(10, 11, 13, 0.14);
  --shadow-ink: 3px 3px 0 rgba(10, 11, 13, 0.85);
}

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

/* hidden 属性必须压过组件自己的 display（卡片/网格/Flex 都会覆盖 UA 样式） */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 极浅方格纸纹理：与 traedemo.lfzy.top 同一视觉语言 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
      0deg,
      transparent 0 23px,
      rgba(10, 11, 13, 0.028) 23px 24px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 23px,
      rgba(10, 11, 13, 0.028) 23px 24px
    );
}

/* ============ 页面骨架 ============ */
.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px 60px;
}

/* ============ 页头 ============ */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 46px 4px 22px;
  margin-bottom: 4px;
}

.mast-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.pet {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(10, 11, 13, 0.9);
  transform: rotate(-2deg);
}

.pet img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
}

.pet--sm {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  font-size: 20px;
  box-shadow: 3px 3px 0 rgba(10, 11, 13, 0.9);
}

.mast-txt {
  min-width: 0;
}

.mast-txt h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: clamp(26px, 4.2vw, 44px);
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.12;
}

.hl {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--lime);
  font-size: 0.42em;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.mast-sub {
  margin: 7px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 56ch;
}

.mast-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 12px;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}

.stat b {
  font-size: 13px;
  font-weight: 900;
  color: var(--lime-deep);
}

.back-link {
  align-self: center;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.back-link:hover {
  background: var(--lime);
  transform: translate(-1px, -1px);
}

/* ============ 工具条 ============ */
.toolbar {
  position: sticky;
  top: 10px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin: 4px 0 22px;
  background: rgba(244, 248, 249, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(10, 11, 13, 0.85);
}

.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-icon svg {
  display: block;
  width: 15px;
  height: 15px;
}

.search input {
  width: 100%;
  height: 36px;
  padding: 0 40px 0 33px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.search input::placeholder {
  color: #8fa1a8;
}

.search input::-webkit-search-cancel-button,
.search input::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

.search input:focus {
  box-shadow: 3px 3px 0 rgba(10, 11, 13, 0.85);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  display: none;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  transform: translateY(-50%);
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  background: var(--lime);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
}

.search.has-q .search-clear {
  display: grid;
}

.search.has-q .search-kbd {
  display: none;
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  padding: 1px 6px;
  transform: translateY(-50%);
  font-size: 10.5px;
  font-weight: 800;
  color: #8fa1a8;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  pointer-events: none;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-sel {
  height: 32px;
  padding: 0 30px 0 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  background-color: var(--card);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}

.sort-sel:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 1px;
}

.count-chip {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

/* ============ 场景筛选 ============ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease,
    background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.filter b {
  min-width: 17px;
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--muted);
  background: rgba(10, 11, 13, 0.08);
  border-radius: 8px;
}

.filter:hover {
  color: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.filter.is-on {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--ink);
  box-shadow: 2.5px 2.5px 0 rgba(10, 11, 13, 0.85);
  transform: none;
}

.filter.is-on b {
  color: var(--ink);
  background: rgba(10, 11, 13, 0.14);
}

/* ============ 两栏布局 ============ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 30px;
  align-items: start;
}

.main-col {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============ 通用卡片 ============ */
.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* ============ 记录区 ============ */
.composer {
  padding: 20px 22px 22px;
}

.composer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.composer-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 900;
  letter-spacing: -0.1px;
}

.composer-head span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

#ideaInput {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 10px;
  outline: none;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

#ideaInput::placeholder {
  color: #93a3ab;
}

#ideaInput:focus {
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(215, 252, 174, 0.85);
}

.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.tag-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-right: 2px;
}

.tag {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease,
    background 0.15s ease, box-shadow 0.15s ease;
}

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

.tag.is-active {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 rgba(10, 11, 13, 0.16);
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.counter {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ============ 按钮 ============ */
.btn {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 900;
  line-height: 1;
  padding: 12px 22px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(10, 11, 13, 0.2);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(10, 11, 13, 0.2);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--lime);
}

.btn-ghost {
  font-size: 12.5px;
  padding: 9px 14px;
}

.btn-block {
  display: block;
  width: 100%;
  margin-top: 20px;
  text-align: center;
}

/* ============ 列表 ============ */
.list-section {
  margin-top: 30px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.1px;
}

.list-meta {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.sample-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--lime-wash);
  border: 1px dashed var(--ink);
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 16px;
}

.link-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--lime-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.group {
  margin-bottom: 28px;
}

.gm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.gm {
  display: inline-block;
  background: var(--lime);
  border: 2px solid var(--ink);
  border-radius: 9px;
  box-shadow: var(--shadow-ink);
  padding: 2px 13px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
  transform: rotate(-1.2deg);
}

.gm-count {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.gm-row::after {
  content: "";
  flex: 1;
  height: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  opacity: 0.8;
}

.group-body {
  display: flex;
  flex-direction: column;
}

.entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px 6px;
  border-bottom: 1.5px solid var(--line);
  transition: background 0.25s ease;
}

.entry + .entry {
  margin-top: 0;
}

.entry:hover {
  background: rgba(255, 255, 255, 0.72);
}

.entry-date {
  flex: 0 0 auto;
  min-width: 68px;
  padding: 7px 12px 6px;
  text-align: center;
  line-height: 1.05;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow-ink);
  transform: rotate(-2deg);
}

.entry-date .dd {
  display: block;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.entry-date .ym {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.entry-main {
  min-width: 0;
}

.entry-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 7px;
}

.tagpill {
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--card);
  white-space: nowrap;
}

.tagpill--lime {
  background: var(--lime);
}

.tagpill--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.entry-time {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.entry-title {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.42;
  letter-spacing: -0.2px;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.entry-link {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 900;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 2px solid var(--ink);
  padding: 0 0 1px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.entry-link:hover {
  background: var(--lime);
}

.entry-note {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.empty-list {
  background: var(--card);
  border: 1px dashed var(--ink);
  border-radius: 12px;
  padding: 30px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* ============ 侧栏卡片 ============ */
.side-card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 16px 18px;
}

.side-card h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 9px;
  font-size: 14.5px;
  font-weight: 900;
  letter-spacing: -0.1px;
}

.side-card h3::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--lime);
  border: 1px solid var(--ink);
}

.side-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.side-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.side-list li b {
  color: var(--ink);
  font-weight: 900;
}

.side-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border-radius: 5px;
  background: var(--lime);
  border: 1px solid var(--ink);
  font-size: 10.5px;
  font-weight: 900;
  color: var(--ink);
}

.side-link {
  display: inline-block;
  margin-top: 11px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--lime);
  padding-bottom: 1px;
}

.side-link:hover {
  background: var(--lime);
}

/* ============ PRD 页 · 工作台布局（与首页的列表 + 侧栏区分） ============ */
.prd-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  border-bottom: 2px solid var(--ink);
}

.prd-bar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 22px;
}

.prd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.prd-brand .pet--sm {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

.prd-brand-txt {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: 0.02em;
  color: #fff;
}

.prd-brand-txt span {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--lime);
}

.prd-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pstep {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  white-space: nowrap;
}

.pstep b {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.14);
}

.pstep.is-done {
  color: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.3);
}

.pstep.is-active {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--lime);
}

.pstep.is-active b {
  color: var(--lime);
  background: var(--ink);
}

.prd-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.btn-bar {
  padding: 7px 13px;
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: none;
}

.btn-bar:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: none;
  box-shadow: none;
}

.btn-bar-strong {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--lime);
}

.btn-bar-strong:hover {
  background: #e8ffd1;
}

.prd-back {
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  white-space: nowrap;
}

.prd-back:hover {
  color: var(--lime);
}

.wrap.prd-wrap {
  max-width: 1280px;
}

.prd-main {
  padding-top: 24px;
}

.prd-source {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 16px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.prd-source-tag {
  flex: 0 0 auto;
  padding-top: 2px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.prd-source p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
  word-break: break-word;
}

.prd-work {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 20px;
}

.prd-form {
  padding: 20px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.prd-form-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}

.prd-form-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.1px;
}

.prd-form-head span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.prd-form-foot {
  margin-top: 20px;
}

.prd-doc {
  min-width: 0;
}

.doc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.doc-head-left h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.1px;
}

.doc-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.doc-dot {
  color: #b9c7ce;
}

.doc-paper {
  position: relative;
  padding: 30px 32px 34px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 6px 6px 0 rgba(10, 11, 13, 0.12);
}

.doc-paper::before {
  content: "";
  position: absolute;
  top: -1.5px;
  left: -1.5px;
  right: -1.5px;
  height: 7px;
  background: var(--lime);
  border: 1.5px solid var(--ink);
  border-radius: 4px 4px 0 0;
}

.doc-paper .prd-rendered,
.doc-paper .prd-editor {
  min-height: 46vh;
  max-height: calc(100vh - 300px);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.doc-paper .prd-editor {
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.doc-paper .prd-editor:focus {
  box-shadow: 0 0 0 3px rgba(215, 252, 174, 0.85);
}

@media (min-width: 961px) {
  .prd-doc {
    position: sticky;
    top: 76px;
  }
}

.page-prd .empty-prd {
  margin: 72px auto;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
}

.field .req {
  color: var(--lime-deep);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 9px;
  outline: none;
  transition: box-shadow 0.15s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #93a3ab;
}

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

.field input:focus,
.field textarea:focus,
.field select:focus {
  box-shadow: 0 0 0 3px rgba(215, 252, 174, 0.85);
}

.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 32px;
}

.field .hint {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.field.is-invalid input,
.field.is-invalid textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(209, 67, 67, 0.16);
  animation: shake 0.3s ease;
  border-radius: 9px;
}

.form-tip {
  margin: 12px 0 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.preview-tabs {
  display: inline-flex;
  gap: 6px;
}

.preview-tab {
  min-height: 28px;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease,
    background 0.15s ease, box-shadow 0.15s ease;
}

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

.preview-tab.is-on {
  color: var(--ink);
  background: var(--lime);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 rgba(10, 11, 13, 0.18);
}

.prd-rendered {
  max-height: calc(100vh - 258px);
  min-height: 60vh;
  overflow: auto;
  padding: 18px 20px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 10px;
}

.prd-rendered > :first-child {
  margin-top: 0;
}

.prd-rendered > :last-child {
  margin-bottom: 0;
}

.prd-rendered h1 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.3;
  border-bottom: 2px solid var(--ink);
}

.prd-rendered h2 {
  margin: 22px 0 8px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.4;
}

.prd-rendered h3 {
  margin: 16px 0 6px;
  font-size: 13.5px;
  font-weight: 900;
  color: var(--lime-deep);
}

.prd-rendered p {
  margin: 0 0 9px;
}

.prd-rendered ul,
.prd-rendered ol {
  margin: 0 0 10px;
  padding-left: 1.5em;
}

.prd-rendered li {
  margin: 3px 0;
}

.prd-rendered blockquote {
  margin: 0 0 12px;
  padding: 8px 12px;
  color: var(--muted);
  background: var(--lime-wash);
  border-left: 4px solid var(--lime);
}

.prd-rendered code {
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(10, 11, 13, 0.07);
  border-radius: 4px;
}

.prd-rendered hr {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prd-editor {
  display: block;
  width: 100%;
  max-height: calc(100vh - 258px);
  min-height: 60vh;
  padding: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 10px;
  outline: none;
  resize: vertical;
}

.prd-editor:focus {
  box-shadow: 0 0 0 3px rgba(215, 252, 174, 0.85);
}

.prd-edit-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.empty-prd {
  max-width: 460px;
  margin: 64px auto;
  padding: 34px 26px;
  text-align: center;
}

.empty-prd h2 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 900;
}

.empty-prd p {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: var(--muted);
}

/* ============ 页脚 ============ */
.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 34px;
  padding: 22px 4px 0;
  border-top: 2.5px solid var(--ink);
  font-size: 12.5px;
  color: var(--muted);
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  max-width: 86vw;
  padding: 11px 20px;
  transform: translate(-50%, 16px);
  border-radius: 10px;
  background: var(--ink);
  border: 1px solid var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 4px 4px 0 rgba(10, 11, 13, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.toast.is-ok {
  background: var(--lime);
  color: var(--ink);
}

.toast.is-warn {
  background: #ffe6e6;
  color: var(--ink);
}

.shake {
  animation: shake 0.3s ease;
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(209, 67, 67, 0.16);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .prd-work {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .prd-doc {
    position: static;
  }

  .doc-paper {
    padding: 24px 20px 26px;
  }

  .prd-doc,
  .prd-form {
    scroll-margin-top: 110px;
  }

  .doc-paper .prd-rendered,
  .doc-paper .prd-editor {
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .doc-paper .prd-editor {
    min-height: 320px;
    resize: vertical;
  }
}

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

  .masthead {
    padding: 28px 2px 16px;
    align-items: flex-start;
  }

  .pet {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 22px;
  }

  .mast-sub {
    font-size: 12.5px;
  }

  .toolbar {
    position: static;
    gap: 10px;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .filters {
    margin-bottom: 20px;
  }

  .composer {
    padding: 16px;
  }

  .composer-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .composer-head span,
  .search-kbd {
    display: none;
  }

  .entry {
    gap: 12px;
    padding: 14px 8px;
  }

  .entry-date {
    min-width: 56px;
    padding: 5px 8px 4px;
  }

  .entry-date .dd {
    font-size: 17px;
  }

  .entry-title {
    font-size: 16.5px;
  }

  .sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .prd-form {
    padding: 16px;
  }

  .doc-paper {
    padding: 20px 16px 22px;
  }

  .prd-bar-inner {
    gap: 8px 10px;
    padding: 9px 16px;
  }

  .prd-brand-txt {
    font-size: 13.5px;
  }

  .prd-steps {
    order: 3;
    width: 100%;
    padding-bottom: 2px;
    overflow-x: auto;
  }

  .prd-back {
    display: none;
  }

  .btn-bar {
    min-height: 34px;
  }

  .wrap.prd-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
