/* Scheme 04: Gmail Material Design 3 (M3) Native Creator Side Panel (Hero Creator Dock) */
:root {
  --sidebar-w: 420px;
  --google-blue: #0b57d0;
  --google-blue-soft: #e8f0fe;
  --google-blue-border: #d2e3fc;
  --google-amber: #b06000;
  --google-amber-soft: #fef7e0;
  --google-amber-border: #feefc3;
  --google-green: #146c2e;
  --google-green-soft: #e6f4ea;
  --google-green-border: #ceead6;
  --surface: #ffffff;
  --surface-dim: #f8fafd;
  --surface-border: #dadce0;
  --text-main: #1f1f1f;
  --text-muted: #444746;
  --text-dim: #70757a;
}

/* 邮件正文中的高亮划选：从古典朱红改为现代 Gmail 柔和琥珀高亮 */
.message-body .highlight {
  color: #8c3b00;
  background: #fef7e0;
  border-bottom: 2px solid #f9ab00;
  border-radius: 3px;
  padding: 1px 4px;
  transition: background 0.15s;
}
.message-body .highlight:hover,
.message-body .highlight.is-open {
  background: #feeec0;
  border-bottom-color: #e37400;
}
.inline-mark {
  color: #137333;
  background: #e6f4ea;
  border: 1px solid #ceead6;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
}
.message-body .inline-ask {
  border-left: 3px solid #1a73e8;
  background: #f8fafd;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 8px 0 12px 14px;
}
.message-body .inline-ask p {
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 500;
  margin: 0;
}
.inline-ask-meta {
  color: #1a73e8;
  font-size: 11px;
  font-weight: 500;
  margin-top: 4px;
}

/* Sidebar 布局重塑：贴合 Google Workspace Side Panel 容器规范 */
.sidebar {
  padding: 14px 16px 20px 0;
}
.note-sheet {
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12), 0 4px 8px rgba(60, 64, 67, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 120px);
}
.note-sheet-head {
  display: none; /* 由 noteRoot 内部的 M3 Panel Header 接管 */
}

/* M3 Panel 骨架 */
.m3-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Google Sans", "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background: #ffffff;
}

/* M3 Header */
.m3-header {
  padding: 13px 18px;
  border-bottom: 1px solid #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafd;
}
.m3-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.m3-spark-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
  color: #1a73e8;
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.15);
}
.m3-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.2px;
}
.m3-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.m3-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 12px;
  line-height: 1.2;
}
.badge-amber {
  background: #fef7e0;
  border: 1px solid #feefc3;
  color: #b06000;
}
.badge-blue {
  background: #e8f0fe;
  border: 1px solid #d2e3fc;
  color: #1a73e8;
}
.badge-green {
  background: #e6f4ea;
  border: 1px solid #ceead6;
  color: #137333;
}
.m3-close-btn {
  border: 0;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  font-size: 16px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.m3-close-btn:hover {
  background: #e8eaed;
  color: #1f1f1f;
}

/* 主内容滚动区 */
.m3-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
}

/* 模块标头 */
.m3-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-dim);
  margin-bottom: 7px;
}

/* 选题卡片 */
.m3-topic-card {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-main);
  background: #f8fafd;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid #e8eaed;
  position: relative;
}
.m3-topic-card .topic-highlight {
  color: #0b57d0;
  font-weight: 600;
}
.m3-topic-edit-btn {
  border: 0;
  background: transparent;
  color: #1a73e8;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.m3-topic-edit-btn:hover {
  text-decoration: underline;
}

/* 交付规格 Chips 组（核心低认知交互） */
.m3-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.m3-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 12px;
  color: #3c4043;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.m3-chip:hover {
  background: #f1f3f4;
  border-color: #c4c7c5;
}
.m3-chip:active {
  transform: scale(0.98);
}
.m3-chip.chip-active-blue {
  background: #e8f0fe;
  border-color: #d2e3fc;
  color: #1a73e8;
  font-weight: 500;
}
.m3-chip.chip-active-amber {
  background: #fef7e0;
  border-color: #feefc3;
  color: #7a5c12;
  font-weight: 500;
}
.m3-chip .chip-caret {
  font-size: 10px;
  color: #70757a;
}

/* 即时定调卡片（Actionable Decision Card） */
.m3-decision-card {
  background: #f8fafd;
  border: 1px solid #e0e3e7;
  border-radius: 12px;
  padding: 13px 14px;
}
.m3-decision-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--google-amber);
  margin-bottom: 8px;
}
.m3-decision-desc {
  font-size: 12px;
  color: #5f6368;
  line-height: 1.5;
  margin: 0 0 11px 0;
}
.m3-pills-row {
  display: flex;
  gap: 8px;
}
.m3-pill-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
  background: #ffffff;
  border: 1px solid #dadce0;
  color: #5f6368;
  text-align: center;
}
.m3-pill-btn:hover {
  background: #f1f3f4;
  border-color: #c4c7c5;
}
.m3-pill-btn.is-selected {
  border: 1.5px solid #1a73e8;
  background: #ffffff;
  color: #1a73e8;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.15);
}

/* 底部 M3 操作条 */
.m3-footer {
  margin-top: auto;
  padding: 13px 18px;
  border-top: 1px solid #f1f3f4;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.m3-text-btn {
  border: 0;
  background: transparent;
  color: #1a73e8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.m3-text-btn:hover {
  background: #f1f3f4;
  text-decoration: underline;
}
.m3-primary-btn {
  background: #0b57d0;
  color: #ffffff;
  border: 0;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: all 0.15s;
}
.m3-primary-btn:hover {
  background: #0842a0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.m3-primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 正在处理态 */
.m3-working-banner {
  background: #f0f4f9;
  border: 1px solid #d2e3fc;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  color: #1a73e8;
}
.m3-spinner-ring {
  width: 22px;
  height: 22px;
  border: 2.5px solid #d2e3fc;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: m3-spin 0.8s linear infinite;
  margin: 0 auto 10px;
}
@keyframes m3-spin {
  to { transform: rotate(360deg); }
}

/* ========================================================
   创作者专属：写作参考提要抽屉 (Creator Reference Dock)
   ======================================================== */
.creator-dock {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.creator-dock-lead {
  font-size: 12px;
  color: #444746;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.creator-dock-lead span {
  color: #137333;
  font-weight: 600;
}
.creator-card {
  background: #ffffff;
  border: 1px solid #e0e3e7;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.05);
  transition: all 0.15s;
}
.creator-card:hover {
  border-color: #c4c7c5;
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.1);
}
.creator-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.creator-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f1f1f;
}
.creator-card-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e8f0fe;
  color: #1a73e8;
  white-space: nowrap;
}
.creator-card-body {
  font-size: 12px;
  line-height: 1.6;
  color: #444746;
  margin: 0 0 10px 0;
  background: #f8fafd;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid #1a73e8;
}
.creator-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.creator-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: #444746;
  cursor: pointer;
  transition: all 0.15s;
}
.creator-action-btn:hover {
  background: #f1f3f4;
  color: #1f1f1f;
  border-color: #c4c7c5;
}
.creator-action-btn.btn-accent {
  background: #e8f0fe;
  border-color: #d2e3fc;
  color: #0b57d0;
  font-weight: 500;
}
.creator-action-btn.btn-accent:hover {
  background: #dbe7fb;
}

/* 详情抽屉折叠项 */
.m3-details {
  border-top: 1px solid #f1f3f4;
  padding-top: 10px;
  margin-top: 4px;
}
.m3-details summary {
  font-size: 12px;
  color: #5f6368;
  cursor: pointer;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.m3-details summary:hover {
  color: #1f1f1f;
}
.m3-details-content {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: #5f6368;
  background: #f8fafd;
  padding: 10px 12px;
  border-radius: 8px;
}
.m3-details-content p {
  margin: 0 0 6px;
}
.m3-details-content p:last-child {
  margin-bottom: 0;
}

/* 弹窗升级为 M3 风格 */
.intent-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 60px);
  margin: auto;
  overflow: auto;
  border: 1px solid #dadce0;
  border-radius: 16px;
  padding: 24px;
  background: #ffffff;
  color: #1f1f1f;
  box-shadow: 0 24px 48px rgba(60, 64, 67, 0.2);
  font-family: inherit;
}
.intent-dialog::backdrop {
  background: rgba(32, 33, 36, 0.4);
  backdrop-filter: blur(2px);
}
.intent-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.intent-dialog h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f1f1f;
}
.intent-dialog-close {
  border: 0;
  background: transparent;
  color: #5f6368;
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}
.intent-dialog-close:hover {
  background: #f1f3f4;
}
.intent-dialog-description {
  margin: 10px 0 16px;
  color: #5f6368;
  font-size: 13px;
  line-height: 1.6;
}
.intent-dialog textarea {
  width: 100%;
  padding: 12px;
  background: #f8fafd;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font: 13px/1.6 inherit;
  color: #1f1f1f;
  min-height: 100px;
}
.intent-dialog textarea:focus {
  outline: none;
  border-color: #0b57d0;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(11, 87, 208, 0.15);
}
.intent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.intent-chips button {
  padding: 5px 10px;
  border: 1px solid #dadce0;
  border-radius: 16px;
  background: #ffffff;
  color: #444746;
  font-size: 11px;
  cursor: pointer;
}
.intent-chips button:hover {
  background: #f1f3f4;
  color: #1f1f1f;
}
.intent-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.intent-dialog footer button {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #444746;
}
.intent-dialog footer button:hover {
  background: #f1f3f4;
}
.intent-dialog footer .intent-save {
  background: #0b57d0;
  border-color: #0b57d0;
  color: #ffffff;
}
.intent-dialog footer .intent-save:hover {
  background: #0842a0;
}
