@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;700;900&display=swap");

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, rgba(0, 0, 0, .025) 1px, transparent 1px) 0 0 / 28px 28px,
    #f7f5ef;
  color: #171717;
  font-family: "Noto Serif SC", "Source Han Serif SC", "思源宋体", "Songti SC", "SimSun", serif;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

button,
select,
textarea,
input {
  font: inherit;
}

.app-nav {
  border-bottom: 1px solid #1f1f1f;
  background: rgba(247, 245, 239, .94);
}

.navbar-brand {
  font-weight: 900;
  letter-spacing: .08em;
  font-family: "Noto Serif SC", "Source Han Serif SC", "思源宋体", "Songti SC", "SimSun", serif;
}

.nav-link,
.footer {
  color: #555 !important;
}

.app-shell {
  padding-top: 28px;
  padding-bottom: 36px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.question-panel,
.result-panel {
  border: 1px solid #1f1f1f;
  border-radius: 2px;
  background: rgba(255, 254, 249, .94);
  box-shadow: 10px 10px 0 #111;
}

.question-panel {
  position: sticky;
  top: 20px;
  padding: 26px;
}

.result-panel {
  min-height: 560px;
  padding: 26px;
}

.panel-heading {
  margin-bottom: 24px;
}

.eyebrow,
.section-heading span,
.share-box span,
.history-box span {
  display: block;
  margin: 0 0 8px;
  color: #555;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.75rem;
  line-height: 1.55;
  font-weight: 900;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.45;
}

h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.45;
}

.question-form,
.follow-up-form {
  display: grid;
  gap: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #222;
  font-size: .92rem;
  font-weight: 850;
}

textarea,
select,
.free-input {
  width: 100%;
  border: 1px solid #222;
  border-radius: 2px;
  background: #fffef9;
  color: #171717;
  outline: none;
}

textarea {
  min-height: 150px;
  padding: 16px;
  resize: vertical;
  line-height: 1.8;
}

select,
.free-input {
  min-height: 46px;
  padding: 11px 12px;
}

.free-input {
  margin-top: 14px;
}

textarea:focus,
select:focus,
.free-input:focus {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .12);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  border-radius: 2px;
  border: 1px solid #111;
  padding: 0 18px;
  font-weight: 900;
}

.primary-action {
  background: #111;
  color: #fffef9;
}

.primary-action:hover {
  background: #333;
}

.secondary-action {
  background: #fffef9;
  color: #111;
}

.secondary-action:hover {
  background: #eee9df;
}

.usage-strip {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #222;
  color: #555;
  font-size: .86rem;
}

.empty-state {
  display: grid;
  align-content: center;
  min-height: 300px;
  color: #333;
}

.empty-state p {
  max-width: 620px;
  line-height: 2;
}

.status-box {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #111;
  border-radius: 2px;
  background: #f0ede5;
  color: #111;
}

.progress-box,
.follow-up-item,
.answer-card,
.share-box,
.history-box {
  border: 1px solid #222;
  border-radius: 2px;
  background: #fffef9;
}

.progress-box {
  margin-bottom: 18px;
  padding: 16px;
}

.progress-box__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-box__top span,
.progress-box__top strong {
  color: #111;
  font-size: .9rem;
}

.thinking-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 1px solid #111;
  border-radius: 999px;
  background: #fffef9;
}

.thinking-bar {
  width: 14%;
  height: 100%;
  background: #111;
  transition: width .45s ease;
}

.progress-box p {
  margin: 12px 0 0;
  color: #555;
  font-size: .88rem;
  line-height: 1.8;
}

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

.section-heading strong {
  display: block;
  font-size: 1.2rem;
}

.follow-up-item {
  padding: 18px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.answer-grid {
  display: grid;
  gap: 16px;
}

.answer-card {
  padding: 24px;
}

.answer-card__top {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.stance,
.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fffef9;
  padding: 0 10px;
  font-size: .78rem;
  font-weight: 850;
}

.short-answer {
  margin: 10px 0 20px;
  padding: 20px;
  border-left: 5px solid #111;
  background: #f0ede5;
  color: #111;
  font-size: 1.24rem;
  font-weight: 900;
  line-height: 1.9;
}

.explanation {
  color: #333;
  line-height: 1.9;
}

.explanation h4 {
  margin: 26px 0 4px;
  color: #111;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.45;
}

.explanation h4:first-child {
  margin-top: 0;
}

.explanation p,
.explanation div {
  margin: 0 0 18px;
}

.explanation mark {
  padding: 1px 4px;
  background: #111;
  color: #fffef9;
}

.tiny-action {
  margin: 14px 0;
  padding: 14px;
  border-left: 4px solid #111;
  background: #f7f5ef;
  color: #111;
  line-height: 1.8;
}

.theory-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.theory-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d6d0c4;
  background: #fbfaf5;
}

.theory-item strong {
  color: #111;
}

.theory-section {
  display: grid;
  gap: 4px;
}

.theory-section p {
  margin: 0;
  color: #444;
  line-height: 1.7;
}

.theory-section small {
  color: #666;
  font-weight: 900;
  letter-spacing: .08em;
}

.reflection-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.reflection-item {
  width: 100%;
  border: 1px solid #111;
  border-radius: 2px;
  background: #fffef9;
  color: #111;
  padding: 12px 14px;
  text-align: left;
  line-height: 1.7;
}

.reflection-item::before {
  content: "问：";
  font-weight: 900;
}

.reflection-item:hover {
  background: #111;
  color: #fffef9;
}

.reflection-chat-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.share-box,
.history-box {
  margin-top: 18px;
  padding: 16px;
}

.history-box {
  scroll-margin-top: 84px;
}

.history-box > strong {
  display: block;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.history-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 12px;
  border: 1px solid #111;
  padding: 0 12px;
  color: #111;
  font-weight: 900;
  text-decoration: none;
}

.history-more:hover {
  background: #111;
  color: #fffef9;
}

.share-box {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.share-box strong {
  display: block;
  margin-bottom: 6px;
}

.share-box p {
  margin-bottom: 8px;
  color: #444;
  line-height: 1.75;
}

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

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.history-open {
  width: 100%;
  border: 1px solid #d6d0c4;
  background: #fbfaf5;
  color: #111;
  padding: 10px 12px;
  text-align: left;
}

.history-delete {
  min-height: 100%;
  border: 1px solid #111;
  background: #fffef9;
  color: #111;
  padding: 10px 12px;
}

.history-open strong,
.history-open span {
  display: block;
}

.history-open strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-open span {
  margin-top: 4px;
  color: #666;
  font-size: .84rem;
  line-height: 1.5;
}

.share-page {
  display: grid;
  place-items: center;
  min-height: 68vh;
}

.share-card {
  width: min(680px, 100%);
  border: 1px solid #111;
  border-radius: 2px;
  background: #fffef9;
  padding: 28px;
  box-shadow: 10px 10px 0 #111;
}

.share-card span {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-size: .78rem;
  font-weight: 900;
}

.share-card p {
  color: #333;
  line-height: 1.9;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 18px;
  border: 1px solid #111;
  border-radius: 2px;
  padding: 0 14px;
  color: #111;
  font-weight: 900;
  text-decoration: none;
}

.secondary-link:hover {
  background: #111;
  color: #fffef9;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-page {
  width: min(920px, 100%);
  margin: 0 auto;
}

.history-page__heading {
  margin-bottom: 22px;
}

.history-page__heading span {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.history-page__heading h1 {
  margin-bottom: 8px;
}

.history-page__heading p {
  color: #555;
  line-height: 1.9;
}

.history-page-list {
  display: grid;
  gap: 12px;
}

.history-page-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.history-page-open,
.history-page-delete {
  border: 1px solid #111;
  background: #fffef9;
  color: #111;
}

.history-page-open {
  padding: 16px;
  text-align: left;
}

.history-page-open:hover {
  background: #f0ede5;
}

.history-page-open span,
.reader-meta {
  display: block;
  margin-bottom: 8px;
  color: #666;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.history-page-open strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.02rem;
}

.history-page-open p {
  margin: 8px 0 0;
  color: #555;
  line-height: 1.7;
}

.history-page-delete {
  min-width: 70px;
  padding: 0 12px;
  font-weight: 900;
}

.history-empty {
  border: 1px solid #111;
  background: #fffef9;
  padding: 18px;
  color: #555;
}

.reader-open {
  overflow: hidden;
}

.reader-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, .72);
}

.reader-panel {
  position: relative;
  width: min(880px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid #111;
  background: #fffef9;
  box-shadow: 12px 12px 0 #111;
  padding: 34px;
}

.reader-close {
  position: sticky;
  top: 0;
  float: right;
  border: 1px solid #111;
  background: #111;
  color: #fffef9;
  padding: 8px 12px;
  font-weight: 900;
}

.reader-question {
  margin: 12px 0 22px;
  border-left: 4px solid #111;
  background: #f0ede5;
  padding: 14px;
  color: #111;
  line-height: 1.9;
}

.reader-answer {
  color: #2f2f2f;
  line-height: 2;
}

.reader-answer h4 {
  margin: 28px 0 6px;
  color: #111;
  font-size: 1.06rem;
  font-weight: 900;
}

.reader-answer h4:first-child {
  margin-top: 0;
}

.reader-answer p {
  margin: 0 0 18px;
}

.reader-theories {
  display: grid;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #111;
}

.reader-theories h3 {
  margin-bottom: 4px;
}

.reader-theory {
  border: 1px solid #d6d0c4;
  background: #fbfaf5;
  padding: 14px;
}

.reader-theory p {
  margin: 8px 0 0;
  color: #444;
  line-height: 1.8;
}

.hidden {
  display: none !important;
}

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

  .question-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-top: 16px;
  }

  .question-panel,
  .result-panel {
    padding: 18px;
    box-shadow: 6px 6px 0 #111;
  }

  h1 {
    font-size: 1.35rem;
  }

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

  .share-box {
    display: grid;
  }

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

  .history-page-delete {
    min-height: 40px;
  }

  .reader-panel {
    padding: 22px;
    box-shadow: 6px 6px 0 #111;
  }
}
