/* Algen 对话内交互卡片：平面、无光影，和现有 Algen 阅读列同一套 token。 */
.algen-page .algen-ui-card {
  container-type: inline-size;
  margin: 14px 0 2px;
  border: 1px solid var(--ai-line, #D9E3F4);
  border-radius: var(--ai-radius-control, 14px);
  background: var(--ai-surface, #fff);
  overflow: hidden;
}
.algen-page .algen-ui-head {
  padding: 13px 16px 0;
}
.algen-page .algen-ui-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .08em;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--ai-accent, #2457D6);
}
.algen-page .algen-ui-title {
  margin: 5px 0 0;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 650;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 11px 16px 14px;
}
.algen-page .algen-ui-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.algen-page .algen-ui-section-title {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-section-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.algen-page .algen-ui-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
@container (min-width: 560px) {
  .algen-ui-section.is-row .algen-ui-section-body {
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
  }
  .algen-ui-section.is-row .algen-ui-section-body > * {
    flex: 1 1 0;
    min-width: 0;
  }
  .algen-ui-section.is-grid .algen-ui-section-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .algen-ui-section.is-grid .algen-ui-section-body > * {
    min-width: 0;
  }
}
@supports not (container-type: inline-size) {
  @media (min-width: 720px) {
    .algen-ui-section.is-row .algen-ui-section-body { flex-direction: row; }
    .algen-ui-section.is-grid .algen-ui-section-body {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
}
.algen-page .algen-ui-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ai-text, #243247);
  overflow-wrap: anywhere;
}
.algen-page .algen-ui-text p,
.algen-page .algen-ui-stem p,
.algen-page .algen-ui-hint p,
.algen-page .algen-ui-callout > div p {
  margin: 0;
}
.algen-page .algen-ui-text :is(ul,ol),
.algen-page .algen-ui-stem :is(ul,ol),
.algen-page .algen-ui-callout > div :is(ul,ol) {
  margin: 2px 0 0;
  padding-left: 1.25em;
}
.algen-page .algen-ui-text :is(h1,h2,h3,h4),
.algen-page .algen-ui-stem :is(h1,h2,h3,h4),
.algen-page .algen-ui-callout > div :is(h1,h2,h3,h4) {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
}
.algen-page .algen-ui-text.is-title {
  font-size: 15px;
  line-height: 1.55;
  font-weight: 600;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-text.is-muted {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-text.is-caption {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-question {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.algen-page .algen-ui-stem {
  margin: 0;
  font-size: 14px;
  line-height: 1.68;
  font-weight: 550;
  color: var(--ai-text, #243247);
  overflow-wrap: anywhere;
}
.algen-page .algen-ui-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.algen-page .algen-ui-card .algen-ui-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--ai-line, #D9E3F4);
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--ai-text, #243247);
  text-align: left;
  box-shadow: none;
}
.algen-page .algen-ui-card .algen-ui-option:hover:not(:disabled) {
  background: var(--p95, #eff5ff);
  border-color: #c9d6ea;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-card .algen-ui-option.is-selected {
  border-color: var(--ai-accent, #2457D6);
  background: #f3f7ff;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-card .algen-ui-option:disabled {
  cursor: default;
}
.algen-page .algen-ui-option-key {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 7px;
  background: #f0f2f7;
  color: #5f6b7d;
  font-size: 12px;
  line-height: 1;
  font-weight: 650;
}
.algen-page .algen-ui-option.is-selected .algen-ui-option-key {
  background: var(--ai-accent, #2457D6);
  color: #fff;
}
.algen-page .algen-ui-option-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.algen-page .algen-ui-option-label {
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.algen-page .algen-ui-option-desc {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-card.is-answered .algen-ui-option {
  opacity: .55;
}
.algen-page .algen-ui-card.is-answered .algen-ui-option.is-selected {
  opacity: 1;
}
.algen-page .algen-ui-hint {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e8ebf2;
  border-radius: 9px;
  background: #f8f9fb;
  font-size: 12px;
  line-height: 1.6;
  color: var(--txt3, #667386);
}
.algen-page .algen-ui-hint span {
  flex: none;
  font-weight: 600;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}
.algen-page .algen-ui-card .algen-ui-action {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}
.algen-page .algen-ui-card .algen-ui-action.is-primary {
  border-color: var(--ai-accent, #2457D6);
  background: var(--ai-accent, #2457D6);
  color: #fff;
}
.algen-page .algen-ui-card .algen-ui-action.is-primary:hover:not(:disabled) {
  background: #1f56cc;
  border-color: #1f56cc;
  color: #fff;
}
.algen-page .algen-ui-card .algen-ui-action.is-secondary {
  border-color: var(--line, #dfe4ed);
  background: #fff;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-card .algen-ui-action.is-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ai-accent, #2457D6);
  padding-left: 6px;
  padding-right: 6px;
}
.algen-page .algen-ui-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.algen-page .algen-ui-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #e9ecf2;
  border-radius: 10px;
  background: #fafbfd;
}
.algen-page .algen-ui-stat-label {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-stat-value {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 650;
  color: var(--ai-text, #243247);
  overflow-wrap: anywhere;
}
.algen-page .algen-ui-stat-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #e9ecf2;
  border-radius: 10px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.algen-page .algen-ui-table-wrap table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.5;
}
.algen-page .algen-ui-table-wrap th,
.algen-page .algen-ui-table-wrap td {
  padding: 8px 10px;
  border-bottom: 1px solid #eff1f5;
  text-align: left;
  white-space: nowrap;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-table-wrap th {
  background: #f8f9fb;
  font-weight: 600;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-table-wrap tr:last-child td {
  border-bottom: 0;
}
.algen-page .algen-ui-caption {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-list {
  display: flex;
  flex-direction: column;
}
.algen-page .algen-ui-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #eff1f5;
}
.algen-page .algen-ui-list-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}
.algen-page .algen-ui-list-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.algen-page .algen-ui-list-main strong {
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 550;
  color: var(--ai-text, #243247);
  overflow-wrap: anywhere;
}
.algen-page .algen-ui-list-main small {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-badge {
  flex: none;
  padding: 2px 7px;
  border: 1px solid #e4e8ef;
  border-radius: 999px;
  background: #fbfcfe;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-callout {
  padding: 9px 11px;
  border-left: 3px solid var(--ai-accent, #2457D6);
  border-radius: 0 9px 9px 0;
  background: #f7f9fc;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-callout strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-callout > div {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
}
.algen-page .algen-ui-callout.is-success {
  border-left-color: #1f8a5b;
  background: #f4faf7;
}
.algen-page .algen-ui-callout.is-warning {
  border-left-color: #b7791f;
  background: #fcf9f2;
}
.algen-page .algen-ui-callout.is-danger {
  border-left-color: #c0392b;
  background: #fdf6f5;
}
.algen-page .algen-ui-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.algen-page .algen-ui-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-progress-label b {
  font-weight: 600;
  color: var(--ai-text, #243247);
}
.algen-page .algen-ui-progress-track {
  height: 6px;
  border-radius: 999px;
  background: #edf0f5;
  overflow: hidden;
}
.algen-page .algen-ui-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ai-accent, #2457D6);
}
.algen-page .algen-ui-receipt {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 16px;
  border-top: 1px solid #eff1f5;
  background: #fafbfd;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ai-muted, #5A6577);
}
.algen-page .algen-ui-receipt strong {
  font-weight: 550;
  color: var(--ai-text, #243247);
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .algen-page .algen-ui-head { padding: 12px 13px 0; }
  .algen-page .algen-ui-body { padding: 10px 13px 13px; }
  .algen-page .algen-ui-title { font-size: 15px; }
  .algen-page .algen-ui-stats { grid-template-columns: 1fr 1fr; gap: 6px; }
  .algen-page .algen-ui-stat-value { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .algen-page .algen-ui-card * { animation: none !important; transition: none !important; }
}
