:root {
  --bg: #f3efe7;
  --panel: rgba(255, 250, 242, 0.9);
  --panel-strong: #fffaf2;
  --line: rgba(126, 88, 46, 0.18);
  --text: #2e2419;
  --muted: #78644b;
  --accent: #b35c1e;
  --accent-soft: rgba(179, 92, 30, 0.12);
  --shadow: 0 18px 45px rgba(70, 40, 9, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 213, 179, 0.6), transparent 30%),
    radial-gradient(circle at right, rgba(222, 199, 160, 0.7), transparent 28%),
    linear-gradient(180deg, #f8f1e7, #efe7da 42%, #ede3d3);
  min-height: 100vh;
}

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

.shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

.topbar,
.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  align-items: flex-start;
}

.topbar h1,
.detail h2,
.panel h2,
.panel h3 {
  margin: 0;
}

.subtext,
.muted,
.empty-list,
.empty-state p {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.header-actions,
.voice-actions,
.chip-row,
.meta-row,
.panel-title-row,
.detail-layout,
.note-card-top,
.note-card-bottom {
  display: flex;
  gap: 10px;
}

.header-actions,
.voice-actions {
  flex-wrap: wrap;
}

.ghost-button,
button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ghost-button {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(179, 92, 30, 0.28);
}

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

.stats-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px 20px;
}

.stat-card p {
  margin: 0 0 8px;
  color: var(--muted);
}

.stat-card strong {
  font-size: 28px;
}

.workspace {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
}

.panel-header,
.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.filters {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.chip {
  background: rgba(120, 100, 75, 0.08);
  color: var(--text);
}

.chip.active,
.plan-chip {
  background: var(--accent-soft);
  color: var(--accent);
}

.label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.text-input,
.text-area {
  width: 100%;
  border: 1px solid rgba(120, 100, 75, 0.2);
  border-radius: 14px;
  background: var(--panel-strong);
  padding: 12px 14px;
  color: var(--text);
}

.text-area {
  min-height: 320px;
  resize: vertical;
}

.small-area {
  min-height: 100px;
}

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

.note-card {
  display: grid;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(120, 100, 75, 0.15);
  background: var(--panel-strong);
  color: inherit;
}

.note-card.active {
  border-color: rgba(179, 92, 30, 0.45);
  background: linear-gradient(180deg, rgba(255, 239, 222, 0.95), rgba(255, 247, 237, 0.95));
}

.note-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.note-card strong {
  font-size: 15px;
}

.badge,
.meta-tag,
.mini-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(120, 100, 75, 0.08);
  font-size: 12px;
}

.mini-status {
  margin-left: auto;
}

.note-card-bottom,
.note-card-top,
.meta-row {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.detail {
  min-height: 70vh;
}

.voice-card {
  width: 240px;
}

.detail-layout {
  margin-top: 18px;
  align-items: start;
}

.markdown-panel,
.editor-panel {
  min-width: 0;
  flex: 1 1 0;
}

.panel-title-row {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tiny-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

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

.plan-buttons {
  margin-bottom: 14px;
}

.markdown-body {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(120, 100, 75, 0.12);
  background: rgba(255, 255, 255, 0.54);
  overflow: auto;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-top: 1.2em;
}

.markdown-body img {
  max-width: 100%;
  border-radius: 14px;
}

.markdown-body pre,
.markdown-body code {
  font-family: "Cascadia Code", "Consolas", monospace;
}

.markdown-body pre {
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: #2a2116;
  color: #f6ecdc;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid rgba(120, 100, 75, 0.18);
  padding: 10px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 60vh;
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #2e2419;
  color: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 1080px) {
  .stats-grid,
  .workspace,
  .detail-layout,
  .form-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .voice-card {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 12px;
  }

  .topbar,
  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .topbar,
  .panel-header,
  .detail-header,
  .panel-title-row {
    flex-direction: column;
  }

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