:root {
  --cream: #FFF7EC;
  --ink: #3B332B;
  --ink-2: #8A7C6D;
  --amber: #FFB86B;
  --amber-dark: #C47A2E;
  --rose: #E07C7C;
  --green: #6BCB77;
  --coral: #FF6B6B;
  --blue: #6FB6FF;
  --purple: #B79CFF;
  --line: #EADFCF;
  --danger: #D05A4C;
  --card-shadow: 0 10px 26px rgba(59, 51, 43, .08);
  --card-shadow-hover: 0 18px 36px rgba(59, 51, 43, .13);
  --sans: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --display: "Noto Serif SC", "Songti SC", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 90% -10%, rgba(255, 184, 107, .22), transparent 60%),
    radial-gradient(800px 460px at -10% 10%, rgba(107, 203, 119, .16), transparent 60%),
    radial-gradient(760px 420px at 18% -6%, rgba(224, 124, 124, .12), transparent 60%),
    var(--cream);
  min-height: 100vh;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 44px; }
.view { padding: 24px 0 52px; }

button {
  font-family: var(--sans);
  cursor: pointer;
  color: var(--ink);
}

/* ---------- 页头 ---------- */
.top { padding: 30px 0 24px; border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { text-decoration: none; color: inherit; display: block; }
.eyebrow {
  font-size: 11px;
  letter-spacing: .38em;
  color: var(--amber-dark);
  margin-bottom: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: .45;
}
.brand h1 {
  font-family: var(--display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.15;
  color: var(--rose);
}
.sub { font-size: 15px; color: var(--ink-2); margin-top: 8px; letter-spacing: .08em; }
.actions { display: flex; align-items: center; gap: 14px; }

.icon-btn {
  width: 46px; height: 46px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-2);
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(59, 51, 43, .08);
  transition: .18s;
}
.icon-btn:hover { transform: translateY(-2px); color: var(--ink); }
.icon-btn .material-symbols-outlined { font-size: 21px; }

.add-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px;
  border: none;
  border-radius: 999px;
  background: var(--amber);
  color: #4A3418;
  font-size: 15.5px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(255, 184, 107, .45);
  transition: .18s;
}
.add-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255, 184, 107, .55); }
.add-btn .material-symbols-outlined { font-size: 19px; }

/* ---------- 首页盒子墙 ---------- */
.note {
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 26px;
}
.note b { color: var(--ink); }
.row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.folder {
  background: #fff;
  border-radius: 24px;
  padding: 24px 22px 20px;
  box-shadow: 0 12px 30px rgba(59, 51, 43, .07);
  cursor: pointer;
  transition: .18s;
}
.folder:hover { transform: translateY(-5px); box-shadow: 0 20px 44px rgba(59, 51, 43, .12); }

.avatar {
  width: 48px; height: 48px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700; color: #fff;
}
.avatar.c0 { background: var(--coral); }
.avatar.c1 { background: var(--green); }
.avatar.c2 { background: var(--blue); }
.avatar.c3 { background: var(--purple); }

.p-top { display: flex; align-items: center; gap: 12px; }
.p-name { font-size: 18px; font-weight: 700; }
.p-sub { font-size: 13px; color: var(--ink-2); margin-top: 3px; }

.pill {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px; font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill.done { background: #E5F6E7; color: #3D8B4A; }
.pill.todo { background: #FFF0E1; color: var(--amber-dark); }
.pill.empty { background: #F1EDE7; color: var(--ink-2); }

.quote {
  margin-top: 14px;
  font-size: 14px; line-height: 1.9;
  color: #5D534A;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 78px;
}

.p-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed #EDE6DC;
  font-size: 13px; color: var(--ink-2);
}
.p-foot .material-symbols-outlined { font-size: 16px; }

.folder.blank {
  border: 2px dashed #E5D9C8;
  background: transparent;
  box-shadow: none;
  display: grid; place-items: center;
  min-height: 236px;
  padding: 0;
}
.folder.blank .body { background: transparent; border: none; box-shadow: none; padding: 0; }
.folder.blank .inner {
  display: grid; place-items: center; gap: 8px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500;
}
.folder.blank .material-symbols-outlined { font-size: 34px; }
.folder.blank:hover { border-color: var(--amber); color: var(--amber-dark); transform: none; }

.empty-state { display: grid; place-items: center; padding: 36px 0; }
.empty-card {
  text-align: center;
  border: 2px dashed #E5D9C8;
  border-radius: 22px;
  padding: 48px 60px;
  background: rgba(255, 255, 255, .55);
  color: var(--ink-2);
}
.empty-card .material-symbols-outlined { font-size: 38px; color: var(--amber-dark); }
.empty-card p { margin-top: 10px; font-size: 14px; }
.empty-card .hint { font-size: 12.5px; }
.empty-card .btn { margin-top: 20px; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border: none;
  border-radius: 999px;
  background: var(--amber);
  color: #4A3418;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 5px 14px rgba(255, 184, 107, .4);
  transition: .18s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(255, 184, 107, .5); }
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: 0 4px 12px rgba(59, 51, 43, .06);
}
.btn.ghost:hover { border-color: var(--ink); box-shadow: 0 7px 16px rgba(59, 51, 43, .1); }
.btn.ghost.danger { color: var(--danger); border-color: rgba(208, 90, 76, .5); }
.btn.ghost.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn .material-symbols-outlined { font-size: 18px; }

.icon-ghost {
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  display: inline-grid; place-items: center;
  transition: .18s;
}
.icon-ghost:hover { color: var(--ink); background: #F5EFE4; }
.icon-ghost .material-symbols-outlined { font-size: 19px; }

.danger-ghost {
  border: none; background: transparent;
  color: var(--danger);
  font-size: 13px; padding: 6px 10px;
  border-radius: 999px;
}
.danger-ghost:hover { background: rgba(208, 90, 76, .08); }

/* ---------- 详情页 ---------- */
.detail-wrap { max-width: 880px; }
.back {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent;
  color: var(--ink-2); font-size: 13.5px;
  padding: 4px 0; margin-bottom: 22px;
}
.back:hover { color: var(--ink); }
.back .material-symbols-outlined { font-size: 18px; }

.detail-head { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.detail-title-row { display: flex; align-items: center; gap: 12px; }
.detail-title-row h1 { font-size: 28px; font-weight: 700; letter-spacing: .04em; }
.detail-title-row .danger-ghost { margin-left: auto; }

.folder-card {
  position: relative;
  background: #fff;
  border-radius: 22px;
  padding: 30px 26px 24px;
  box-shadow: var(--card-shadow);
  margin: 18px 0 30px;
}
.folder-card .tab {
  position: absolute; top: -14px; left: 20px;
  height: 28px; padding: 0 14px;
  background: var(--amber);
  color: #4A3418;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .05em;
  box-shadow: 0 4px 10px rgba(255, 184, 107, .4);
}
.folder-card .tab .material-symbols-outlined { font-size: 14px; }
.folder-card .body { padding: 12px 2px 2px; }

.note-row {
  display: flex; gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px dashed #EDE6DC;
}
.note-row:last-of-type { border-bottom: none; }
.note-row .n-icon {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #FFF0E1;
  color: var(--amber-dark);
  display: grid; place-items: center;
}
.note-row .n-icon .material-symbols-outlined { font-size: 17px; }
.note-row .n-main { flex: 1; min-width: 0; }
.note-row .n-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--ink-2);
  margin-bottom: 6px;
}
.note-row .n-head .n-src {
  color: var(--ink);
  font-size: 13px; font-weight: 700;
  max-width: 55%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.note-row .n-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.note-row .n-body {
  font-size: 13.5px; line-height: 1.9;
  color: #5D534A;
  white-space: pre-wrap;
  word-break: break-word;
}
.note-row .n-body.preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-row .n-toggle {
  border: none; background: transparent;
  color: var(--amber-dark); font-size: 12px;
  margin-top: 6px; padding: 0;
}
.note-row .n-toggle:hover { text-decoration: underline; }

.add-note { margin-top: 20px; padding-top: 18px; border-top: 1px dashed #EDE6DC; }
.add-note textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #FFFDF8;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 14px; line-height: 1.8;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color .18s;
}
.add-note textarea:focus { border-color: var(--amber); }
.add-note-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; flex-wrap: wrap;
}
.hint { font-size: 12px; color: var(--ink-2); }

/* 报告区 */
.report-meta {
  font-size: 12px; color: var(--ink-2);
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.report-body {
  font-size: 15px; line-height: 2;
  color: #443B31;
  overflow-wrap: break-word;
}
.report-body h1, .report-body h2, .report-body h3 {
  margin: 20px 0 10px;
  letter-spacing: .02em;
  font-weight: 700;
}
.report-body h2:first-child, .report-body h1:first-child { margin-top: 0; }
.report-body h2 { font-size: 17px; }
.report-body h3 { font-size: 15px; }
.report-body p { margin: 10px 0; }
.report-body blockquote {
  border-left: 3px solid var(--amber);
  padding: 4px 14px;
  margin: 12px 0;
  color: var(--ink-2);
  background: #FFF8EE;
  border-radius: 0 10px 10px 0;
}
.report-body ul, .report-body ol { padding-left: 22px; margin: 10px 0; }
.report-body li { margin: 4px 0; }
.report-body strong { font-weight: 700; }
.report-body em { color: var(--ink-2); }
.report-body hr { border: none; border-top: 1px dashed var(--line); margin: 18px 0; }

.report-empty {
  text-align: center;
  padding: 26px 10px 22px;
  color: var(--ink-2);
}
.report-empty .material-symbols-outlined { font-size: 34px; color: var(--amber-dark); }
.report-empty p { margin-top: 10px; font-size: 13.5px; }
.report-empty .hint { display: block; margin-top: 6px; }
.report-empty .btn { margin-top: 18px; }

.report-loading {
  text-align: center; padding: 24px 10px;
  color: var(--ink-2);
}
.spinner {
  width: 26px; height: 26px;
  border: 3px solid #F0E6D6;
  border-top-color: var(--amber);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(59, 51, 43, .38);
  padding: 24px;
  z-index: 50;
}
.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 60px);
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(59, 51, 43, .22);
  padding: 26px 30px 24px;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-head h2 { font-size: 20px; font-weight: 700; letter-spacing: .03em; }
.field { display: block; margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 13px; font-weight: 700;
  margin-bottom: 8px; letter-spacing: .02em;
}
.field-label .warn { font-style: normal; font-size: 11.5px; color: var(--danger); font-weight: 400; margin-left: 6px; }
.field input, .field select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #FFFDF8;
  padding: 11px 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .18s;
}
.field input:focus, .field select:focus { border-color: var(--amber); }
.field .hint { display: block; margin-top: 8px; line-height: 1.7; }
.key-row { display: flex; align-items: center; gap: 8px; }
.key-row input { flex: 1; }
.test-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.privacy-note {
  font-size: 12px; line-height: 1.8;
  color: var(--ink-2);
  background: #FFF0E1;
  border: 1px solid #FFD9A8;
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 4px;
}
.modal-foot {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 22px;
}

/* ---------- 页脚 / 提示 ---------- */
.footer-inner {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding-top: 18px; padding-bottom: 26px;
  border-top: 1px solid var(--line);
}
.footer-inner p { font-size: 12px; color: var(--ink-2); }

.toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(59, 51, 43, .25);
  z-index: 100;
  max-width: min(80vw, 520px);
  text-align: center;
}

@media (max-width: 1000px) {
  .row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .top { padding: 24px 0 20px; }
  .top-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .actions { width: 100%; justify-content: space-between; }
  .row { grid-template-columns: 1fr; }
  .brand h1 { font-size: 24px; }
  .modal-card { padding: 22px 20px; }
}
