/* AI 会议助手 · 测试页面样式（手机优先，正式界面到位后替换） */
:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --border: #e9e1d6;
  --divider: #e7ded3;
  --text: #29262a;
  --muted: #77737a;
  --primary: #8c293d;
  --primary-down: #712034;
  --gold: #c6ac7c;
  --gold-deep: #b98b4e;
  --gold-fill: #e8cd98;
  --tint: #feefdb;
  --pink: #f4e8ea;
  --ok: #2f6b4f;
  --ok-fill: #e3efe7;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--primary);
}

h1,
h2,
h3,
h4 {
  line-height: 1.35;
  margin: 0 0 8px;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 19px;
}

h3 {
  font-size: 17px;
}

h4 {
  font-size: 16px;
}

p {
  margin: 0 0 8px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  flex: 1;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(41, 38, 42, 0.06);
  padding: 16px;
  margin-bottom: 12px;
}

.hint {
  color: var(--muted);
  font-size: 14px;
}

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

.offscreen {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
}

/* buttons */

button,
.button {
  font: inherit;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:active {
  background: var(--primary-down);
}

.secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

.danger {
  background: var(--card);
  color: var(--primary);
  border-color: var(--primary);
}

.modal .danger {
  background: var(--primary);
  color: #fff;
}

.wide {
  width: 100%;
}

.link-button {
  background: none;
  border: none;
  color: var(--primary);
  padding: 8px 4px;
}

.icon-button {
  background: none;
  border: none;
  color: var(--muted);
  min-width: 44px;
  padding: 0;
}

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

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

/* forms */

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] {
  font: inherit;
  font-size: 16px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

input:focus {
  border-color: var(--gold-deep);
  outline: none;
}

.password {
  position: relative;
}

.password input {
  padding-right: 48px;
}

.password .icon-button {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.human-check {
  min-height: 65px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

.links a {
  padding: 10px 0;
}

.alert {
  background: var(--pink);
  color: var(--primary-down);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}

.note {
  background: var(--tint);
  border-color: var(--gold-fill);
}

.success {
  color: var(--ok);
}

.rules {
  list-style: none;
  margin: -4px 0 0;
  padding: 0;
  font-size: 14px;
  color: var(--muted);
}

.rule::before {
  content: "○ ";
}

.rule.ok {
  color: var(--ok);
}

.rule.ok::before {
  content: "✓ ";
}

/* sign-in brand */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--gold-fill);
  font-weight: 700;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  margin: 0;
  color: var(--gold-deep);
  font-size: 14px;
}

.brand-title {
  margin: 0;
}

.notice h2 {
  color: var(--primary);
}

/* top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px 0 12px;
}

.app-name {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  padding: 10px 0;
}

.account {
  position: relative;
}

.avatar {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--gold-fill);
  color: var(--primary-down);
  font-weight: 700;
}

.menu {
  position: absolute;
  right: 0;
  top: 52px;
  z-index: 5;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(41, 38, 42, 0.12);
  padding: 12px;
}

.menu-name {
  font-weight: 600;
  margin: 0;
}

.menu-email {
  color: var(--muted);
  font-size: 14px;
  word-break: break-all;
}

.menu-item {
  width: 100%;
  background: var(--pink);
  color: var(--primary);
}

/* upload */

.upload-start {
  width: 100%;
  flex-direction: column;
  background: var(--tint);
  border: 1px dashed var(--gold);
  border-radius: 12px;
  padding: 20px 16px;
  color: var(--text);
  text-align: center;
}

.upload-start strong {
  font-size: 18px;
}

.upload-icon {
  color: var(--primary);
}

.upload .field,
.upload .note {
  margin-bottom: 12px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--gold-deep);
}

.file-name {
  color: var(--text);
  margin: 0;
  word-break: break-all;
}

.segments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segment {
  flex: 1 1 auto;
  position: relative;
}

.segment input {
  position: absolute;
  opacity: 0;
}

.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  background: #fff;
}

.segment input:checked + span {
  background: var(--tint);
  border-color: var(--primary);
  color: var(--primary);
}

.segment input:focus-visible + span {
  outline: 2px solid var(--gold-deep);
}

.bar {
  height: 10px;
  border-radius: 5px;
  background: var(--divider);
  overflow: hidden;
  margin: 8px 0;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.3s;
}

/* list */

.section-title {
  margin-top: 20px;
}

.meeting {
  display: block;
  color: inherit;
  text-decoration: none;
}

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

.meeting-title {
  margin: 0;
  word-break: break-word;
}

.preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 4px 0 0;
}

.failure {
  color: var(--primary);
  font-size: 14px;
  margin: 0;
}

.badge {
  flex: none;
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.busy {
  background: var(--tint);
  color: var(--gold-deep);
}

.badge.done {
  background: var(--ok-fill);
  color: var(--ok);
}

.badge.failed {
  background: var(--pink);
  color: var(--primary);
}

.empty {
  text-align: center;
  color: var(--gold-deep);
  padding: 28px 16px;
}

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

/* detail */

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  text-decoration: none;
}

.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.detail-title {
  word-break: break-word;
}

.rename {
  margin-bottom: 8px;
}

.steps {
  list-style: none;
  padding: 16px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: var(--muted);
}

.step .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--divider);
  flex: none;
}

.step.done {
  color: var(--text);
}

.step.done .dot {
  background: var(--ok);
  border-color: var(--ok);
}

.step.current {
  color: var(--primary);
  font-weight: 600;
}

.step.current .dot {
  border-color: var(--primary);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    background: var(--gold-fill);
  }
}

.failed-card {
  background: var(--pink);
  border-color: var(--pink);
}

.failed-card h3 {
  color: var(--primary);
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--divider);
  margin: 8px 0 12px;
}

.tab {
  flex: 1;
  background: none;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
}

.tab[aria-selected="true"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.lang-switch {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 4px;
  padding: 6px 0;
  margin-bottom: 8px;
  background: var(--bg);
}

.lang {
  flex: 1;
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}

.lang.on {
  background: var(--tint);
  border-color: var(--primary);
  color: var(--primary);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-head h3 {
  margin: 0;
}

.notes-section ul {
  margin: 4px 0 0;
  padding-left: 20px;
}

.notes-section li {
  margin-bottom: 6px;
}

.topic + .topic {
  margin-top: 10px;
}

.timed {
  list-style: none;
  padding-left: 0 !important;
}

.timed li {
  border-top: 1px solid var(--divider);
  padding-top: 6px;
}

.timed li:first-child {
  border-top: none;
}

.timed-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.time {
  flex: none;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.footnote {
  margin-top: 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.count {
  flex: none;
}

.transcript .line {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--divider);
}

.transcript .line:first-child {
  border-top: none;
}

.transcript .time {
  min-width: 64px;
  padding-top: 2px;
}

mark {
  background: var(--gold-fill);
  color: inherit;
  border-radius: 3px;
}

.bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* toast and dialog */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  z-index: 20;
  max-width: calc(100% - 32px);
}

.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  background: rgba(41, 38, 42, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
}

.modal-card .actions {
  justify-content: flex-end;
}

@media (min-width: 600px) {
  .modal {
    align-items: center;
  }

  .wrap {
    padding-top: 24px;
  }
}
