/* 装修计划管理系统 - 主样式文件 */

:root,
body[data-theme="default"] {
  --bg: #f7eefb;
  --paper: #fff9fe;
  --paper2: #f5ecff;
  --ink: #342743;
  --muted: #7b6e91;
  --line: rgba(112, 85, 147, .16);
  --brand: #c36bb4;
  --brand2: #7aa8ff;
  --brand3: #8b6ff2;
  --green: #7bb8b6;
  --blue: #7aa8ff;
  --red: #d8799f;
  --shadow: 0 24px 78px rgba(70, 48, 128, .16);
  --r: 22px;
  --r2: 30px;

  /* 主题化语义变量 */
  --bg-gradient:
    radial-gradient(circle at 10% -8%, rgba(255, 151, 185, .48), transparent 30%),
    radial-gradient(circle at 88% 4%, rgba(116, 168, 255, .42), transparent 28%),
    radial-gradient(circle at 55% 0, rgba(178, 126, 255, .28), transparent 33%),
    linear-gradient(135deg, #fff2f8 0%, #f4efff 42%, #eaf5ff 72%, #f8ecff 100%);
  --heading: #4b356f;
  --card-bg: rgba(255, 249, 254, .84);
  --surface: rgba(255, 255, 255, .62);
  --surface-2: rgba(255, 255, 255, .48);
  --th-bg: rgba(239, 229, 255, .72);
}

/* 暖色主题：米白 / 橙 / 木色调 */
body[data-theme="warm"] {
  --bg: #f3e7d6;
  --paper: #fffaf2;
  --paper2: #f6ecdb;
  --ink: #4a3826;
  --muted: #9a836a;
  --line: rgba(140, 104, 64, .18);
  --brand: #d98a45;
  --brand2: #c8a26a;
  --brand3: #b5703a;
  --green: #8a9a5b;
  --blue: #c8a26a;
  --red: #c2683f;
  --shadow: 0 24px 78px rgba(120, 80, 40, .16);

  --bg-gradient:
    radial-gradient(circle at 10% -8%, rgba(230, 178, 120, .42), transparent 30%),
    radial-gradient(circle at 88% 4%, rgba(210, 160, 100, .34), transparent 28%),
    linear-gradient(135deg, #fdf3e6 0%, #f7ead6 48%, #f3e2cb 100%);
  --heading: #5c4326;
  --card-bg: rgba(255, 250, 242, .88);
  --surface: rgba(255, 252, 246, .66);
  --surface-2: rgba(250, 240, 226, .55);
  --th-bg: rgba(240, 224, 200, .78);
}

/* 深色主题：dark mode */
body[data-theme="dark"] {
  --bg: #161320;
  --paper: #211c2e;
  --paper2: #2a2438;
  --ink: #e8e2f2;
  --muted: #9b90b3;
  --line: rgba(180, 160, 220, .16);
  --brand: #c36bb4;
  --brand2: #7aa8ff;
  --brand3: #9b82f0;
  --green: #6fb0ae;
  --blue: #7aa8ff;
  --red: #e07ba0;
  --shadow: 0 24px 78px rgba(0, 0, 0, .55);

  --bg-gradient:
    radial-gradient(circle at 10% -8%, rgba(140, 70, 120, .35), transparent 32%),
    radial-gradient(circle at 88% 4%, rgba(70, 100, 170, .32), transparent 30%),
    radial-gradient(circle at 55% 0, rgba(110, 80, 170, .25), transparent 35%),
    linear-gradient(135deg, #181425 0%, #1c1830 45%, #15171f 75%, #1a1528 100%);
  --heading: #ddd2f2;
  --card-bg: rgba(33, 28, 46, .86);
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .04);
  --th-bg: rgba(60, 50, 84, .72);
}

* {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  transition: background .3s ease, color .3s ease;
}

/* 主题切换过渡：作用于受主题变量影响的主要表面 */
.hero, .card, .tabs, .stat, .modal, .lane,
.item, .stage, .task, table, th, td,
h1, h2, h3, .tab {
  transition: background .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

button {
  cursor: pointer;
}

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

.app {
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero {
  padding: 28px;
  border-radius: var(--r2);
  background: linear-gradient(135deg, var(--card-bg), var(--paper2));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero:before {
  content: "";
  position: absolute;
  inset: -45% -12% auto auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 149, 191, .28), rgba(122, 168, 255, .14) 44%, transparent 68%);
  pointer-events: none;
}

.hero > * {
  position: relative;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
}

.eyebrow {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(195, 107, 180, .12);
  color: #8d4aa0;
  font-weight: 850;
  font-size: 13px;
}

h1 {
  margin: 14px 0 8px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: -1.3px;
  background: linear-gradient(120deg, #8b4bd8, #ce6fab 48%, #4988e8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: #efe8ff;
  color: #5f4c88;
  font-weight: 850;
}

.btn:hover {
  filter: brightness(.99);
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(135deg, #c36bb4, #7aa8ff);
  color: #fff;
}

.btn.danger {
  background: rgba(216, 121, 159, .14);
  color: #a84b73;
}

.btn.small {
  padding: 7px 10px;
  border-radius: 11px;
  font-size: 12px;
}

.btn.ok {
  background: rgba(123, 184, 182, .17);
  color: #447b83;
}

.btn.ghost {
  background: rgba(255, 255, 255, .62);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin-top: 24px;
}

.stat {
  min-width: 0;
  padding: 17px;
  border-radius: 21px;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(91, 70, 150, .08);
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat b {
  display: block;
  margin-top: 8px;
  font-size: clamp(22px, 2.4vw, 32px);
  letter-spacing: -.6px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  margin-top: 18px;
}

.tabs {
  position: sticky;
  top: 14px;
  align-self: start;
  border-radius: var(--r);
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: 0 14px 38px rgba(88, 67, 143, .10);
  padding: 12px;
  backdrop-filter: blur(16px);
}

.tab-group {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.tab-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.tab-title {
  margin: 4px 6px 7px;
  color: #9a7fc0;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
}

.tab {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 13px;
  border-radius: 16px;
  font-weight: 900;
  text-align: left;
}

.tab.active {
  background: linear-gradient(135deg, rgba(195, 107, 180, .15), rgba(122, 168, 255, .18));
  color: #5e418e;
}

.tab em {
  font-style: normal;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(139, 111, 242, .11);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.card {
  border-radius: var(--r);
  padding: 22px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(82, 61, 139, .10);
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.3px;
  color: var(--heading);
}

h3 {
  margin: 0 0 10px;
  color: var(--heading);
}

.desc {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.toolline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.muted {
  color: var(--muted);
}

.budget {
  position: relative;
  min-height: 560px;
  display: grid;
  place-items: center;
  overflow: visible;
}

.chart-wrap {
  position: relative;
  width: min(820px, 100%);
  height: 540px;
}

.donut {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

.chart-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-weight: 900;
}

.budget-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

.budget-name i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .55);
}

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

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 13px;
}

.lane {
  min-height: 220px;
  padding: 13px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.lane.drag-over {
  outline: 2px dashed rgba(195, 107, 180, .48);
  background: linear-gradient(135deg, rgba(255, 242, 248, .82), rgba(235, 244, 255, .78));
}

.item, .stage, .task {
  padding: 15px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.stage-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 11px;
}

.stage-stat {
  padding: 7px;
  border-radius: 12px;
  background: rgba(195, 107, 180, .10);
  font-size: 12px;
  color: #5e4a7f;
}

.stage-stat b {
  display: block;
  font-size: 18px;
  color: #44305f;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(88, 67, 143, .12);
}

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.budget-drag {
  cursor: grab;
}

.budget-drag.dragging {
  opacity: .45;
}

.budget-row-drop {
  outline: 2px dashed rgba(195, 107, 180, .45);
}

.task {
  margin-bottom: 10px;
  background: var(--paper);
}

.task[draggable="true"] {
  cursor: grab;
}

.task.dragging {
  opacity: .55;
  transform: scale(.99);
  box-shadow: 0 16px 40px rgba(87, 62, 148, .18);
}

.drop-marker {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  margin: 6px 0;
}

.item-title {
  font-weight: 920;
  line-height: 1.45;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(139, 111, 242, .12);
  color: #67449a;
  font-weight: 900;
  font-size: 12px;
}

.note {
  margin-top: 10px;
  padding: 10px;
  border-radius: 13px;
  background: rgba(244, 236, 255, .56);
  color: #66577f;
  font-size: 13px;
  line-height: 1.55;
}

.conclusion {
  margin-top: 10px;
  padding: 10px;
  border-radius: 13px;
  background: rgba(122, 168, 255, .15);
  color: #4b629b;
  font-size: 13px;
  line-height: 1.55;
}

.bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(195, 107, 180, .14);
  margin-top: 13px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  transition: width .3s;
}

.row-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.done {
  text-decoration: line-through;
  color: var(--muted);
}

.money {
  color: #7b4fa0;
  font-weight: 900;
}

.lowest {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(123, 184, 182, .18);
  color: #447b83;
  font-size: 11px;
  font-weight: 900;
}

.comparison-group-card {
  padding: 18px;
}

.money-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0;
}

.money-row div {
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(195, 107, 180, .08), rgba(122, 168, 255, .09));
  border: 1px solid rgba(145, 112, 188, .13);
}

.money-row span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 850;
}

.money-row b {
  display: block;
  margin-top: 4px;
  color: #4b356f;
  font-size: 16px;
}

.money-row b.warn {
  color: #b653a4;
}

.drag-handle {
  font-size: 12px;
  color: #9a7fc0;
  font-weight: 900;
}

.price-line {
  margin: 12px 0;
}

.payment-node-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.payment-node {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 11px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid var(--line);
}

.payment-node p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.payment-node-side {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(122, 168, 255, .14);
  color: #506699;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.file-chip:hover {
  filter: brightness(.98);
}

.row-actions.compact {
  grid-column: 1 / -1;
  margin-top: 0;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  font-weight: 850;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: var(--surface-2);
}

th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

th {
  background: var(--th-bg);
  color: var(--heading);
}

td .note-cell {
  max-width: 360px;
  white-space: normal;
  color: var(--muted);
  line-height: 1.45;
}

.th-filter {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 110px;
}

.th-label {
  font-weight: 950;
}

.th-control {
  width: 100%;
  min-width: 96px;
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, .82);
}

.th-count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

.form {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 850;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 13px;
  padding: 10px 11px;
  outline: 0;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(195, 107, 180, .48);
  box-shadow: 0 0 0 4px rgba(195, 107, 180, .10);
}

.voice-box {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .48);
  border: 1px solid var(--line);
}

.voice-box textarea {
  margin-top: 10px;
  min-height: 72px;
}

.voice-box.recording {
  outline: 2px solid rgba(195, 107, 180, .40);
  background: linear-gradient(135deg, rgba(195, 107, 180, .10), rgba(122, 168, 255, .10));
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(52, 39, 67, .38);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-mask.show {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(76, 54, 135, .24);
  border: 1px solid rgba(255, 255, 255, .8);
}

.modal-head {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.modal-body {
  padding: 20px 22px;
}

.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--card-bg);
  position: sticky;
  bottom: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #302647;
  color: #fff9fe;
  padding: 12px 15px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: .2s;
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1050px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .tabs {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .timeline {
    grid-template-columns: repeat(2, 1fr);
  }
  .budget {
    min-height: 620px;
  }
  .chart-wrap {
    height: 600px;
  }
}

@media (max-width: 760px) {
  body {
    background: var(--bg-gradient);
  }
  .app {
    width: 100%;
    padding: 10px 10px 34px;
  }
  .hero {
    padding: 16px;
    border-radius: 22px;
  }
  .top, .card-head {
    flex-direction: column;
    gap: 12px;
  }
  .eyebrow {
    font-size: 11px;
    padding: 6px 9px;
  }
  h1 {
    font-size: 28px;
    letter-spacing: -.6px;
    margin: 10px 0 2px;
  }
  h2 {
    font-size: 20px;
  }
  .desc {
    font-size: 12px;
    line-height: 1.5;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 15px;
    width: 100%;
  }
  .stat {
    padding: 11px;
    border-radius: 16px;
    min-width: 0;
  }
  .stat span {
    font-size: 11px;
  }
  .stat b {
    font-size: 20px;
    margin-top: 5px;
  }
  .stat:last-child {
    grid-column: 1 / -1;
  }
  .layout {
    display: block;
    margin-top: 10px;
  }
  .tabs {
    position: sticky;
    top: 8px;
    z-index: 30;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding: 8px;
    border-radius: 18px;
    margin: 0 0 10px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tab-group {
    display: flex;
    gap: 8px;
    border: 0;
    padding: 0;
    flex: 0 0 auto;
  }
  .tab-title {
    display: none;
  }
  .tab {
    min-width: 78px;
    justify-content: center;
    gap: 5px;
    padding: 10px 10px;
    border-radius: 13px;
    white-space: nowrap;
    scroll-snap-align: start;
  }
  .tab em {
    font-size: 10px;
    padding: 2px 6px;
  }
  .card {
    padding: 15px;
    border-radius: 20px;
    margin-bottom: 12px;
  }
  .chart-wrap {
    height: 350px;
    width: 100%;
    max-width: 100%;
  }
  .budget {
    min-height: 360px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .timeline, .kanban, .grid2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .lane {
    min-height: 130px;
    padding: 10px;
  }
  .item, .stage, .task {
    padding: 12px;
    border-radius: 16px;
  }
  .item-title {
    font-size: 14px;
  }
  .meta {
    font-size: 11px;
    gap: 6px;
  }
  .pill, .cat-chip {
    font-size: 11px;
  }
  .money {
    font-size: 12px;
  }
  .row-actions {
    gap: 8px;
  }
  .row-actions .btn {
    min-height: 38px;
    flex: 1;
  }
  .btn {
    min-height: 38px;
    padding: 9px 11px;
  }
  .btn.small {
    min-height: 34px;
    padding: 7px 9px;
  }
  .toolline, .actions {
    justify-content: flex-start;
    width: 100%;
  }
  .toolline .btn {
    flex: 1 1 auto;
  }
  .voice-box {
    padding: 12px;
    border-radius: 16px;
  }
  .voice-box textarea {
    min-height: 88px;
  }
  .table-wrap {
    border-radius: 14px;
    margin: 0;
    max-width: 100%;
    overflow-x: auto;
  }
  table {
    min-width: 680px;
  }
  .modal {
    border-radius: 20px;
  }
  .form {
    grid-template-columns: 1fr 1fr;
  }
  .field[style*="span"] {
    grid-column: 1 / -1 !important;
  }
  .money-row {
    grid-template-columns: 1fr 1fr;
  }
  .payment-node {
    grid-template-columns: 1fr;
  }
  .payment-node-side {
    justify-content: flex-start;
  }
}

/* ===== 一键换肤 ===== */
.theme-switcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
}

.theme-fab {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--heading);
  box-shadow: var(--shadow);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  transition: transform .2s ease, box-shadow .2s ease;
}

.theme-fab:hover {
  transform: translateY(-2px) rotate(12deg);
}

.theme-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: 220px;
  padding: 12px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}

.theme-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.theme-panel-title {
  margin: 2px 6px 10px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  color: var(--muted);
}

.theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 13px;
  font-weight: 850;
  text-align: left;
  transition: background .2s ease, border-color .2s ease;
}

.theme-option:hover {
  background: var(--surface);
}

.theme-option.active {
  border-color: var(--brand);
  background: var(--surface);
}

.theme-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

.theme-option .check {
  margin-left: auto;
  color: var(--brand);
  font-weight: 950;
  opacity: 0;
}

.theme-option.active .check {
  opacity: 1;
}

@media (max-width: 760px) {
  .theme-switcher {
    right: 14px;
    bottom: 14px;
  }
}

/* ── 关联跳转高亮 ── */
.highlight-ref {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  animation: highlight-pulse 0.4s ease 3;
}
@keyframes highlight-pulse {
  0%, 100% { outline-color: var(--brand); }
  50% { outline-color: var(--brand2); box-shadow: 0 0 12px rgba(195,107,180,.35); }
}

/* ── 备忘录 Idea 卡片 ── */
.idea-card {
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.idea-card.done {
  opacity: 0.65;
}
.idea-card.done .idea-title {
  text-decoration: line-through;
}
.idea-title {
  font-size: 16px;
  font-weight: 850;
  margin-bottom: 8px;
  color: var(--heading);
}
.idea-content {
  margin: 10px 0 12px;
  color: var(--muted);
  line-height: 1.6;
}
.idea-card .pill {
  display: inline-block;
  margin-right: 6px;
  margin-bottom: 8px;
}

