﻿:root {
  --bg: #f6f2e8;
  --panel: #fffdf8;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e4d8be;
  --brand: #0a9396;
  --active: #ee9b00;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 7% 92%, rgba(0, 150, 136, 0.28) 0 70px, transparent 72px),
    radial-gradient(circle at 95% 10%, rgba(238, 155, 0, 0.34) 0 84px, transparent 86px),
    var(--bg);
  overflow: auto;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  opacity: 0.2;
}

.bg-shape-1 {
  width: 240px;
  height: 240px;
  left: -90px;
  bottom: -70px;
  background: #0a9396;
}

.bg-shape-2 {
  width: 230px;
  height: 230px;
  right: -70px;
  top: -60px;
  background: #ee9b00;
}

.container {
  height: 100vh;
  max-width: 1840px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-logo {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.hero h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.05;
}

.hero p {
  margin: 6px 0 0;
  color: #4b5563;
}

.site-footer {
  text-align: center;
  padding: 12px 16px;
  margin-top: 8px;
  color: #6b7280;
  font-size: 13px;
}

.site-footer p {
  margin: 4px 0;
}

.site-footer a {
  color: var(--brand);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.chip-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid #d2c4a8;
  background: #fff8ec;
  color: #4a4336;
  border-radius: 999px;
  font-size: 13px;
  padding: 4px 10px;
}

.content-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 38%) minmax(620px, 62%);
  gap: 12px;
}

.panel {
  background: rgba(255, 253, 248, 0.97);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(64, 56, 36, 0.08);
  padding: 12px;
}

.panel h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.left-pane,
.right-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.left-pane-scroll,
.answer-scroll {
  margin-top: 10px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.detail-image-wrap {
  border: 1px dashed #d2c4a8;
  border-radius: 12px;
  background: #faf5e9;
  min-height: 300px;
  max-height: 46vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.empty-placeholder {
  color: #6b7280;
  font-size: 15px;
  text-align: center;
  padding: 20px;
}

.detail-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.section-title {
  margin: 10px 0 6px;
  font-size: 20px;
  font-weight: 700;
}

.detail-markdown {
  border: 1px solid #dfd1b5;
  background: #fffefb;
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.detail-markdown h1,
.detail-markdown h2,
.detail-markdown h3,
.detail-markdown h4,
.detail-markdown h5,
.detail-markdown h6 {
  margin: 8px 0 6px;
}

.detail-markdown p,
.detail-markdown li {
  margin: 6px 0;
}

.detail-markdown ol,
.detail-markdown ul {
  margin: 6px 0 6px 18px;
  padding: 0;
}

.detail-markdown pre {
  margin: 8px 0;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  padding: 10px;
  overflow-x: auto;
}

.detail-markdown code {
  background: #f1ede3;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: "Consolas", monospace;
}

.detail-markdown .code-lang {
  margin-top: 8px;
  margin-bottom: -4px;
  font-size: 12px;
  color: #4e5d78;
}

.detail-markdown pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.history-toggle {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  border-radius: 12px 0 0 12px;
  border: 1px solid #7f9d9f;
  border-right: 0;
  padding: 16px 10px;
  min-width: 44px;
  color: #fff;
  background: linear-gradient(180deg, var(--brand), #0a9396);
  box-shadow: 0 8px 18px rgba(0, 95, 115, 0.28);
  z-index: 80;
}

.history-drawer {
  position: fixed;
  right: 0;
  top: 10px;
  bottom: 10px;
  width: min(380px, 90vw);
  transform: translateX(calc(100% + 12px));
  transition: transform 0.25s ease;
  z-index: 70;
  display: flex;
  flex-direction: column;
  border-radius: 14px 0 0 14px;
}

.history-drawer.open {
  transform: translateX(0);
}

.history-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-close-btn {
  color: #fff;
  background: linear-gradient(90deg, #6b7280, #4b5563);
  padding: 6px 10px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  flex: 1;
  padding-right: 2px;
}

.history-item {
  border: 1px solid #d9ccb2;
  border-radius: 10px;
  padding: 9px;
  background: #fffdfa;
  cursor: pointer;
}

.history-item:hover {
  border-color: #c7b58f;
}

.history-item.active {
  border-color: var(--active);
  box-shadow: 0 0 0 2px rgba(238, 155, 0, 0.2);
}

.history-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

.history-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d4c7ad;
  margin-bottom: 5px;
}

.history-snippet {
  margin: 0;
  font-size: 12px;
  color: #38352f;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1200px) {
  .content-workspace {
    grid-template-columns: 1fr;
  }

  .left-pane,
  .right-pane {
    min-height: 42vh;
  }

  body {
    overflow: auto;
  }

  .container {
    height: auto;
    min-height: 100vh;
  }
}
