:root {
  --bg: #fbf7f0;
  --surface: #fffdf8;
  --surface-soft: #f6efe5;
  --ink: #2d2a26;
  --muted: #6f6a61;
  --line: #e7dbcb;
  --apricot: #e9b982;
  --sage: #a8b9a0;
  --blue: #b8cbd7;
  --mauve: #d9c4d4;
  --shadow: 0 18px 48px rgba(92, 70, 42, 0.12);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 6%, rgba(233, 185, 130, 0.24), transparent 28rem),
    radial-gradient(circle at 82% 8%, rgba(184, 203, 215, 0.26), transparent 26rem),
    var(--bg);
  line-height: 1.6;
}

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

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 247, 240, 0.86);
  border-bottom: 1px solid rgba(231, 219, 203, 0.72);
  backdrop-filter: blur(18px);
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(92, 70, 42, 0.08);
}

.brand-mark span {
  border-radius: 4px;
  background: var(--apricot);
}

.brand-mark span:nth-child(2) {
  background: var(--sage);
}

.brand-mark span:nth-child(3) {
  grid-column: span 2;
  background: var(--blue);
}

.nav-links {
  gap: 8px;
}

.nav-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.78);
  outline: none;
}

.hero {
  min-height: calc(100svh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  align-items: center;
  gap: 56px;
  padding: 64px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8a6f4c;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 22px;
  font-size: clamp(2.35rem, 6vw, 5.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.hero-text {
  max-width: 620px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions,
.poem-actions,
.check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button,
.tab-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover,
.tab-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #2a241d;
  background: #e6b278;
  box-shadow: 0 12px 28px rgba(140, 91, 32, 0.22);
}

.button.compact {
  min-height: 38px;
  padding: 0 14px;
}

.button.secondary,
.button.ghost {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.76);
  border-color: var(--line);
}

.install-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 173, 117, 0.5);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 12px 32px rgba(92, 70, 42, 0.08);
}

.install-prompt[hidden] {
  display: none;
}

.install-prompt strong {
  display: block;
  margin-bottom: 2px;
}

.install-prompt span {
  color: var(--muted);
  font-size: 0.92rem;
}

.install-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.standalone-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(168, 185, 160, 0.45);
  border-radius: 12px;
  background: rgba(247, 251, 244, 0.94);
  box-shadow: 0 12px 30px rgba(61, 78, 52, 0.08);
}

.standalone-helper[hidden],
.helper-dialog[hidden],
.manual-copy[hidden] {
  display: none;
}

.standalone-helper strong {
  display: block;
  margin-bottom: 2px;
}

.standalone-helper span,
.helper-copy,
.manual-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.helper-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(45, 42, 38, 0.22);
}

.helper-dialog-panel {
  position: relative;
  width: min(100%, 560px);
  max-height: min(82svh, 680px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.helper-dialog-panel h2 {
  padding-right: 34px;
}

.helper-copy {
  margin-bottom: 18px;
}

.helper-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(246, 239, 229, 0.72);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.standalone-tool-list {
  display: grid;
  gap: 10px;
}

.standalone-tool-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 247, 240, 0.68);
}

.standalone-tool-item strong {
  display: block;
}

.standalone-tool-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.manual-copy {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.manual-copy input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--ink);
}

.toolbox-visual {
  position: relative;
  min-height: 390px;
  padding: 38px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(246, 239, 229, 0.88));
  box-shadow: var(--shadow);
}

.drawer {
  width: 100%;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 0 24px;
  border: 1px solid rgba(178, 153, 121, 0.34);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.drawer:hover,
.drawer:focus-visible {
  transform: translateX(0) translateY(-2px);
  border-color: rgba(168, 185, 160, 0.62);
  box-shadow: 0 12px 28px rgba(84, 65, 40, 0.1);
}

.drawer i {
  width: 42px;
  height: 8px;
  border-radius: 999px;
  background: rgba(45, 42, 38, 0.16);
}

.drawer-top {
  transform: translateX(-8px);
}

.drawer-mid {
  transform: translateX(14px);
}

.drawer-bottom {
  margin-bottom: 0;
  transform: translateX(-2px);
}

.floating-card {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 86px;
  min-height: 52px;
  border: 1px solid rgba(168, 185, 160, 0.42);
  border-radius: 10px;
  background: #f7fbf4;
  color: #57654f;
  font-size: 0.9rem;
  font-weight: 750;
  box-shadow: 0 12px 30px rgba(61, 78, 52, 0.12);
}

.card-one {
  right: -16px;
  top: 48px;
}

.card-two {
  left: -18px;
  bottom: 58px;
  background: #f4f8fb;
  color: #526574;
}

.section {
  padding: 34px 0;
}

.section-heading {
  margin-bottom: 22px;
}

.scene-grid,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.scene-card,
.tool-card,
.panel,
.tip-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 10px 30px rgba(92, 70, 42, 0.07);
}

.scene-card,
.tool-card,
.panel {
  padding: 20px;
}

.scene-card {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.scene-card strong {
  display: inline-flex;
  margin-top: 8px;
  color: #7f5d36;
  font-size: 0.92rem;
}

.scene-card:hover,
.scene-card:focus-visible {
  transform: translateY(-2px);
  border-color: #d9ad75;
  box-shadow: 0 16px 34px rgba(92, 70, 42, 0.12);
  outline: none;
}

.scene-card p,
.tool-card p,
.panel p,
.tip-card p,
.footer {
  color: var(--muted);
}

.scene-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #f2dfc4;
  color: #785631;
  font-weight: 800;
}

.scene-icon.sage {
  background: #e2eadc;
  color: #566b4d;
}

.scene-icon.blue {
  background: #e2edf2;
  color: #526b7a;
}

.scene-icon.mauve {
  background: #efe3ec;
  color: #705a6d;
}

.status-pill,
.category-pill,
.trust-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef5eb;
  color: #53694c;
  font-size: 0.82rem;
  font-weight: 750;
}

.trust-pill {
  background: #f4efe7;
  color: #6f6659;
}

.tools-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.search-box {
  width: min(100%, 340px);
}

.search-box input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.92);
  outline: none;
}

.search-box input:focus {
  border-color: #d19b5c;
  box-shadow: 0 0 0 4px rgba(233, 185, 130, 0.24);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-button {
  min-height: 40px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.68);
  border-color: var(--line);
}

.tab-button.active {
  color: #2a241d;
  background: #e9d1ad;
  border-color: #d9ad75;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tool-card h3 {
  margin-bottom: 0;
}

.tool-card p {
  margin-bottom: 0;
}

.tool-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-card-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.68);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 36px 0 46px;
  border-top: 1px solid rgba(231, 219, 203, 0.7);
}

.footer p {
  margin-bottom: 0;
}

.footer a {
  color: #7f5d36;
  font-weight: 700;
}

.page-main {
  padding: 44px 0 68px;
}

.page-header {
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
}

.page-header h1 {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 6vw, 4.4rem);
}

.page-header p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.panel {
  margin-bottom: 18px;
}

.panel h2 {
  font-size: 1.35rem;
}

.poem-selector {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.poem-selector select,
.check-area textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.poem-selector select {
  min-height: 46px;
  padding: 0 12px;
}

.poem-text {
  margin: 18px 0;
  padding: 20px;
  border-radius: 12px;
  background: #f7f0e7;
  text-align: center;
}

.poem-text h3 {
  margin-bottom: 4px;
}

.poem-lines {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  font-size: 1.18rem;
}

.practice-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
}

.practice-panel[hidden] {
  display: none;
}

.blank-list,
.hint-list,
.result-list,
.meta-list {
  display: grid;
  gap: 12px;
  padding-left: 0;
  list-style: none;
}

.blank-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 180px);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.blank-item input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
}

.hint-list li,
.result-list li,
.meta-list li {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: rgba(246, 239, 229, 0.68);
}

.check-area textarea {
  min-height: 160px;
  margin: 8px 0 12px;
  padding: 12px;
  resize: vertical;
}

.feedback-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #eef5eb;
  color: #53694c;
  font-weight: 700;
}

.tip-card {
  padding: 16px;
}

.tip-card + .tip-card {
  margin-top: 14px;
}

.tip-card h3 {
  font-size: 1rem;
}

.feedback-list {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding-left: 0;
  list-style: none;
}

.feedback-list li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.78);
}

.feedback-form {
  display: grid;
  gap: 16px;
}

.feedback-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.feedback-form textarea {
  resize: vertical;
}

.feedback-form input:focus,
.feedback-form select:focus,
.feedback-form textarea:focus {
  border-color: rgba(168, 185, 160, 0.85);
  box-shadow: 0 0 0 3px rgba(168, 185, 160, 0.18);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    gap: 34px;
    padding: 46px 0 32px;
  }

  .toolbox-visual {
    min-height: 320px;
  }

  .scene-grid,
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tools-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 560px) {
  main {
    display: flex;
    flex-direction: column;
  }

  .shell {
    width: min(100% - 22px, 1120px);
  }

  .nav {
    min-height: 62px;
  }

  .nav-links {
    gap: 2px;
    font-size: 0.92rem;
  }

  .nav-links a {
    padding: 0 8px;
  }

  .brand span:last-child {
    max-width: 7.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  h1 {
    margin-bottom: 10px;
    font-size: 1.82rem;
    line-height: 1.18;
  }

  h2 {
    font-size: 1.45rem;
  }

  .install-prompt {
    align-items: stretch;
    flex-direction: column;
    margin-top: 10px;
  }

  .standalone-helper {
    align-items: stretch;
    flex-direction: column;
    margin-top: 10px;
  }

  .install-actions .button {
    flex: 1;
  }

  .standalone-helper .button {
    width: 100%;
  }

  .helper-dialog {
    padding: 10px;
  }

  .helper-dialog-panel {
    max-height: 88svh;
    padding: 20px;
  }

  .standalone-tool-item {
    grid-template-columns: 1fr;
  }

  .hero {
    order: 0;
    padding: 22px 0 10px;
  }

  .hero .eyebrow {
    display: none;
  }

  .hero-text {
    margin-bottom: 14px;
    font-size: 0.98rem;
  }

  .hero-actions {
    display: none;
  }

  #tools {
    order: 1;
    padding-top: 14px;
  }

  #scenes {
    order: 2;
  }

  .hero-actions .button,
  .poem-actions .button,
  .check-actions .button {
    width: 100%;
  }

  .toolbox-visual {
    display: none;
  }

  .floating-card {
    display: none;
  }

  .scene-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .blank-item {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }
}
