:root {
  color-scheme: light;
  --ink: #121922;
  --ink-soft: #293642;
  --muted: #6d7984;
  --faint: #94a1aa;
  --line: #dce5ea;
  --line-strong: #c9d8df;
  --paper: #f4f8fa;
  --surface: #ffffff;
  --surface-soft: #eef5f7;
  --sidebar: #e9f1f5;
  --teal: #069dbf;
  --teal-soft: #e1f6fa;
  --blue: #2878e8;
  --danger: #d84848;
  --shadow-soft: 0 12px 28px rgba(31, 55, 68, 0.07);
  --shadow-panel: 0 20px 54px rgba(31, 55, 68, 0.12);
  --topbar-height: 64px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f9fb;
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(18, 25, 34, 0.08);
  background: rgba(250, 253, 254, 0.92);
  backdrop-filter: blur(18px);
}

.brand,
.sidebar-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: linear-gradient(135deg, #4bd8c7 0%, #2878e8 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.brand-mark::before {
  position: absolute;
  top: 10px;
  left: 9px;
  width: 18px;
  height: 16px;
  background:
    linear-gradient(
      90deg,
      transparent 0 1px,
      #fff 1px 4px,
      transparent 4px 7px,
      #fff 7px 10px,
      transparent 10px 13px,
      #fff 13px 16px,
      transparent 16px
    );
  border-radius: 10px;
  content: "";
}

.brand-mark::after {
  position: absolute;
  top: 8px;
  right: 7px;
  width: 9px;
  height: 9px;
  background: #fff;
  clip-path: polygon(50% 0, 62% 36%, 100% 50%, 62% 64%, 50% 100%, 38% 64%, 0 50%, 38% 36%);
  content: "";
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-button,
.toolbar-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
  padding: 9px 16px;
}

.ghost-button:hover:not(:disabled),
.toolbar-actions button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #fff;
}

.ghost-button:disabled,
.toolbar-actions button:disabled {
  color: var(--faint);
  opacity: 0.74;
}

main {
  min-height: calc(100vh - var(--topbar-height));
}

.status-panel {
  position: relative;
  z-index: 15;
  display: flex;
  width: min(1180px, calc(100% - 40px));
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 18px auto 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  padding: 14px 18px;
  color: var(--muted);
}

.status-panel strong {
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.auth-gate {
  display: grid;
  min-height: calc(100vh - var(--topbar-height));
  grid-template-columns: minmax(420px, 48%) minmax(0, 1fr);
  background:
    linear-gradient(90deg, #ffffff 0%, #ffffff 47.8%, #edf7fb 48%, #d9f5f6 100%);
}

.auth-panel {
  display: flex;
  width: min(520px, calc(100% - 56px));
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  padding: 56px 0;
}

.auth-panel h1 {
  margin: 0 0 18px;
  font-size: 40px;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0;
}

.auth-panel > p:not(.eyebrow) {
  max-width: 460px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
}

.auth-actions {
  display: flex;
  min-height: 48px;
  align-items: center;
  margin-bottom: 24px;
}

.privacy-strip {
  display: grid;
  gap: 4px;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfe;
  padding: 16px 18px;
  color: var(--muted);
}

.privacy-strip strong {
  color: var(--ink);
  font-size: 14px;
}

.product-stage {
  position: relative;
  display: grid;
  min-height: 620px;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  padding: 64px;
}

.device-shadow {
  position: absolute;
  width: 690px;
  height: 410px;
  border-radius: 18px;
  background: rgba(26, 104, 130, 0.12);
  filter: blur(46px);
  transform: translate(26px, 90px);
}

.web-card-preview {
  position: relative;
  display: grid;
  width: min(720px, 88%);
  aspect-ratio: 16 / 10;
  grid-template-columns: 130px 1fr;
  overflow: hidden;
  border: 7px solid #17202a;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-panel);
}

.web-card-preview::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 110px;
  height: 18px;
  border-radius: 0 0 8px 8px;
  background: #17202a;
  content: "";
  transform: translateX(-50%);
}

.preview-sidebar {
  background: var(--sidebar);
}

.preview-document {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 58px 70px;
}

.preview-document span {
  width: 160px;
  height: 13px;
  border-radius: 999px;
  background: var(--teal-soft);
}

.preview-document strong {
  width: 78%;
  height: 30px;
  border-radius: 999px;
  background: #1a2430;
}

.preview-document p {
  width: 100%;
  height: 12px;
  margin: 0;
  border-radius: 999px;
  background: #dce7ed;
}

.preview-document p:nth-child(4) {
  width: 86%;
}

.preview-document p:nth-child(5) {
  width: 64%;
}

.phone-preview {
  position: absolute;
  bottom: 86px;
  left: 12%;
  display: grid;
  width: 180px;
  gap: 12px;
  border: 6px solid #17202a;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(31, 55, 68, 0.16);
  padding: 42px 18px 20px;
}

.phone-preview span,
.phone-preview strong,
.phone-preview p {
  height: 10px;
  margin: 0;
  border-radius: 10px;
  background: #dbe8ee;
}

.phone-preview strong {
  width: 80%;
  height: 16px;
  background: #1a2430;
}

.phone-preview p:last-child {
  width: 68%;
}

.icloud-badge {
  position: absolute;
  right: 13%;
  bottom: 106px;
  border: 1px solid rgba(6, 157, 191, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  color: var(--teal);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
}

.workspace {
  display: grid;
  min-height: calc(100vh - var(--topbar-height));
  grid-template-columns: 220px 320px minmax(0, 1fr);
  background: var(--paper);
}

.workspace-sidebar {
  display: flex;
  min-height: calc(100vh - var(--topbar-height));
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  padding: 18px 16px;
}

.sidebar-logo {
  margin-bottom: 28px;
}

.workspace-nav {
  display: grid;
  gap: 6px;
}

.nav-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

.nav-row.active,
.nav-row:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.82);
}

.nav-row:disabled {
  color: var(--faint);
}

.nav-row strong {
  font-size: 13px;
}

.sidebar-group {
  display: grid;
  gap: 10px;
  margin-top: 34px;
  color: var(--ink-soft);
  font-size: 14px;
}

.sidebar-group p {
  margin: 0 0 2px;
  color: var(--faint);
  font-size: 13px;
}

.sidebar-footer {
  margin-top: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-list {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fbfdfe;
}

.list-header {
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.list-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

#recording-count {
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
}

#recording-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - var(--topbar-height) - 91px);
  overflow: auto;
  padding: 12px;
}

.recording-row {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 104px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

.recording-row:hover,
.recording-row[data-selected="true"] {
  border-color: rgba(6, 157, 191, 0.25);
  background: #eef5f9;
}

.recording-row[data-selected="true"] {
  outline: 1px dashed rgba(40, 120, 232, 0.55);
  outline-offset: -2px;
}

.row-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--faint);
  font-size: 12px;
}

.row-chip {
  width: fit-content;
  border-radius: 4px;
  background: #e8edf1;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 5px 9px;
}

.detail {
  min-width: 0;
  overflow: auto;
  background: var(--surface);
}

.empty-detail {
  display: grid;
  min-height: calc(100vh - var(--topbar-height));
  place-content: center;
  padding: 32px;
  text-align: center;
}

.empty-detail h2 {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 500;
}

.empty-detail p {
  color: var(--muted);
}

.document-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  padding: 12px 26px;
}

.document-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.toolbar-actions button {
  padding: 7px 14px;
}

.document-reader {
  width: min(920px, calc(100% - 72px));
  margin: 0 auto;
  padding: 34px 0 96px;
}

.document-tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 26px;
}

.document-tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 16px;
  font-weight: 650;
  padding: 0 0 8px;
}

.document-tabs button[aria-pressed="true"] {
  border-bottom: 3px solid var(--teal);
  color: var(--teal);
}

.document-reader h1 {
  max-width: 820px;
  margin: 0 auto 38px;
  color: #07111c;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.22;
  text-align: center;
}

.audio-status {
  display: grid;
  grid-template-columns: 30px minmax(160px, max-content) minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  margin: 0 auto 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  color: var(--muted);
}

.audio-status span {
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 0 6px, var(--faint) 6px 8px, transparent 8px),
    linear-gradient(180deg, transparent 0 6px, var(--faint) 6px 8px, transparent 8px);
}

.audio-status strong {
  color: var(--ink-soft);
  font-size: 14px;
}

.audio-status em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.document-body {
  margin: 0 auto;
}

.reader-block {
  margin-bottom: 26px;
  color: var(--ink-soft);
}

.reader-block h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
}

.reader-block h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
}

.reader-block p,
.reader-block li {
  font-size: 15px;
}

.reader-block p {
  margin-bottom: 10px;
}

.reader-block ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
}

.reader-block li::marker {
  color: var(--ink);
  font-size: 1.1em;
}

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

.action-list {
  display: grid;
  gap: 12px;
}

.action-item {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--teal);
  background: #f6fafb;
  padding: 12px 14px;
}

.action-item strong {
  color: var(--ink);
  font-size: 15px;
}

.action-item span {
  color: var(--muted);
  font-size: 13px;
}

.transcript {
  white-space: pre-wrap;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 190px 300px minmax(0, 1fr);
  }

  .document-reader {
    width: min(860px, calc(100% - 48px));
  }
}

@media (max-width: 920px) {
  .auth-gate {
    grid-template-columns: 1fr;
    background: #f7fbfc;
  }

  .auth-panel {
    padding-top: 44px;
  }

  .auth-panel h1 {
    font-size: 38px;
  }

  .product-stage {
    min-height: 420px;
    padding: 24px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-logo,
  .sidebar-group,
  .sidebar-footer {
    display: none;
  }

  .workspace-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recording-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #recording-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 72vw);
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .detail {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand span:last-child {
    display: none;
  }

  .status-panel {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .auth-panel {
    width: calc(100% - 32px);
  }

  .auth-panel h1 {
    font-size: 34px;
  }

  .auth-panel > p:not(.eyebrow) {
    font-size: 15px;
  }

  .product-stage {
    display: none;
  }

  .workspace-nav {
    gap: 4px;
  }

  .nav-row {
    padding: 9px 10px;
  }

  .document-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 18px;
  }

  .document-reader {
    width: calc(100% - 30px);
    padding-top: 24px;
  }

  .document-tabs {
    gap: 18px;
    overflow-x: auto;
  }

  .document-tabs button {
    flex: 0 0 auto;
    font-size: 15px;
  }

  .document-reader h1 {
    font-size: 25px;
    text-align: left;
  }

  .audio-status {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .audio-status em {
    grid-column: 2;
  }
}
