/*
 * 声笺 · Modern minimal theme
 * A clean, product-focused visual layer over the interaction styles.
 */

:root {
  --ink: #101828;
  --ink-soft: #475467;
  --ink-muted: #98a2b3;
  --paper: #ffffff;
  --canvas: #f6f8fc;
  --panel: #f8fafc;
  --white: #ffffff;
  --line: #e7ebf2;
  --line-strong: #d8dfea;
  --coral: #2563eb;
  --coral-dark: #1d4ed8;
  --coral-soft: #eef4ff;
  --sage: #079455;
  --sage-soft: #eaf8f0;
  --amber: #f59e0b;
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.055);
  --soft-shadow: 0 6px 20px rgba(16, 24, 40, 0.055);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: var(--sans);
}

body {
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
}

svg {
  stroke-width: 1.8;
}

.app-shell {
  grid-template-columns: 72px 296px minmax(0, 1fr) 342px;
  background: var(--canvas);
}

.app-shell.ai-collapsed {
  grid-template-columns: 72px 296px minmax(0, 1fr);
}

/* Navigation */
.rail {
  padding: 20px 8px 16px;
  color: #7b8495;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.brand-mark {
  width: 40px;
  height: 40px;
  margin-bottom: 28px;
  color: #ffffff;
  background: linear-gradient(145deg, #3478f6, #175cd3);
  border-radius: 12px;
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.22);
}

.brand-bars {
  gap: 2px;
  height: 17px;
}

.brand-bars i {
  width: 2.5px;
  background: #ffffff;
}

.brand-bars i:nth-child(1) {
  height: 6px;
}

.brand-bars i:nth-child(2) {
  height: 15px;
}

.brand-bars i:nth-child(3) {
  height: 10px;
}

.brand-bars i:nth-child(4) {
  height: 4px;
}

.rail-nav {
  gap: 7px;
}

.rail-button {
  width: 54px;
  min-height: 52px;
  gap: 3px;
  border-radius: 11px;
}

.rail-button span {
  font-size: 9px;
  font-weight: 500;
}

.rail-button:hover {
  color: #344054;
  background: #f3f6fb;
}

.rail-button.is-active {
  color: #155eef;
  background: #edf3ff;
  box-shadow: none;
}

.rail-button.is-active::before {
  display: none;
}

.avatar {
  width: 36px;
  height: 36px;
  margin-top: 15px;
  color: #344054;
  background: #edf2fa;
  border: 1px solid #dce4f0;
  font-family: var(--sans);
  font-weight: 600;
}

.avatar i {
  background: #12b76a;
  border-color: #ffffff;
}

/* Notebook library */
.library {
  background: #fbfcfe;
  border-right: 1px solid var(--line);
}

.library-heading {
  align-items: center;
  padding: 26px 20px 17px;
}

.eyebrow {
  margin-bottom: 4px;
  color: #98a2b3;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.library-heading h1 {
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.icon-button {
  border-radius: 9px;
}

.icon-button.soft {
  color: #475467;
  background: #ffffff;
  border-color: var(--line);
}

#newNoteButton {
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: #101828;
  border-color: #101828;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.14);
}

#newNoteButton:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.search-box {
  height: 40px;
  margin: 0 16px 15px;
  color: #98a2b3;
  background: #f2f5fa;
  border: 1px solid transparent;
  border-radius: 10px;
}

.search-box:focus-within {
  color: #2563eb;
  background: #ffffff;
  border-color: #b7cbfa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.07);
}

.search-box input {
  color: #101828;
  font-size: 12px;
}

.search-box kbd {
  color: #98a2b3;
  background: #ffffff;
  border-color: #e4e9f1;
}

.library-filters {
  gap: 21px;
  margin: 0 20px;
}

.filter-tab {
  color: #8b95a5;
  font-size: 11px;
  font-weight: 500;
}

.filter-tab.is-active {
  color: #175cd3;
}

.filter-tab.is-active::after {
  height: 2px;
  background: #2563eb;
}

.note-list {
  padding: 12px 10px 20px;
}

.note-card {
  margin-bottom: 4px;
  padding: 14px;
  border-radius: 11px;
}

.note-card:hover {
  background: #f5f7fb;
}

.note-card.is-active {
  background: #ffffff;
  border-color: #e1e7f0;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.045);
}

.note-card.is-active::before {
  display: none;
}

.note-card-title {
  color: #182230;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.note-card-time {
  color: #a1aab8;
  font-size: 9px;
}

.note-card-excerpt {
  color: #667085;
  font-size: 10.5px;
  line-height: 1.65;
}

.mini-tag {
  color: #175cd3;
  background: #eef4ff;
  border-radius: 5px;
  font-size: 8px;
}

.audio-badge {
  color: #8d98a8;
}

.favorite-dot {
  background: #f59e0b;
}

.library-footer {
  color: #8b95a5;
  background: #fbfcfe;
  border-color: var(--line);
}

.library-footer span i {
  background: #12b76a;
}

.library-footer button {
  color: #667085;
}

/* Workspace and toolbar */
.workspace {
  background:
    radial-gradient(circle at 48% 4%, rgba(255, 255, 255, 0.85), transparent 34%),
    #f5f7fb;
}

.topbar {
  height: 68px;
  min-height: 68px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.82);
  border-color: #e7ebf2;
  backdrop-filter: blur(16px);
}

.breadcrumb {
  color: #98a2b3;
  font-size: 10px;
  font-weight: 500;
}

.breadcrumb strong {
  color: #344054;
  font-weight: 600;
}

.save-state {
  color: #7d8999;
}

.save-state i {
  background: #12b76a;
}

.top-icon {
  color: #667085;
  border-radius: 8px;
}

.top-icon:hover {
  color: #101828;
  background: #f2f5fa;
}

.ai-toggle {
  color: #175cd3;
  background: #edf4ff;
  border-color: #d9e6ff;
  border-radius: 8px;
  font-size: 9.5px;
}

.ai-toggle:hover {
  color: #1849b4;
  background: #e3edff;
}

.record-button {
  height: 36px;
  color: #ffffff;
  background: #2563eb;
  border-color: #2563eb;
  border-radius: 9px;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.23);
}

.record-button:hover {
  background: #1d4ed8;
}

.record-button span {
  width: 17px;
  height: 17px;
  border-color: rgba(255, 255, 255, 0.45);
}

.record-button span i {
  width: 6px;
  height: 6px;
  background: #ffffff;
}

.editor-scroll {
  padding: 34px 28px 72px;
}

.note-page {
  width: min(100%, 800px);
  padding: 48px 60px 34px;
  background: #ffffff;
  border: 1px solid #e5eaf2;
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(16, 24, 40, 0.055);
}

.note-kicker {
  margin-bottom: 14px;
  color: #98a2b3;
  font-size: 9.5px;
}

.note-type {
  color: #175cd3;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.note-type i {
  width: 5px;
  height: 5px;
  background: #2563eb;
  border-radius: 50%;
}

.note-title {
  margin-bottom: 13px;
  color: #101828;
  font-family: var(--sans);
  font-size: clamp(29px, 3vw, 37px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.3;
}

.note-meta-row {
  margin-bottom: 28px;
  color: #98a2b3;
  font-size: 9.5px;
}

.tag-picker {
  color: #175cd3;
  background: #edf4ff;
  border-radius: 5px;
  font-size: 9px;
}

.meta-divider {
  background: #e5eaf2;
}

/* Audio and editor */
.audio-note {
  margin-bottom: 22px;
  padding: 16px;
  background: #f7f9ff;
  border-color: #e1e8f7;
  border-radius: 13px;
}

.audio-icon {
  width: 32px;
  height: 32px;
  color: #2563eb;
  background: #e9f0ff;
  border-radius: 8px;
}

.audio-title strong {
  color: #1d2939;
  font-size: 10.5px;
}

.audio-title small {
  color: #8490a1;
}

.audio-title small i {
  background: #12b76a;
}

.text-button {
  color: #667085;
}

.text-button:hover {
  color: #175cd3;
}

.play-button {
  color: #ffffff;
  background: #2563eb;
}

.play-button:hover {
  background: #1d4ed8;
}

.waveform {
  color: #cfd8e8;
}

.waveform-progress .waveform {
  color: #3672ef;
}

.audio-time,
.speed-button {
  color: #667085;
}

.speed-button:hover {
  background: #eef2f8;
}

.format-toolbar {
  top: -35px;
  margin-bottom: 16px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.94);
  border-color: #e7ebf2;
  border-radius: 8px;
  opacity: 0.7;
}

.format-toolbar button {
  color: #667085;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
}

.format-toolbar button:hover,
.format-toolbar button.is-active {
  color: #175cd3;
  background: #edf4ff;
}

.format-toolbar > span {
  background: #e8edf4;
}

.note-body {
  color: #344054;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.9;
}

.note-body p {
  margin-bottom: 14px;
}

.note-body h2 {
  margin: 28px 0 10px;
  color: #101828;
  font-family: var(--sans);
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.5;
}

.note-body ul,
.note-body ol {
  padding-left: 22px;
}

.note-body li {
  margin: 6px 0;
}

.note-body blockquote {
  margin: 24px 0;
  padding: 13px 17px;
  color: #344054;
  background: #f7f9fc;
  border-left: 3px solid #2563eb;
  border-radius: 0 8px 8px 0;
  font-style: normal;
}

.note-body strong {
  color: #101828;
  font-weight: 650;
}

.check-line > span:first-child {
  color: transparent;
  border-color: #cbd5e1;
  border-radius: 4px;
}

.check-line.is-checked > span:first-child {
  color: #ffffff;
  background: #079455;
  border-color: #079455;
}

.note-footer {
  color: #98a2b3;
  border-color: #edf0f5;
}

.note-footer button {
  color: #7d8999;
}

.note-footer button:hover {
  color: #175cd3;
}

/* AI workspace */
.ai-pane {
  background: #fbfcfe;
  border-left-color: #e7ebf2;
}

.ai-heading {
  min-height: 74px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.7);
  border-color: #e7ebf2;
}

.ai-orb {
  width: 34px;
  height: 34px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.7), transparent 24%),
    linear-gradient(145deg, #4d8aff, #155eef);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 5px 13px rgba(37, 99, 235, 0.2);
}

.ai-orb i {
  width: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.ai-heading p {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}

.ai-heading span {
  color: #98a2b3;
}

.ai-heading .icon-button {
  color: #7d8999;
}

.ai-content {
  padding: 17px 16px 20px;
}

.ai-notice {
  color: #8d98a8;
}

.ai-notice svg {
  color: #475467;
}

.ai-summary-card {
  padding: 15px;
  background: #ffffff;
  border-color: #e5eaf2;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.04);
}

.section-label {
  color: #344054;
  font-size: 10px;
  font-weight: 650;
}

.spark-icon {
  color: #2563eb;
  background: #edf4ff;
  border-radius: 6px;
}

.plain-icon {
  color: #475467;
  background: #f1f4f8;
  border-radius: 6px;
}

.plain-icon.accent-green {
  color: #079455;
  background: #eaf8f0;
}

.tiny-icon {
  color: #98a2b3;
}

.tiny-icon:hover {
  color: #175cd3;
  background: #f2f5fa;
}

.ai-summary-card > p {
  color: #475467;
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.8;
}

.ai-confidence {
  color: #98a2b3;
}

.ai-confidence i {
  background: #12b76a;
}

.insight-section {
  margin-top: 22px;
}

.count-pill {
  color: #175cd3;
  background: #edf4ff;
}

.count-pill.green {
  color: #087443;
  background: #eaf8f0;
}

.key-points li {
  grid-template-columns: 22px 1fr;
  color: #667085;
  font-size: 9.5px;
}

.key-points li::before {
  width: 20px;
  height: 20px;
  color: #175cd3;
  background: #edf4ff;
  border-radius: 6px;
  font-size: 7.5px;
}

.key-points strong {
  color: #1d2939;
  font-weight: 650;
}

.todo-item {
  padding: 10px;
  color: #475467;
  background: #ffffff;
  border-color: #e5eaf2;
  border-radius: 9px;
}

.todo-item:hover {
  background: #ffffff;
  border-color: #d6dfeb;
}

.todo-check {
  border-color: #c7d0dd;
}

.todo-item.is-done .todo-check {
  background: #12b76a;
  border-color: #12b76a;
}

.todo-owner {
  color: #475467;
  background: #f1f4f8;
}

.ai-quote {
  padding: 15px 15px 13px 20px;
  color: #475467;
  background: #f4f7ff;
  border-left: 2px solid #7ba4f8;
  border-radius: 0 8px 8px 0;
  font-family: var(--sans);
  font-size: 10.5px;
  font-style: normal;
}

.ai-quote::before {
  display: none;
}

.ai-quote cite {
  color: #98a2b3;
}

.ai-bottom {
  padding: 12px 16px 16px;
  background: #fbfcfe;
  border-color: #e7ebf2;
}

.ai-mode {
  color: #8d98a8;
}

.ai-mode span i {
  background: #12b76a;
}

.ai-mode button {
  color: #7d8999;
  border-color: #d6dfea;
}

.organize-button {
  height: 38px;
  color: #ffffff;
  background: #2563eb;
  border-radius: 9px;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.2);
}

.organize-button:hover {
  background: #1d4ed8;
}

/* Recording modal */
.record-backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.record-sheet {
  width: min(560px, calc(100vw - 34px));
  padding: 28px 30px 24px;
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

.record-sheet h2 {
  color: #101828;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.recording-label {
  color: #ef4444;
}

.recording-timer {
  color: #101828;
  font-family: var(--sans);
  font-size: 46px;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.recording-hint,
.live-caption {
  color: #98a2b3;
}

.live-caption i {
  background: #12b76a;
}

.live-transcript {
  background: #f7f9fc;
  border-color: #e5eaf2;
  border-radius: 12px;
}

.live-transcript-head {
  color: #475467;
}

.language-pill {
  color: #667085;
  background: #edf0f5;
}

.live-transcript-text {
  color: #344054;
  font-family: var(--sans);
  font-size: 11.5px;
}

.record-error {
  margin-top: 14px;
  padding: 16px;
  color: #344054;
  background: #fff8f7;
  border: 1px solid #fecdc9;
  border-radius: 12px;
}

.record-error[hidden] {
  display: none;
}

.record-error-icon {
  display: grid;
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  place-items: center;
  color: #d92d20;
  background: #fee4e2;
  border-radius: 8px;
}

.record-error-icon svg {
  width: 17px;
  height: 17px;
}

.record-error-copy h3 {
  margin: 0 0 6px;
  color: #101828;
  font-size: 13px;
  font-weight: 650;
}

.record-error-copy p {
  margin: 0;
  color: #475467;
  font-size: 11px;
  line-height: 1.65;
}

.record-error-copy small {
  display: block;
  margin-top: 6px;
  color: #7d8999;
  font-size: 9.5px;
  line-height: 1.55;
}

.record-error-copy small[hidden] {
  display: none;
}

.record-error-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.record-error-actions button {
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
}

.record-error-actions button[hidden] {
  display: none;
}

.record-retry {
  color: #ffffff;
  background: #2563eb;
  border: 1px solid #2563eb;
}

.record-retry:hover {
  background: #1d4ed8;
}

.record-cancel-error {
  color: #475467;
  background: #ffffff;
  border: 1px solid #e2e7ef;
}

.record-sheet.has-error .live-viz,
.record-sheet.has-error .live-transcript,
.record-sheet.has-error .record-controls,
.record-sheet.has-error .record-control-labels {
  display: none;
}

.record-sheet.has-error .recording-timer {
  margin-top: 10px;
}

.recording-label.is-error {
  color: #d92d20;
}

.transcript-placeholder {
  color: #98a2b3;
}

.record-secondary {
  color: #475467;
  background: #f5f7fa;
  border-color: #e2e7ef;
}

.record-secondary:hover {
  color: #101828;
  background: #eef1f6;
}

.record-main {
  background: #ef4444;
  border-color: #fee2e2;
  box-shadow: 0 0 0 1px #fca5a5;
}

.record-main:hover {
  background: #dc2626;
}

.record-control-labels {
  color: #98a2b3;
}

/* Menus, dialogs, feedback */
.popover {
  background: #ffffff;
  border-color: #e5eaf2;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(16, 24, 40, 0.13);
}

.popover > p {
  color: #98a2b3;
}

.popover > button:hover {
  background: #f3f6fa;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.34);
}

.info-modal {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);
}

.modal-top h2 {
  color: #101828;
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.transcript-toolbar {
  color: #667085;
  background: #f7f9fc;
}

.transcript-toolbar i {
  background: #12b76a;
}

.transcript-toolbar button {
  color: #175cd3;
}

.transcript-line {
  border-color: #edf0f5;
}

.transcript-speaker {
  color: #175cd3;
}

.transcript-time {
  color: #a1aab8;
}

.transcript-line p {
  color: #475467;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.75;
}

.modal-footnote {
  color: #98a2b3;
}

.info-copy {
  color: #475467;
  font-family: var(--sans);
  font-size: 12.5px;
}

.feature-list span {
  color: #475467;
  background: #f7f9fc;
  border: 1px solid #edf0f5;
}

.feature-list i {
  color: #2563eb;
}

.modal-primary {
  background: #2563eb;
}

.toast {
  color: #ffffff;
  background: #101828;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.2);
}

.toast-icon {
  color: #6ce9a6;
  background: rgba(18, 183, 106, 0.18);
}

.is-organizing .ai-summary-card > p {
  background: linear-gradient(90deg, #eef1f5 25%, #f8f9fb 40%, #eef1f5 55%);
}

.is-organizing .key-points li::after,
.is-organizing .todo-item::after {
  background: linear-gradient(90deg, #edf0f5 25%, #f8f9fb 40%, #edf0f5 55%);
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 68px 278px minmax(0, 1fr) 316px;
  }

  .app-shell.ai-collapsed {
    grid-template-columns: 68px 278px minmax(0, 1fr);
  }

  .note-page {
    padding-right: 46px;
    padding-left: 46px;
  }
}

@media (max-width: 1080px) {
  .app-shell,
  .app-shell.ai-collapsed {
    grid-template-columns: 68px 272px minmax(0, 1fr);
  }

  .ai-pane {
    background: #fbfcfe;
    box-shadow: -18px 0 42px rgba(15, 23, 42, 0.12);
  }
}

@media (max-width: 780px) {
  .rail {
    height: 62px;
    background: rgba(255, 255, 255, 0.97);
    border-color: #e7ebf2;
    backdrop-filter: blur(14px);
  }

  .rail-button {
    width: 56px;
    min-height: 50px;
    border-radius: 10px;
  }

  .rail-button.is-active {
    background: transparent;
  }

  .rail-button.is-active::before {
    display: block;
    top: -6px;
    right: 18px;
    left: 18px;
    height: 2px;
    background: #2563eb;
  }

  .library {
    background: #fbfcfe;
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.14);
  }

  .workspace {
    background: #f6f8fc;
  }

  .topbar {
    height: 60px;
    min-height: 60px;
    background: rgba(255, 255, 255, 0.94);
  }

  .mobile-menu {
    color: #475467;
  }

  .ai-toggle {
    width: 32px;
    height: 32px;
  }

  .record-button {
    width: 34px;
    height: 34px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  }

  .editor-scroll {
    padding: 0 0 62px;
  }

  .note-page {
    padding: 30px 20px 28px;
    background: #ffffff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .note-title {
    font-size: 29px;
    line-height: 1.32;
  }

  .audio-note {
    padding: 14px;
  }

  .format-toolbar {
    top: -31px;
  }

  .note-body {
    font-size: 14px;
    line-height: 1.9;
  }

  .record-sheet {
    width: calc(100vw - 20px);
    padding: 24px 20px 20px;
    border-radius: 20px;
  }

  .recording-timer {
    font-size: 40px;
  }

  .ai-pane {
    bottom: 62px;
    width: min(92vw, 354px);
    background: #fbfcfe;
  }
}

.transcript-retry {
  display: inline-flex;
  margin-top: 14px;
  padding: 8px 14px;
  color: #175cd3;
  background: #eff4ff;
  border: 1px solid #c7d7fe;
  border-radius: 9px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.transcript-retry:hover {
  background: #e0eaff;
}
