:root {
  --bg: #f6f4ef;
  --paper: #fffdf8;
  --ink: #1d2427;
  --muted: #667074;
  --line: #d9d3c8;
  --teal: #2f7f7a;
  --teal-dark: #1d5655;
  --copper: #a8653f;
  --graphite: #273033;
  --shadow: 0 18px 50px rgba(38, 43, 43, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button, input { font: inherit; }
.app-shell { display: grid; grid-template-columns: 292px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #ebe6dc;
  border-right: 1px solid var(--line);
  overflow: auto;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 24px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47,127,122,.95), rgba(168,101,63,.92)),
    radial-gradient(circle at 70% 20%, #fff 0 10%, transparent 11%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.brand strong { display: block; line-height: 1.25; }
.brand small { display: block; color: var(--muted); margin-top: 3px; }
.search-wrap { margin-bottom: 18px; }
.search-wrap input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c7c0b4;
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255,255,255,.72);
  outline: none;
}
.search-wrap input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(47,127,122,.16); }
.nav { display: grid; gap: 6px; }
.nav a {
  display: block;
  padding: 10px 11px;
  border-radius: 8px;
  color: #344044;
  text-decoration: none;
  border: 1px solid transparent;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,.64); border-color: #d0c9bd; color: var(--teal-dark); }
.main { min-width: 0; padding: 24px clamp(18px, 4vw, 54px) 64px; }
.hero {
  min-height: 360px;
  position: relative;
  display: grid;
  align-items: stretch;
  overflow: hidden;
  border-radius: 8px;
  background: var(--graphite);
  box-shadow: var(--shadow);
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16,20,21,.86) 0%, rgba(16,20,21,.64) 36%, rgba(16,20,21,.18) 72%, rgba(16,20,21,.05) 100%);
}
.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 670px;
  padding: clamp(28px, 5vw, 58px);
  color: #fffdf8;
  align-self: center;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--copper);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 700;
}
.hero .eyebrow { color: #e8b787; }
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(34px, 6vw, 64px); line-height: 1.05; }
.hero p:not(.eyebrow) { color: rgba(255,255,255,.86); font-size: 18px; line-height: 1.75; margin: 18px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
}
.primary { background: var(--teal); color: white; }
.secondary { background: rgba(255,255,255,.18); color: white; border: 1px solid rgba(255,255,255,.42); }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 18px 0 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}
.metrics div { background: var(--paper); padding: 18px 20px; }
.metrics strong { font-size: 30px; display: block; }
.metrics span { color: var(--muted); font-size: 14px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.section-heading { margin-bottom: 16px; }
.section-heading h2 { font-size: 28px; }
.section-heading.compact h2 { font-size: 22px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card, .panel, .detail-card, .qa-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.card {
  padding: 18px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(38,43,43,.1); border-color: rgba(47,127,122,.35); }
.card h3 { font-size: 20px; margin-bottom: 8px; }
.card p { color: var(--muted); line-height: 1.65; margin: 0 0 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border: 1px solid #d4c7bb; color: #6e5543; border-radius: 999px; padding: 4px 8px; font-size: 12px; background: #fbf7ee; }
.panel { padding: 20px; position: sticky; top: 20px; }
.panel p, .panel li { color: var(--muted); line-height: 1.75; }
.panel ul { padding-left: 18px; margin-bottom: 0; }
.detail { margin: 34px 0; }
.detail-card { padding: clamp(20px, 3vw, 30px); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
.detail-card h2 { font-size: 32px; margin-bottom: 12px; }
.detail-card p { line-height: 1.8; color: var(--muted); }
.note-list { display: grid; gap: 10px; margin-top: 18px; }
.note-list div { padding: 12px 14px; border-left: 4px solid var(--teal); background: #f3f1eb; border-radius: 6px; line-height: 1.7; }
.related { background: #f3f1eb; border-radius: 8px; padding: 16px; }
.related h3 { font-size: 17px; margin-bottom: 10px; }
.related button { display: block; width: 100%; margin-top: 8px; text-align: left; background: white; border: 1px solid var(--line); color: var(--ink); }
.qa-section { margin-top: 36px; }
.literature-section { margin-top: 36px; }
.research-section { margin-top: 36px; }
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
}
.filter-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}
.filter-row select {
  min-width: 150px;
  min-height: 38px;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--paper);
  color: var(--ink);
}
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.research-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 17px;
}
.research-card h3 { font-size: 20px; line-height: 1.35; margin-bottom: 8px; }
.research-card p { color: #3d4648; line-height: 1.7; margin: 8px 0 0; }
.field-grid { display: grid; gap: 8px; margin-top: 12px; }
.field-grid div {
  background: #f3f1eb;
  border-radius: 6px;
  padding: 10px 11px;
  line-height: 1.65;
}
.field-grid strong { color: var(--teal-dark); }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: #e8f1ee;
  color: var(--teal-dark);
  border: 1px solid #c9ddda;
}
.badge.priority-high { background: #f8e5dc; color: #8a4429; border-color: #ecc7b7; }
.badge.priority-mid { background: #f7efd8; color: #7a6020; border-color: #e5d39f; }
.roadmap-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.roadmap-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  position: relative;
}
.roadmap-card::before {
  content: attr(data-step);
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  margin-bottom: 12px;
  font-weight: 700;
}
.roadmap-card h3 { font-size: 20px; margin-bottom: 8px; }
.roadmap-card p { color: var(--muted); line-height: 1.65; }
.roadmap-card ul { padding-left: 18px; color: #3d4648; line-height: 1.65; }
.link-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  overflow: hidden;
}
.link-stats div { background: var(--paper); padding: 14px 16px; }
.link-stats strong { display: block; font-size: 24px; }
.link-stats span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.folder-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.folder-tab { background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.folder-tab.active { background: var(--teal); color: white; border-color: var(--teal); }
.literature-list { display: grid; gap: 14px; }
.workbench-section { margin-top: 36px; }
.workbench-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.gpt-panel, .notes-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.gpt-panel { position: sticky; top: 20px; }
.gpt-panel h3, .notes-panel h3 { margin: 0 0 8px; font-size: 21px; }
.gpt-panel p, .notes-toolbar p { margin: 0 0 14px; color: var(--muted); line-height: 1.65; }
.gpt-actions { display: grid; gap: 8px; margin-bottom: 16px; }
.open-gpt {
  display: block;
  text-align: center;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  text-decoration: none;
}
.secondary-link { background: #ede4da; color: var(--ink); border: 1px solid var(--line); }
.prompt-box {
  background: #f3f1eb;
  border-radius: 8px;
  padding: 14px;
}
.prompt-box h4 { margin: 0 0 10px; }
.prompt-box select, .prompt-box textarea, .note-form select, .note-form input, .note-form textarea {
  width: 100%;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}
.prompt-box select, .note-form select, .note-form input { min-height: 40px; padding: 0 10px; }
.prompt-box textarea {
  min-height: 190px;
  resize: vertical;
  padding: 10px;
  margin: 9px 0;
  line-height: 1.6;
}
.copy-prompt, #save-note, #export-notes { background: var(--teal); color: white; }
.notes-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}
.note-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #f3f1eb;
  margin-bottom: 14px;
}
.note-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.note-form .wide { grid-column: 1 / -1; }
.note-form textarea {
  min-height: 130px;
  resize: vertical;
  padding: 10px;
  line-height: 1.65;
}
.notes-list { display: grid; gap: 10px; }
.note-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 13px 14px;
}
.note-item h4 { margin: 0 0 6px; font-size: 17px; }
.note-item p { margin: 8px 0 0; color: #394346; line-height: 1.7; white-space: pre-wrap; }
.note-meta { color: var(--muted); font-size: 13px; line-height: 1.5; }
.note-actions { display: flex; gap: 8px; margin-top: 10px; }
.note-actions button { min-height: 34px; background: #f3f1eb; border: 1px solid var(--line); color: var(--ink); }
.literature-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.literature-item summary {
  display: contents;
  cursor: pointer;
}
.literature-item summary::-webkit-details-marker { display: none; }
.lit-toggle {
  margin-top: 12px;
  color: var(--teal-dark);
  font-weight: 700;
}
.literature-item[open] .lit-toggle::after { content: "收起精读详情"; }
.literature-item:not([open]) .lit-toggle::after { content: "展开精读详情"; }
.lit-details {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.literature-item h3 { font-size: 21px; line-height: 1.35; margin-bottom: 6px; }
.lit-meta { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 10px; }
.lit-summary { color: #3b4548; line-height: 1.75; margin: 12px 0; }
.lit-grid { display: grid; gap: 8px; margin-top: 12px; }
.lit-grid div { background: #f3f1eb; border-radius: 6px; padding: 11px 12px; line-height: 1.7; }
.lit-grid strong { color: var(--teal-dark); }
.lit-side { background: #f3f1eb; border-radius: 8px; padding: 14px; align-self: start; }
.lit-side h4 { margin: 0 0 9px; font-size: 15px; }
.file-links { display: grid; gap: 7px; margin-bottom: 12px; }
.file-links a {
  display: block;
  padding: 9px 10px;
  border-radius: 7px;
  background: white;
  border: 1px solid var(--line);
  color: var(--teal-dark);
  text-decoration: none;
  line-height: 1.35;
}
.doi-link { overflow-wrap: anywhere; color: var(--muted); font-size: 13px; line-height: 1.5; }
.open-pdf {
  display: block;
  text-align: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--teal);
  color: white !important;
  text-decoration: none;
  margin-bottom: 10px;
}
.qa-list { display: grid; gap: 12px; }
.qa-item summary {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}
.qa-item summary::-webkit-details-marker { display: none; }
.role {
  min-width: 76px;
  text-align: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  background: #e8f1ee;
  color: var(--teal-dark);
}
.role.assistant { background: #f2e8dd; color: #794b2f; }
.qa-title { font-weight: 700; line-height: 1.45; }
.qa-body {
  padding: 0 20px 20px;
  color: #2f373a;
  line-height: 1.8;
  white-space: pre-wrap;
}
.empty {
  padding: 28px;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 8px;
}
mark { background: #f7dc9b; padding: 0 2px; border-radius: 3px; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .layout, .detail-grid, .literature-item, .workbench-grid, .research-grid, .roadmap-list { grid-template-columns: 1fr; }
  .panel, .gpt-panel { position: static; }
}
@media (max-width: 680px) {
  .main { padding: 14px 14px 42px; }
  .hero { min-height: 430px; }
  .hero::after { background: linear-gradient(180deg, rgba(16,20,21,.86), rgba(16,20,21,.42)); }
  .hero-copy { align-self: end; padding: 24px; }
  .cards, .metrics, .link-stats { grid-template-columns: 1fr; }
  h1 { font-size: 38px; }
  .qa-item summary { align-items: flex-start; flex-direction: column; }
.note-form { grid-template-columns: 1fr; }
  .notes-toolbar { display: grid; }
}

/* Compact editable workbench layer */
.page { display: none; }
.page.active { display: block; }
.sidebar-tools {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}
.tool-btn,
.action-btn,
.danger-btn,
.ghost-btn,
.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
  text-decoration: none;
}
.tool-btn,
.ghost-btn,
.small-btn { background: var(--paper); color: var(--ink); }
.action-btn { background: var(--teal); color: white; border-color: var(--teal); }
.danger-btn { background: #f8e5dc; color: #8a4429; border-color: #ecc7b7; }
.import-label input { display: none; }
.work-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.work-header h1,
.work-header h2 { margin: 0; }
.work-header p { margin: 7px 0 0; color: var(--muted); line-height: 1.65; }
.home-hero-card {
  position: relative;
  min-height: 280px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #1f2c2c;
  box-shadow: var(--shadow);
}
.home-hero-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(21, 28, 28, .86), rgba(21, 28, 28, .42), rgba(21, 28, 28, .12));
}
.home-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 42px;
  color: white;
}
.home-hero-copy .eyebrow { color: rgba(255, 255, 255, .74); }
.home-hero-copy h1 {
  margin: 8px 0 12px;
  font-size: 44px;
  line-height: 1.12;
  letter-spacing: 0;
}
.home-hero-copy p {
  margin: 0;
  max-width: 680px;
  color: rgba(255, 255, 255, .86);
  line-height: 1.75;
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 16px;
}
.work-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.work-card h3 { margin: 0 0 10px; font-size: 20px; }
.work-card p,
.work-card li { color: #3d4648; line-height: 1.7; }
.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.card-title-row h3 { margin: 0; }
.home-textarea {
  width: 100%;
  min-height: 148px;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.7;
}
.todo-list {
  display: grid;
  gap: 9px;
}
.todo-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #ded7cb;
  border-radius: 8px;
  background: #f8f6f0;
}
.todo-edit-input {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
  cursor: grab;
  overflow: hidden;
  text-overflow: clip;
  touch-action: pan-x;
}
.todo-edit-input:hover { border-color: rgba(29, 86, 85, .32); }
.todo-edit-input.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.todo-item.done .todo-edit-input {
  color: var(--muted);
  text-decoration: line-through;
}
.workbench-grid {
  display: grid;
  grid-template-columns: minmax(240px, .85fr) minmax(300px, 1.05fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}
.workbench-textarea {
  width: 100%;
  min-height: 150px;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.65;
}
.template-list,
.workbench-note-list {
  display: grid;
  gap: 10px;
}
.template-item,
.workbench-note {
  border: 1px solid #ded7cb;
  border-radius: 8px;
  background: #f8f6f0;
  padding: 12px;
}
.template-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.template-item p {
  margin: 6px 0 0;
  color: #3d4648;
  line-height: 1.65;
}
.note-title-input {
  width: 100%;
  min-height: 38px;
  margin-bottom: 8px;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 700;
}
.note-body-input {
  min-height: 118px;
}
.reading-workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
  align-items: start;
}
.reading-main,
.reading-side {
  display: grid;
  gap: 16px;
}
.reading-card {
  min-height: calc(100vh - 150px);
}
.reading-content-input {
  width: 100%;
  min-height: 360px;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.75;
}
.reading-preview {
  width: 100%;
  min-height: 560px;
  margin-top: 12px;
  border: 1px solid #ded7cb;
  border-radius: 8px;
  background: white;
}
.prompt-guide-card {
  padding: 14px;
}
.compact-template-list {
  gap: 8px;
}
.prompt-guide-item {
  display: block;
  padding: 10px;
}
.prompt-guide-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--teal-dark);
}
.prompt-guide-item p {
  font-size: 13px;
  line-height: 1.6;
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
}
.toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}
.toolbar select,
.toolbar input {
  min-height: 38px;
  min-width: 150px;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--paper);
  color: var(--ink);
}
.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.editable-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.editable-card summary {
  cursor: pointer;
  list-style: none;
}
.editable-card summary::-webkit-details-marker { display: none; }
.editable-card h3 { margin: 0 0 7px; font-size: 20px; line-height: 1.35; }
.card-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.detail-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.detail-list div {
  background: #f3f1eb;
  border-radius: 6px;
  padding: 10px 11px;
  line-height: 1.65;
}
.detail-list strong { color: var(--teal-dark); }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.tab-btn {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}
.tab-btn.active {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
.archive-group {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 14px 16px;
}
.archive-group summary { cursor: pointer; font-weight: 700; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 24, 25, .42);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal[hidden] { display: none; }
.modal-panel {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--paper);
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.modal-head {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 22px; }
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  font-size: 22px;
  line-height: 1;
}
.modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}
.modal-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.modal-form .wide { grid-column: 1 / -1; }
.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 10px;
}
.modal-form textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.muted { color: var(--muted); }

@media (max-width: 980px) {
  .home-grid,
  .reading-workbench-layout,
  .workbench-grid,
  .compact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .work-header { display: grid; }
  .home-hero-card { min-height: 240px; }
  .home-hero-copy { padding: 28px; }
  .home-hero-copy h1 { font-size: 34px; }
  .todo-item { grid-template-columns: auto minmax(0, 1fr); }
  .todo-item .small-btn,
  .todo-item .danger-btn { grid-column: 2; }
  .template-item { grid-template-columns: 1fr; }
  .modal-form { grid-template-columns: 1fr; }
}

/* Research desk polish */
h1 { font-size: clamp(36px, 4vw, 44px); line-height: 1.12; }
.work-header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(217, 211, 200, .72);
}
.work-header h1 { font-size: clamp(36px, 3.4vw, 42px); line-height: 1.12; }
.work-header p:not(.eyebrow) {
  max-width: 680px;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.55;
}
.eyebrow {
  margin-bottom: 6px;
  color: #7c6a52;
}
.main { padding-top: 20px; }

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}
.brand {
  margin-bottom: 18px;
  padding: 8px;
  border-radius: 8px;
}
.brand strong { font-size: 15px; }
.nav { gap: 7px; }
.nav a {
  position: relative;
  padding: 11px 12px 11px 16px;
  font-weight: 600;
}
.nav a.active {
  background: #fbf8f1;
  border-color: rgba(29, 86, 85, .34);
  color: var(--teal-dark);
  box-shadow: inset 4px 0 0 var(--teal-dark), 0 6px 18px rgba(39, 48, 51, .06);
}
.sidebar-tools {
  margin-top: auto;
  padding-top: 18px;
}
.tool-btn {
  min-height: 34px;
  color: #6f7779;
  background: rgba(255, 253, 248, .52);
  border-color: rgba(217, 211, 200, .68);
}

button,
.tool-btn,
.action-btn,
.danger-btn,
.ghost-btn,
.small-btn,
.tab-btn {
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.action-btn,
.primary {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #fff;
}
.action-btn:hover,
.primary:hover { background: #174b49; }
.ghost-btn,
.small-btn,
.secondary,
.tab-btn {
  background: #fbf8f1;
  color: #273033;
  border-color: rgba(217, 211, 200, .9);
}
.ghost-btn:hover,
.small-btn:hover,
.tab-btn:hover {
  border-color: rgba(29, 86, 85, .28);
  color: var(--teal-dark);
}
.danger-btn {
  background: #fbf4ef;
  color: #8a4429;
  border-color: #ead4ca;
}
.danger-btn:hover {
  background: #f6e8df;
  border-color: #d7b7a8;
}
.tab-btn.active,
.folder-tab.active {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #fff;
}

.home-hero-card {
  min-height: 238px;
  margin-bottom: 14px;
  box-shadow: 0 14px 34px rgba(38, 43, 43, .1);
}
.home-hero-copy {
  max-width: 700px;
  padding: clamp(26px, 4vw, 36px);
}
.home-hero-copy h1 {
  margin: 6px 0 10px;
  font-size: clamp(36px, 4vw, 44px);
}
.home-hero-copy p { max-width: 600px; font-size: 15px; line-height: 1.65; }
.home-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 14px; }
.home-grid .work-card:nth-child(3) { grid-column: 1 / -1; }

.work-card,
.editable-card,
.archive-group,
.gpt-panel,
.notes-panel {
  border-color: rgba(217, 211, 200, .82);
  box-shadow: 0 6px 20px rgba(38, 43, 43, .045);
}
.work-card,
.editable-card {
  padding: 14px;
}
.work-card h3,
.editable-card h3 {
  font-size: 18px;
  line-height: 1.35;
}
.editable-card summary,
.workbench-note summary,
.archive-group summary {
  position: relative;
  list-style: none;
  padding-right: 28px;
}
.editable-card summary::after,
.workbench-note summary::after,
.archive-group summary::after {
  content: "+";
  position: absolute;
  top: 0;
  right: 2px;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eef3ef;
  color: var(--teal-dark);
  font-weight: 700;
}
.editable-card[open] summary::after,
.workbench-note[open] summary::after,
.archive-group[open] summary::after { content: "−"; }
.card-meta { min-height: 20px; }
.detail-list {
  padding-top: 10px;
  border-top: 1px solid rgba(217, 211, 200, .72);
}
.detail-list div {
  padding: 9px 10px;
  background: #f7f4ee;
  font-size: 14px;
  line-height: 1.6;
}
.toolbar,
.tabs {
  padding: 10px;
  border: 1px solid rgba(217, 211, 200, .76);
  border-radius: 8px;
  background: rgba(255, 253, 248, .58);
}
.toolbar { align-items: end; }
.compact-grid { gap: 12px; }

.reading-workbench-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 14px;
}
.reading-card { min-height: calc(100vh - 126px); }
.reading-content-input { min-height: 400px; }
.reading-side {
  position: sticky;
  top: 16px;
}
.workbench-notes-card {
  min-height: 420px;
}
.workbench-note {
  padding: 0;
  overflow: hidden;
}
.workbench-note summary {
  display: block;
  cursor: pointer;
  padding: 12px 42px 12px 12px;
}
.workbench-note summary span {
  display: grid;
  gap: 4px;
}
.workbench-note summary strong {
  font-size: 15px;
  line-height: 1.4;
}
.workbench-note summary small {
  color: var(--muted);
  font-size: 12px;
}
.workbench-note[open] {
  padding: 0 12px 12px;
}
.workbench-note[open] summary {
  margin: 0 -12px 12px;
  border-bottom: 1px solid rgba(217, 211, 200, .74);
  background: #fbf8f1;
}
.note-body-input { min-height: 184px; }

.prompt-guide-card {
  padding: 12px;
  background: rgba(255, 253, 248, .72);
}
.prompt-guide-card h3 { font-size: 16px; }
.prompt-guide-item {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px;
  background: #f7f4ee;
}
.template-toggle {
  min-height: 34px;
  justify-content: flex-start;
  padding: 0 10px;
  background: transparent;
  color: #2f373a;
  border: 1px solid transparent;
  font-weight: 700;
  text-align: left;
}
.template-toggle.active {
  background: #eef3ef;
  border-color: rgba(29, 86, 85, .22);
  color: var(--teal-dark);
}
.prompt-guide-item p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding: 9px 10px;
  border-radius: 7px;
  background: #fffdf8;
}
.is-collapsed { display: none; }

@media (max-width: 980px) {
  .reading-side { position: static; }
}

@media (max-width: 680px) {
  h1,
  .work-header h1,
  .home-hero-copy h1 { font-size: 36px; }
  .home-hero-card { min-height: 220px; }
  .home-hero-copy { padding: 24px; }
  .home-grid .work-card:nth-child(3) { grid-column: auto; }
  .toolbar,
  .tabs { padding: 8px; }
}

/* Collapsible left guide */
.app-shell {
  transition: grid-template-columns .22s ease;
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 8px;
}
.brand-toggle {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  border: 1px solid rgba(29, 86, 85, .24);
  border-radius: 8px;
  background: #fbf8f1;
  box-shadow: 0 8px 18px rgba(38, 43, 43, .09);
}
.brand-toggle:hover {
  border-color: rgba(29, 86, 85, .46);
  box-shadow: 0 10px 22px rgba(38, 43, 43, .12);
  transform: translateY(-1px);
}
.brand-mark {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  background: url("assets/brand-layered-skin.png") center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42);
}
.brand-title {
  color: var(--ink);
  text-decoration: none;
  line-height: 1.25;
}
.brand-title strong {
  display: block;
  font-size: 15px;
}
.app-shell.sidebar-collapsed .sidebar {
  align-items: center;
  overflow: hidden;
  padding-left: 11px;
  padding-right: 11px;
}
.app-shell.sidebar-collapsed .brand {
  justify-content: center;
  width: 100%;
  padding: 0;
}
.app-shell.sidebar-collapsed .brand-title,
.app-shell.sidebar-collapsed .nav,
.app-shell.sidebar-collapsed .sidebar-tools {
  display: none;
}
.app-shell.sidebar-collapsed .brand-toggle {
  width: 54px;
  height: 54px;
  min-height: 54px;
  border-radius: 999px;
}
.app-shell.sidebar-collapsed .brand-mark {
  border-radius: 999px;
}
.tool-btn {
  min-height: 38px;
  background: #fffdf8;
  color: #273033;
  border-color: #cfc7ba;
  font-weight: 600;
}
.tool-btn:hover {
  border-color: rgba(29, 86, 85, .34);
  color: var(--teal-dark);
  background: #fbf8f1;
}

@media (max-width: 980px) {
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .app-shell.sidebar-collapsed .sidebar {
    align-items: stretch;
    overflow: auto;
  }
  .app-shell.sidebar-collapsed .brand {
    justify-content: flex-start;
  }
  .app-shell.sidebar-collapsed .brand-title,
  .app-shell.sidebar-collapsed .nav,
  .app-shell.sidebar-collapsed .sidebar-tools {
    display: grid;
  }
  .app-shell.sidebar-collapsed .brand-toggle,
  .app-shell.sidebar-collapsed .brand-mark {
    border-radius: 8px;
  }
}

/* Sidebar proportion and quieter utility controls */
.app-shell {
  grid-template-columns: 244px minmax(0, 1fr);
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}
.sidebar {
  padding-left: 12px;
  padding-right: 12px;
}
.brand {
  gap: 9px;
  margin-bottom: 16px;
}
.brand-toggle {
  width: 44px;
  height: 44px;
  min-height: 44px;
  box-shadow: 0 5px 14px rgba(38, 43, 43, .07);
}
.brand-mark {
  opacity: .6;
}
.app-shell.sidebar-collapsed .sidebar {
  padding-left: 9px;
  padding-right: 9px;
}
.app-shell.sidebar-collapsed .brand-toggle {
  width: 46px;
  height: 46px;
  min-height: 46px;
  box-shadow: 0 5px 14px rgba(38, 43, 43, .06);
}
.app-shell.sidebar-collapsed .brand-mark {
  opacity: .5;
  filter: blur(.7px) saturate(.86);
}
.nav a {
  padding: 10px 10px 10px 14px;
}
.tool-btn {
  min-height: 34px;
  background: rgba(255, 253, 248, .42);
  color: #767e7f;
  border-color: rgba(207, 199, 186, .48);
  font-weight: 500;
  box-shadow: none;
}
.tool-btn:hover {
  background: rgba(255, 253, 248, .72);
  color: #526062;
  border-color: rgba(207, 199, 186, .72);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
}

/* Compact visual polish */
:root {
  --line-soft: rgba(217, 211, 200, .58);
  --line-softer: rgba(217, 211, 200, .42);
  --soft-shadow: 0 4px 14px rgba(38, 43, 43, .035);
}
body { font-size: 14px; }
.main {
  padding-top: 16px;
  padding-bottom: 42px;
}
h1 { font-size: clamp(32px, 3.1vw, 38px); }
.work-header {
  margin-bottom: 10px;
  padding-bottom: 9px;
}
.work-header h1 { font-size: clamp(31px, 2.9vw, 37px); }
.work-header p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.45;
}
.eyebrow {
  font-size: 11px;
  margin-bottom: 4px;
}

.home-hero-card {
  min-height: 180px;
  margin-bottom: 10px;
  border-color: var(--line-soft);
  box-shadow: var(--soft-shadow);
}
.home-hero-card::after {
  background: linear-gradient(90deg, rgba(21, 28, 28, .76), rgba(21, 28, 28, .34), rgba(21, 28, 28, .08));
}
.home-hero-copy {
  max-width: 610px;
  padding: clamp(20px, 3vw, 28px);
}
.home-hero-copy h1 {
  margin: 4px 0 7px;
  font-size: clamp(32px, 3.4vw, 38px);
}
.home-hero-copy p {
  max-width: 540px;
  font-size: 13px;
  line-height: 1.48;
}
.home-grid {
  gap: 10px;
}

.work-card,
.editable-card,
.archive-group,
.gpt-panel,
.notes-panel,
.workbench-note,
.template-item {
  border-color: var(--line-soft);
  border-radius: 7px;
  box-shadow: var(--soft-shadow);
}
.work-card,
.editable-card {
  padding: 11px;
}
.work-card h3,
.editable-card h3 {
  font-size: 16px;
  line-height: 1.3;
}
.work-card p,
.work-card li,
.editable-card,
.detail-list div,
.qa-body,
.archive-group p,
.archive-group li {
  font-size: 13px;
  line-height: 1.52;
}
.card-title-row {
  margin-bottom: 8px;
}
.compact-grid {
  gap: 10px;
}
.card-actions,
.quick-actions,
.todo-list,
.template-list,
.workbench-note-list {
  gap: 7px;
}
.detail-list {
  gap: 6px;
  margin-top: 9px;
  padding-top: 8px;
  border-top-color: var(--line-softer);
}
.detail-list div {
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(247, 244, 238, .72);
}

button,
.tool-btn,
.action-btn,
.danger-btn,
.ghost-btn,
.small-btn,
.tab-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
}
.icon-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
}
.toolbar,
.tabs {
  gap: 7px;
  padding: 7px;
  margin-bottom: 10px;
  border-color: var(--line-soft);
  background: rgba(255, 253, 248, .42);
}
.toolbar label {
  gap: 4px;
  font-size: 12px;
}
.toolbar select,
.toolbar input,
.modal-form input,
.modal-form select,
.prompt-box select,
.note-form select,
.note-form input,
.note-title-input,
.todo-edit-input {
  min-height: 34px;
  border-color: rgba(207, 199, 186, .66);
  border-radius: 7px;
  padding-left: 9px;
  padding-right: 9px;
  background: rgba(255, 255, 255, .88);
  font-size: 13px;
}
.modal-form textarea,
.prompt-box textarea,
.note-form textarea,
.home-textarea,
.workbench-textarea,
.reading-content-input {
  border-color: rgba(207, 199, 186, .66);
  border-radius: 7px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, .9);
  font-size: 13px;
  line-height: 1.5;
}
.home-textarea {
  min-height: 108px;
}
.workbench-textarea {
  min-height: 112px;
}
.note-body-input {
  min-height: 136px;
}
.reading-content-input {
  min-height: 285px;
}
.reading-card {
  min-height: auto;
}
.workbench-notes-card { min-height: auto; }
.reading-preview {
  min-height: 390px;
}
.modal-form {
  gap: 9px;
  padding: 14px;
}
.modal-head {
  padding: 12px 14px;
}
.modal-head h2 {
  font-size: 19px;
}
.todo-item {
  gap: 6px;
  padding: 6px;
  border-color: var(--line-soft);
  background: rgba(248, 246, 240, .66);
}
.badge,
.tag {
  padding: 3px 7px;
  font-size: 11px;
}
.brand-title strong {
  font-size: 14px;
}
.nav {
  gap: 5px;
}
.nav a {
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 13px;
}

@media (max-width: 680px) {
  .main {
    padding: 12px 12px 34px;
  }
  h1,
  .work-header h1,
  .home-hero-copy h1 {
    font-size: 31px;
  }
  .home-hero-card {
    min-height: 172px;
  }
  .home-hero-copy {
    padding: 18px;
  }
  .home-hero-copy p {
    font-size: 12.5px;
  }
  .reading-content-input {
    min-height: 230px;
  }
  .reading-preview {
    min-height: 300px;
  }
}

/* Home cover and editable entry panels */
#home {
  min-height: calc(100vh - 32px);
}
.home-hero-card {
  height: 50vh;
  min-height: 360px;
  max-height: 560px;
  margin-bottom: 0;
  border-color: transparent;
  box-shadow: none;
}
.home-hero-card img {
  z-index: 0;
}
.home-hero-card::after {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(246, 244, 239, 0) 58%, rgba(246, 244, 239, .86) 100%),
    linear-gradient(90deg, rgba(21, 28, 28, .74), rgba(21, 28, 28, .28), rgba(21, 28, 28, .05));
}
.home-hero-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  height: 34%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(246, 244, 239, 0), #f6f4ef 82%);
}
.home-hero-copy {
  z-index: 3;
  padding: clamp(28px, 4vw, 46px);
}
.home-hero-copy h1 {
  font-size: clamp(36px, 4.2vw, 44px);
}
.home-hero-copy p {
  font-size: 14px;
}
.home-grid {
  position: relative;
  z-index: 3;
  margin-top: -20px;
  padding-top: 22px;
  background: linear-gradient(180deg, rgba(246, 244, 239, .74), #f6f4ef 42px);
}
.home-edit-panel {
  min-height: 70px;
  display: grid;
  align-content: center;
}
.home-edit-panel summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}
.home-edit-panel summary::-webkit-details-marker {
  display: none;
}
.home-edit-panel summary::after {
  content: "编辑";
  flex: 0 0 auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(217, 211, 200, .62);
  border-radius: 999px;
  color: #657073;
  background: rgba(255, 253, 248, .58);
  font-size: 12px;
  font-weight: 500;
}
.home-edit-panel[open] {
  align-content: start;
}
.home-edit-panel[open] summary {
  min-height: 34px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-softer);
}
.home-edit-panel[open] summary::after {
  content: "收起";
}
.home-edit-toolbar {
  color: var(--muted);
  font-size: 12px;
}
.quick-entry-card {
  background: rgba(255, 253, 248, .56);
}
.quick-entry-card h3 {
  color: #526062;
  font-size: 15px;
}
.quick-entry-card .action-btn {
  background: rgba(47, 127, 122, .09);
  border-color: rgba(47, 127, 122, .18);
  color: var(--teal-dark);
  box-shadow: none;
}
.quick-entry-card .action-btn:hover {
  background: rgba(47, 127, 122, .14);
  border-color: rgba(47, 127, 122, .28);
}

@media (max-width: 680px) {
  .home-hero-card {
    height: 50vh;
    min-height: 300px;
    max-height: 460px;
  }
  .home-hero-copy {
    padding: 24px 20px;
  }
  .home-hero-copy h1 {
    font-size: 34px;
  }
  .home-grid {
    margin-top: -16px;
    padding-top: 18px;
  }
}

/* Hero-integrated home focus panels */
.home-hero-card {
  height: 58vh;
  min-height: 440px;
  display: block;
  overflow: visible;
}
.home-hero-card::after {
  background:
    linear-gradient(180deg, rgba(246, 244, 239, 0) 48%, rgba(246, 244, 239, .58) 74%, #f6f4ef 100%),
    linear-gradient(90deg, rgba(21, 28, 28, .78), rgba(21, 28, 28, .28), rgba(21, 28, 28, .05));
}
.home-hero-card::before {
  height: 42%;
  background: linear-gradient(180deg, rgba(246, 244, 239, 0), rgba(246, 244, 239, .82) 62%, #f6f4ef 100%);
}
.home-hero-copy {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: min(720px, 72%);
  padding: clamp(34px, 5vw, 58px);
}
.home-hero-copy h1 {
  font-size: clamp(44px, 5.2vw, 58px);
  line-height: 1.04;
}
.home-hero-copy p {
  font-size: 15px;
  line-height: 1.6;
}
.home-focus-grid {
  position: absolute;
  z-index: 4;
  left: clamp(18px, 4vw, 54px);
  right: clamp(18px, 4vw, 54px);
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  transform: translateY(46%);
}
.home-edit-panel {
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 211, 200, .5);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 253, 248, .56), rgba(255, 253, 248, .9));
  box-shadow: 0 8px 24px rgba(38, 43, 43, .055);
  backdrop-filter: blur(8px);
}
.home-edit-panel summary {
  min-height: 44px;
  padding: 0;
  cursor: pointer;
}
.home-edit-panel summary h3 {
  font-size: 18px;
  color: #1f2d2f;
}
.home-edit-panel summary::after {
  display: none;
}
.home-edit-panel[open] {
  background: rgba(255, 253, 248, .96);
}
.home-edit-panel[open] summary {
  min-height: 30px;
  margin-bottom: 8px;
  padding-bottom: 7px;
}
.home-edit-toolbar {
  justify-content: flex-end;
  margin-bottom: 7px;
}
.home-grid {
  margin-top: 54px;
  padding-top: 20px;
  background: transparent;
}
.quick-entry-card {
  grid-column: 1 / -1;
}
.quick-entry-card .action-btn {
  background: rgba(82, 96, 98, .72);
  border-color: transparent;
  color: #fff;
}
.quick-entry-card .action-btn:hover {
  background: rgba(82, 96, 98, .86);
  border-color: transparent;
  color: #fff;
}

@media (max-width: 980px) {
  .home-focus-grid {
    grid-template-columns: 1fr;
    transform: translateY(36%);
  }
  .home-grid {
    margin-top: 120px;
  }
}

@media (max-width: 680px) {
  .home-hero-card {
    height: 62vh;
    min-height: 460px;
  }
  .home-hero-copy {
    width: 100%;
    padding: 26px 20px;
  }
  .home-hero-copy h1 {
    font-size: 39px;
  }
  .home-focus-grid {
    left: 12px;
    right: 12px;
    gap: 8px;
  }
  .home-edit-panel {
    padding: 12px;
  }
  .home-edit-panel summary h3 {
    font-size: 16px;
  }
}

/* Full-width home image with text directly on the gradient tail */
#home {
  margin-left: calc(clamp(18px, 4vw, 54px) * -1);
  margin-right: calc(clamp(18px, 4vw, 54px) * -1);
}
.home-hero-card {
  width: 100%;
  border-radius: 0;
}
.home-hero-card img {
  border-radius: 0;
}
.home-focus-grid {
  left: clamp(28px, 5vw, 68px);
  right: clamp(28px, 5vw, 68px);
  bottom: 18px;
  transform: none;
}
.home-edit-panel {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.home-edit-panel summary {
  min-height: 34px;
  padding: 0;
}
.home-edit-panel summary h3 {
  font-size: 19px;
  color: #243033;
  text-shadow: 0 1px 0 rgba(255, 253, 248, .48);
}
.home-edit-panel[open] {
  padding: 10px 0 0;
  border-top: 1px solid rgba(39, 48, 51, .12);
  background: transparent;
}
.home-edit-panel[open] summary {
  border-bottom: 0;
}
.home-edit-panel[open] .home-textarea,
.home-edit-panel[open] .todo-list {
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 253, 248, .42);
}
.home-grid {
  margin-top: 0;
  padding: 22px clamp(18px, 4vw, 54px) 0;
}

@media (max-width: 980px) {
  .home-focus-grid {
    transform: none;
  }
  .home-grid {
    margin-top: 0;
  }
}

@media (max-width: 680px) {
  #home {
    margin-left: -12px;
    margin-right: -12px;
  }
  .home-focus-grid {
    left: 18px;
    right: 18px;
    bottom: 14px;
  }
  .home-grid {
    padding: 18px 12px 0;
  }
}

/* Home title and borderless floating editors */
.home-hero-copy {
  width: min(920px, 86%);
}
.home-hero-copy h1 {
  white-space: nowrap;
  font-size: clamp(40px, 4.8vw, 56px);
}
.home-focus-title {
  min-height: 42px;
  padding: 0;
  justify-content: flex-start;
  background: transparent;
  border: 0;
  color: #243033;
  text-align: left;
  text-shadow: 0 1px 0 rgba(255, 253, 248, .48);
}
.home-focus-title span {
  font-size: 19px;
  font-weight: 700;
}
.home-focus-title:hover {
  color: var(--teal-dark);
}
.home-editor-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}
.home-editor-layer[hidden],
.home-editor-panel[hidden] {
  display: none;
}
.home-editor-backdrop {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: rgba(246, 244, 239, .48);
  backdrop-filter: blur(7px);
}
.home-editor-panel {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  max-height: 82vh;
  overflow: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.home-editor-panel h3 {
  margin: 0 0 10px;
  font-size: 22px;
}
.home-editor-panel .home-textarea,
.home-editor-panel .todo-list {
  background: rgba(255, 253, 248, .72);
}

@media (max-width: 680px) {
  .home-hero-copy {
    width: 100%;
  }
  .home-hero-copy h1 {
    font-size: clamp(31px, 9vw, 39px);
  }
  .home-focus-title span {
    font-size: 16px;
  }
  .home-editor-layer {
    padding: 16px;
  }
}

/* Face-safe hero typography and thirds-aligned focus links */
.home-hero-card {
  border: 0 !important;
  outline: 0;
  box-shadow: none;
}
.home-hero-copy {
  left: clamp(18px, 4vw, 56px);
  width: min(42vw, 640px);
  padding-left: 0;
  padding-right: 0;
}
.home-hero-copy h1 {
  font-size: clamp(34px, 4.2vw, 54px);
  max-width: 100%;
}
.home-hero-copy p {
  max-width: 460px;
}
.home-focus-grid {
  left: 0;
  right: 0;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  align-items: end;
  padding: 0 clamp(18px, 4vw, 54px);
}
.home-focus-title {
  justify-content: center;
  text-align: center;
  color: rgba(36, 48, 51, .66);
}
.home-focus-title:first-child {
  grid-column: 1;
}
.home-focus-title:nth-child(2) {
  grid-column: 2;
}
.home-focus-title span {
  font-size: clamp(20px, 1.55vw, 24px);
}
.home-focus-title:hover {
  color: rgba(29, 86, 85, .82);
}

@media (max-width: 980px) {
  .home-hero-copy {
    width: min(52vw, 560px);
  }
  .home-hero-copy h1 {
    font-size: clamp(32px, 4vw, 45px);
  }
}

@media (max-width: 680px) {
  .home-hero-copy {
    left: 18px;
    width: min(68vw, 360px);
  }
  .home-hero-copy h1 {
    font-size: clamp(27px, 7.2vw, 36px);
  }
  .home-focus-grid {
    grid-template-columns: 1fr 1fr;
    padding: 0 18px;
  }
  .home-focus-title:first-child,
  .home-focus-title:nth-child(2) {
    grid-column: auto;
  }
  .home-focus-title span {
    font-size: 17px;
  }
}

/* Exact third-point placement for home focus labels */
.home-focus-grid {
  display: block;
  padding: 0;
}
.home-focus-title {
  position: absolute;
  bottom: 0;
  width: min(320px, 28vw);
  transform: translateX(-50%);
}
.home-focus-title:first-child {
  left: 33.333%;
}
.home-focus-title:nth-child(2) {
  left: 66.666%;
}

@media (max-width: 680px) {
  .home-focus-title {
    width: 44vw;
  }
  .home-focus-title:first-child {
    left: 27%;
  }
  .home-focus-title:nth-child(2) {
    left: 73%;
  }
}

/* Keep quick entries away from the hero composition */
.home-grid {
  padding-top: clamp(54px, 9vh, 96px);
  padding-bottom: 26px;
}
.quick-entry-card {
  max-width: min(920px, calc(100vw - 320px));
  margin: 0 auto;
  opacity: .86;
}

@media (max-width: 980px) {
  .quick-entry-card {
    max-width: 100%;
  }
}

@media (max-width: 680px) {
  .home-grid {
    padding-top: 58px;
  }
}

/* Screenshot tune: top alignment, face-safe title, footer quick links */
.main:has(#home.active) {
  padding-top: 0;
}
#home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.home-hero-copy {
  left: clamp(16px, 3.4vw, 46px);
  width: min(36vw, 560px);
}
.home-hero-copy h1 {
  font-size: clamp(31px, 3.55vw, 48px);
}
.home-hero-copy p {
  max-width: 390px;
  font-size: clamp(12px, 1vw, 14px);
}
.home-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  align-content: end;
  padding-top: 0;
  padding-bottom: 24px;
}
.quick-entry-card {
  align-self: end;
}

@media (min-aspect-ratio: 19/9) {
  .home-hero-copy {
    width: min(32vw, 520px);
  }
  .home-hero-copy h1 {
    font-size: clamp(30px, 3vw, 44px);
  }
  .home-grid {
    padding-bottom: 34px;
  }
}

@media (max-width: 680px) {
  .home-hero-copy {
    width: min(70vw, 350px);
  }
  .home-hero-copy h1 {
    font-size: clamp(26px, 7vw, 34px);
  }
  .home-grid {
    padding-bottom: 18px;
  }
}

/* Two-line adaptive hero title */
.home-hero-copy h1 {
  white-space: normal;
  display: grid;
  gap: .08em;
  font-size: clamp(44px, 5.4vw, 72px);
  line-height: .95;
}
.home-hero-copy h1 span {
  display: block;
}
.home-hero-copy h1 span:first-child {
  letter-spacing: .01em;
}
.home-hero-copy p span {
  display: block;
}

@media (min-aspect-ratio: 19/9) {
  .home-hero-copy h1 {
    font-size: clamp(38px, 4.1vw, 60px);
    line-height: .96;
  }
}

@media (max-aspect-ratio: 4/3) {
  .home-hero-copy h1 {
    font-size: clamp(42px, 6.4vw, 70px);
  }
}

@media (max-width: 680px) {
  .home-hero-copy h1 {
    font-size: clamp(34px, 10vw, 52px);
  }
}

/* Keep navigation usable above home editor overlays */
.sidebar {
  z-index: 90;
}

/* Scope full-bleed hero behavior to the real home page only */
body[data-page="home"] .main {
  padding-top: 0;
}
body:not([data-page="home"]) .main {
  padding-top: 20px;
}
body:not([data-page="home"]) #home {
  display: none !important;
}

/* Stable home footer quick entry placement */
#home {
  min-height: calc(100vh - 0px);
}
.home-grid {
  flex: 1 1 auto;
  align-content: end;
  padding-top: clamp(28px, 5vh, 64px);
  padding-bottom: clamp(18px, 3vh, 34px);
}
.quick-entry-card {
  width: min(640px, 72%);
  max-width: 640px;
  justify-self: center;
}

@media (max-width: 980px) {
  .quick-entry-card {
    width: min(640px, 94%);
  }
}

@media (max-width: 680px) {
  .home-grid {
    padding-top: 36px;
  }
  .quick-entry-card {
    width: calc(100% - 24px);
  }
}

/* Home quick entry anchored to lower-left */
.home-grid {
  justify-items: start;
  padding-left: clamp(18px, 4vw, 54px);
  padding-right: clamp(18px, 4vw, 54px);
}
.quick-entry-card {
  justify-self: start;
  margin-left: 0;
  margin-right: 0;
  width: min(560px, 52vw);
}

@media (max-width: 980px) {
  .quick-entry-card {
    width: min(560px, 92vw);
  }
}

@media (max-width: 680px) {
  .home-grid {
    padding-left: 12px;
    padding-right: 12px;
  }
  .quick-entry-card {
    width: calc(100vw - 24px);
  }
}

/* Center editor dialogs within the main workspace, independent of the sidebar. */
@media (min-width: 981px) {
  .modal,
  .home-editor-layer {
    left: 244px;
  }

  body:has(.app-shell.sidebar-collapsed) .modal,
  body:has(.app-shell.sidebar-collapsed) .home-editor-layer {
    left: 64px;
  }
}
