:root {
  --bg: #e7f0eb;
  --bg2: #d8e5de;
  --ink: #1f3f33;
  --muted: #557263;
  --line: #c3d7cb;
  --accent: #3da96a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 14% 20%, #d7e8df 0%, transparent 35%), linear-gradient(160deg, var(--bg) 0%, var(--bg2) 100%);
  min-height: 100vh;
}

.module-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.2rem 1rem 1.8rem;
}

.module-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.module-top h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.3vw, 1.6rem);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.35rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  background: #f3f8f5;
  white-space: nowrap;
}

.module-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.module-nav-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid #b8d0c2;
  background: #eef7f1;
  color: #245840;
  font-weight: 700;
  font-size: 0.95rem;
}

.module-nav-btn:hover {
  background: #e0f0e6;
}

.module-nav-btn.active {
  background: #3da96a;
  border-color: #3da96a;
  color: #fff;
}

.module-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.module-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 120px;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid #b8d0c2;
  background: #eef7f1;
  color: #245840;
  font-weight: 700;
  padding: 0 0.9rem;
}

.module-switch-btn:hover {
  background: #e0f0e6;
}

.switch-placeholder {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px dashed #b8d0c2;
  border-radius: 10px;
  padding: 0 0.8rem;
  color: #4d6a5b;
  background: rgba(255, 255, 255, 0.8);
}

.module-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  padding: 1rem;
  box-shadow: 0 8px 22px rgba(31, 63, 51, 0.1);
}

.module-no {
  display: inline-block;
  margin: 0;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #ecf4ef;
  border: 1px solid var(--line);
  color: #2f5f49;
  font-size: 0.86rem;
}

.module-card h2 {
  margin: 0.3rem 0 0.65rem;
  font-size: clamp(1.18rem, 2.5vw, 1.7rem);
}

.module-card p {
  margin: 0.45rem 0;
  line-height: 1.7;
}

.module-card ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.module-card li {
  margin: 0.3rem 0;
  color: var(--muted);
}

.simple-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.form-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr 1fr;
}

.simple-card input,
.simple-card textarea,
.simple-card select {
  width: 100%;
  border: 1px solid #c7d9ce;
  border-radius: 10px;
  padding: 0.62rem 0.68rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.simple-card textarea {
  resize: vertical;
}

.row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.result-box,
.trend-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfefc;
  padding: 0.7rem;
  margin-top: 0.75rem;
}

.list-line {
  border-bottom: 1px dashed #c7d9ce;
  padding: 0.48rem 0;
}

.list-line:last-child {
  border-bottom: 0;
}

.tiny-hint {
  margin: 0;
  color: #567465;
  font-size: 0.9rem;
}

.stars {
  color: #d4a641;
  font-weight: 700;
}

.trend-row {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 62px 1fr 48px;
  align-items: center;
  margin-bottom: 0.45rem;
}

.trend-bar {
  border: 1px solid #c7d9ce;
  height: 12px;
  border-radius: 999px;
  background: #eef7f1;
  overflow: hidden;
}

.trend-bar i {
  display: block;
  height: 100%;
  background: #3da96a;
}

.art-preview {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fcf9;
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0.55rem;
}

.art-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.book-item {
  border-bottom: 1px dashed #c7d9ce;
  padding: 0.6rem 0;
}

.book-item:last-child {
  border-bottom: 0;
}

.book-item pre {
  margin: 0.4rem 0 0;
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.6;
}

.stat-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stat-cell {
  border: 1px solid #c7d9ce;
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem;
}

.stat-cell span {
  display: block;
  color: #557263;
  font-size: 0.84rem;
}

.stat-cell strong {
  font-size: 1.1rem;
}

.dialog-card {
  margin-top: 0;
}

.dialog-card .row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.chat-box {
  margin: 0.8rem 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fcf9;
  min-height: 210px;
  max-height: 360px;
  overflow-y: auto;
  padding: 0.7rem;
  display: grid;
  gap: 0.6rem;
}

.chat-item {
  max-width: 88%;
}

.chat-item .chat-name {
  margin: 0 0 0.2rem;
  font-size: 0.82rem;
  color: #4f6f5f;
}

.chat-item .chat-text {
  margin: 0;
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  line-height: 1.65;
}

.chat-item.bot .chat-text {
  background: #edf8f1;
  border: 1px solid #c8dfcf;
}

.chat-item.child {
  justify-self: end;
}

.chat-item.child .chat-name {
  text-align: right;
}

.chat-item.child .chat-text {
  background: #3da96a;
  border: 1px solid #3da96a;
  color: #fff;
}

.module-action-btn {
  flex: 1 1 160px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #2f8a56;
  background: #3da96a;
  color: #fff;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.module-action-btn.secondary {
  border-color: #b8d0c2;
  background: #eef7f1;
  color: #245840;
}

.module-action-btn.ghost {
  border-color: #c7d6cd;
  background: #fff;
  color: #446657;
}

.module-action-btn:hover {
  filter: brightness(1.03);
}

.module-action-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: none;
}

.example-panel {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.example-item {
  border: 1px dashed #b8d0c2;
  border-radius: 12px;
  padding: 0.65rem;
  background: #fbfefc;
}

.example-title {
  margin: 0 0 0.3rem;
  font-weight: 700;
  color: #2e5a46;
}

.example-item pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.7;
  font-family: inherit;
  color: #3e5f50;
}

.dialog-tip {
  margin-top: 0.65rem;
  font-size: 0.9rem;
  color: #567465;
}

.dialog-card input,
.dialog-card textarea {
  width: 100%;
  border: 1px solid #c7d9ce;
  border-radius: 10px;
  padding: 0.62rem 0.68rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.dialog-card textarea {
  resize: vertical;
}

@media (max-width: 900px) {
  .module-nav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .module-shell {
    padding: 0.8rem 0.65rem 1.2rem;
  }

  .module-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .module-nav-grid {
    grid-template-columns: 1fr;
  }

  .module-switch {
    flex-direction: column;
    align-items: stretch;
  }

  .module-switch-btn,
  .switch-placeholder {
    width: 100%;
    justify-content: center;
  }
}
