:root {
  --bg: #f5f5f7;
  --rail: #f6f6f7;
  --source: #eeeeef;
  --panel: #ffffff;
  --text: #1f2329;
  --muted: #8a8f99;
  --line: #d8dadd;
  --accent: #8b2ce6;
  --accent-soft: #ead9ff;
  --accent-strong: #6d20c8;
  --orange: #ff9800;
  --shadow: 0 10px 28px rgba(22, 25, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}

.reader {
  display: grid;
  grid-template-columns: 60px 270px 430px 1fr;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.reader.video-mode {
  grid-template-columns: 60px 270px 1fr;
}

.reader.video-mode .entries {
  border-right: 0;
  background: #fbfbfc;
}

.reader.video-mode .article {
  display: none;
}

.reader.video-mode .entries-head .entry-tools {
  flex: 1;
  justify-content: flex-end;
}

.reader.video-mode .entries-head [data-unified-switcher] {
  margin-right: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 10px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.nav > .icon-button:last-of-type {
  margin-top: auto;
  margin-bottom: 58px;
}

.nav-article-tools {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
  padding-top: 4px;
}

.nav-article-action {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  border-radius: 10px !important;
  font-size: 18px !important;
}

.nav-article-action svg,
.nav-article-action.save-button svg {
  width: 19px;
  height: 19px;
}

.nav-article-action:disabled,
.nav-article-action.is-disabled {
  cursor: default;
  opacity: 0.32;
  pointer-events: none;
}

.nav-article-action.is-saved {
  background: var(--accent-strong);
  color: #fff;
}

.nav .nav-article-action[data-tooltip]::after {
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%) translateX(-4px);
}

.nav .nav-article-action[data-tooltip]:hover::after {
  transform: translateY(-50%) translateX(0);
}

.brand {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--orange);
  border-radius: 50%;
  color: var(--orange);
  font-weight: 800;
  margin-bottom: 6px;
}

.icon-button,
.article-tools button,
.entry-tools button,
.group-title button,
.right-tools a {
  position: relative;
  border: 0;
  background: transparent;
  color: #616772;
  font-size: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button:active,
.icon-button:active,
.tool-link:active {
  transform: scale(0.94);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
}

.icon-button:hover,
.icon-button.active {
  background: #fff3dc;
  color: var(--orange);
  box-shadow: 0 8px 18px rgba(255, 152, 0, 0.14);
}

.sources {
  overflow-y: auto;
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  background: var(--source);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 10px;
  padding: 4px;
  border: 1px solid rgba(216, 218, 221, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.64);
}

.mode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #5e6570;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.mode-button svg {
  width: 17px;
  height: 17px;
}

.mode-button:hover {
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
}

.mode-button.active {
  background: #fff;
  color: var(--orange);
  box-shadow: 0 7px 18px rgba(22, 25, 31, 0.08);
}

.source-top {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.source,
.feed,
.group,
.group-feed {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.source:hover,
.feed:hover,
.group:hover,
.group-feed:hover {
  background: rgba(255, 255, 255, 0.68);
}

.source.active,
.feed.active,
.group.active,
.group-feed.active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.line-icon {
  display: inline-grid;
  place-items: center;
  color: #4f5662;
}

.source.active .line-icon {
  color: var(--accent-strong);
}

.source strong,
.feed strong,
.group strong,
.group-feed strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source em,
.feed em,
.group em,
.group-feed em {
  color: var(--muted);
  font-style: normal;
}

.history-search {
  margin: 0 0 12px;
}

.history-search input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 6px;
  color: #626873;
  font-size: 14px;
}

.group-title button,
.entry-tools button,
.article-tools button,
.tool-link {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.entry-tools button[hidden] {
  display: none;
}

.entry-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.group-title button:hover,
.entry-tools button:hover,
.article-tools button:hover,
.tool-link:hover {
  background: #f1e7ff;
  color: var(--accent-strong);
}

.refresh-meta {
  display: grid;
  gap: 2px;
  padding: 0 6px 8px;
  color: var(--muted);
  font-size: 12px;
}

.feed-list {
  display: grid;
  gap: 2px;
}

.group-list,
.group-feeds {
  display: grid;
  gap: 2px;
  margin-bottom: 14px;
}

.group-block {
  border: 1px dashed transparent;
  border-radius: 8px;
  margin-bottom: 2px;
}

.group-block.drop-target,
.group.drop-target {
  border-color: var(--accent);
  background: #f2e6ff;
}

.group {
  width: 100%;
  grid-template-columns: 24px 1fr auto 28px;
}

.group[draggable="true"] {
  cursor: grab;
}

.group[draggable="true"]:active {
  cursor: grabbing;
}

.group-arrow {
  display: inline-grid;
  place-items: center;
  color: #5f6570;
}

.group-arrow svg {
  width: 17px;
  height: 17px;
}

.group-actions {
  display: inline-grid;
  place-items: center;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.group:hover .group-actions,
.group.active .group-actions {
  opacity: 1;
  transform: translateX(0);
}

.group-more {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--muted);
}

.group-more:hover {
  background: rgba(139, 44, 230, 0.12);
  color: var(--accent-strong);
}

.group-more svg {
  width: 18px;
  height: 18px;
}

.group-feeds {
  display: none;
  margin: 2px 0 8px 22px;
}

.group-block.expanded .group-feeds {
  display: grid;
}

.group-feed {
  grid-template-columns: 22px 1fr auto;
  min-height: 30px;
  padding-left: 6px;
  font-size: 13px;
}

.group-empty {
  margin: 0 6px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.feed-icon,
.feed-badge {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: #eef2f7;
  color: white;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  flex: 0 0 auto;
}

.feed-icon.round {
  border-radius: 50%;
}

.entry .feed-badge {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.article-meta .feed-badge {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

.feed-icon img,
.feed-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #eef2f7;
}

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

.entries-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 250, 0.94);
  backdrop-filter: blur(8px);
}

.entries-head h1 {
  display: inline;
  margin: 0 10px 0 0;
  font-size: 18px;
}

.entries-head span {
  color: var(--muted);
}

.entry-list {
  height: calc(100vh - 52px);
  overflow-y: auto;
  padding: 0 10px 18px;
}

.reader.video-mode .entry-list {
  padding: 26px 28px 46px;
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: 10px 1fr 100px;
  gap: 8px;
  width: 100%;
  min-height: 104px;
  margin: 0;
  padding: 10px 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.entry.selected {
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}

.entry .dot {
  opacity: 0;
  width: 8px;
  height: 8px;
  margin-top: 46px;
  border-radius: 50%;
  background: var(--accent);
}

.entry.unread .dot {
  opacity: 1;
}

.entry.read strong {
  color: #3e4550;
  font-weight: 650;
}

.entry.read p,
.entry.read small {
  color: var(--muted);
}

.entry-copy {
  min-width: 0;
}

.entry small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #666c76;
  font-size: 12px;
}

.entry strong {
  display: -webkit-box;
  margin: 6px 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.entry p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #6c737f;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.entry img {
  width: 92px;
  height: 68px;
  align-self: center;
  border-radius: 7px;
  object-fit: cover;
}

.entry .feed-badge img,
.article-meta .feed-badge img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: contain;
}

.entry time {
  position: absolute;
  right: 12px;
  top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.article {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
}

.article-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 22px;
  border-bottom: 1px solid #f0f0f0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.left-tools,
.right-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.left-tools .ai-summary-control {
  display: flex;
  align-items: center;
  margin-left: 4px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.save-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 24px !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.save-button svg {
  width: 23px;
  height: 23px;
}

.save-button:hover {
  background: #f1e7ff;
  color: var(--accent);
  transform: scale(1.08);
}

.save-button.is-saved {
  background: var(--accent-strong);
  color: #fff;
}

.save-button.is-saved svg {
  fill: currentColor;
}

.tool-button,
.tool-link {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 9px;
}

.tool-button:hover,
.tool-link:hover {
  background: #f1e7ff;
  color: var(--accent-strong);
}

.ai-summary-toggle.is-active {
  background: #f1e7ff;
  color: var(--accent-strong);
}

.ai-summary-toggle.is-running svg {
  animation: pulse 1.3s ease-in-out infinite;
}

.is-spinning svg {
  animation: spin 0.75s linear infinite;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 180px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(31, 35, 41, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.article-body {
  height: calc(100vh - 52px);
  overflow-y: auto;
  padding: 26px 32px 64px;
}

.article-meta,
.article-body > h2,
.article-body > time,
.article-body > .ai-summary-card,
.article-body > .content {
  width: min(1080px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6c737f;
  font-size: 14px;
}

.article-body h2 {
  margin: 12px 0 6px;
  font-size: clamp(26px, 2.5vw, 38px);
  line-height: 1.22;
  letter-spacing: 0;
}

.ai-summary-card {
  position: relative;
  margin: 22px 0 22px;
  overflow: hidden;
  padding: 24px 26px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94)),
    repeating-linear-gradient(90deg, rgba(99, 102, 241, 0.055) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(14, 165, 233, 0.045) 0 1px, transparent 1px 38px);
  box-shadow: 0 24px 70px rgba(39, 55, 93, 0.1);
}

.ai-summary-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 0%, rgba(124, 58, 237, 0.16) 35%, rgba(14, 165, 233, 0.18) 50%, transparent 70%);
  opacity: 0.58;
  transform: translateX(-65%);
  animation: aiSheen 7s ease-in-out infinite;
}

.ai-summary-scan {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #06b6d4, #22c55e, #7c3aed);
  background-size: 220% 100%;
  animation: aiSignal 4s linear infinite;
}

.ai-summary-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  color: #6d28d9;
  font-weight: 800;
}

.ai-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
}

.ai-summary-head svg {
  width: 18px;
  height: 18px;
}

.ai-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-summary-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #475569;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.ai-summary-actions button:hover {
  background: #eef6ff;
  color: #1263b4;
}

.ai-summary-actions button:first-child {
  width: 32px;
  padding: 0;
  justify-content: center;
}

.ai-summary-head em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

.ai-summary-card p {
  position: relative;
  margin: 0;
  color: #243247;
  font-size: 16px;
  line-height: 1.8;
}

.ai-summary-footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  color: #64748b;
  font-size: 12px;
}

.ai-summary-footer span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.ai-summary-card.is-pending {
  border-color: rgba(148, 163, 184, 0.25);
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.9)),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.05) 0 1px, transparent 1px 42px);
  box-shadow: none;
}

.ai-prompt-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(6px);
}

.ai-prompt-dialog {
  width: min(760px, calc(100vw - 44px));
  padding: 24px;
  border: 1px solid rgba(216, 218, 221, 0.92);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.ai-prompt-head,
.ai-prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ai-prompt-head h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.ai-prompt-head button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #64748b;
}

.ai-prompt-dialog p {
  margin: 16px 0 12px;
  color: #64748b;
}

.ai-prompt-dialog textarea {
  width: 100%;
  min-height: 250px;
  resize: vertical;
  padding: 14px;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  color: #1f2937;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ai-scope-settings {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #f8fbff;
}

.ai-scope-settings h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.ai-scope-settings p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.ai-scope-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-scope-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.ai-scope-option.active {
  border-color: #5aa7ff;
  background: #eef6ff;
  color: #1263b4;
  font-weight: 700;
}

.ai-prompt-actions {
  margin-top: 16px;
  justify-content: flex-end;
}

.ai-prompt-actions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
}

.ai-prompt-actions button.secondary {
  background: #eef2f7;
  color: #334155;
}

.article-body time {
  display: block;
  margin-bottom: 22px;
  color: var(--muted);
}

.content {
  color: #262a31;
  font-size: 16.5px;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px auto;
  border-radius: 2px;
  object-fit: contain;
}

.content svg {
  width: auto;
  max-width: 100%;
  height: auto;
  fill: revert;
  stroke: revert;
  color: #111827;
  background: #ffffff;
}

.content svg text,
.content svg tspan,
.content svg .label,
.content svg foreignObject,
.content svg foreignObject * {
  fill: #111827 !important;
  color: #111827 !important;
  stroke: none !important;
}

.content p {
  margin: 0 0 1.15em;
}

.content h1,
.content h2,
.content h3,
.content h4 {
  margin: 1.35em 0 0.65em;
  line-height: 1.28;
}

.content > *:first-child {
  margin-top: 0 !important;
}

.content div,
.content section,
.content article,
.content figure,
.content table,
.content blockquote {
  max-width: 100% !important;
}

.content figure {
  margin: 28px 0;
}

.content [style*="float"] {
  float: none !important;
}

.content [style*="position:absolute"],
.content [style*="position: absolute"] {
  position: static !important;
}

.content [style*="margin-left"],
.content [style*="margin-right"] {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.content a {
  color: #2563eb;
}

.empty,
.empty-list {
  color: var(--muted);
  text-align: center;
}

.empty {
  margin-top: 18vh;
}

.empty-list {
  padding: 40px 18px;
}

.empty-list p {
  margin: 0 0 14px;
}

.empty-action,
.video-inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #f1e7ff;
  color: var(--accent-strong);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.empty-action:hover,
.video-inline-action:hover {
  background: #ead8ff;
}

.video-inline-action {
  margin-left: 10px;
}

.video-inline-action:disabled {
  cursor: wait;
  opacity: 0.65;
}

.menu-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.menu-popover {
  position: fixed;
  display: grid;
  min-width: 178px;
  padding: 6px;
  border: 1px solid rgba(216, 218, 221, 0.92);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(21, 25, 32, 0.16);
  backdrop-filter: blur(14px);
  animation: menuIn 0.13s ease-out;
}

.menu-popover button {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #2f3540;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.menu-popover button:hover {
  background: #f4ecff;
  color: var(--accent-strong);
}

.menu-popover button.danger {
  color: #b42318;
}

.menu-popover button.danger:hover {
  background: #fde9e7;
}

.menu-popover button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.menu-popover svg {
  width: 18px;
  height: 18px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 30px 20px;
}

.video-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.video-card:hover .video-thumb {
  box-shadow: 0 14px 28px rgba(22, 25, 31, 0.16);
  transform: translateY(-2px);
}

.video-card:hover strong {
  color: var(--accent-strong);
}

.video-card.read {
  opacity: 0.74;
}

.video-card.saved .video-thumb::after {
  content: "收藏";
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.video-thumb {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #e5e7eb;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.video-thumb img,
.video-hero img,
.video-hero iframe,
.video-hero video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-thumb img,
.video-hero img {
  object-fit: cover;
}

.video-hero iframe,
.video-hero video {
  background: #000;
}

.image-story {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 72%);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  background: #111827;
}

.image-story img {
  object-fit: contain;
  scroll-snap-align: start;
}

.duration {
  position: absolute;
  right: 8px;
  bottom: 7px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.video-card strong {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-card small {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  color: #626873;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-detail {
  max-width: 1280px;
  margin: 0 auto;
}

.video-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  margin-bottom: 18px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: #f0f1f3;
  color: #5f6570;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.video-back:hover {
  background: #f1e7ff;
  color: var(--accent-strong);
}

.video-hero {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  box-shadow: 0 20px 44px rgba(22, 25, 31, 0.16);
}

.play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 76px;
  height: 54px;
  border-radius: 16px;
  background: #ff0033;
  color: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.video-hero:hover .play-button {
  transform: translate(-50%, -50%) scale(1.06);
}

.play-button svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.video-copy {
  max-width: 760px;
  padding: 24px 0 60px;
}

.video-copy h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.25;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--muted);
}

.video-playback-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.video-copy > p:last-of-type {
  color: #4b5563;
  font-size: 16px;
  line-height: 1.75;
}

.watch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin-top: 8px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: #111827;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.watch-button:hover {
  background: var(--accent-strong);
}

.watch-button.secondary {
  background: #e8eef7;
  color: #1f2937;
}

.watch-button.secondary:hover {
  background: #d8e2f0;
}

.video-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.78;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

@keyframes aiSignal {
  to {
    background-position: 220% 0;
  }
}

@keyframes aiSheen {
  0%,
  46%,
  100% {
    transform: translateX(-70%);
    opacity: 0;
  }
  58% {
    transform: translateX(72%);
    opacity: 0.58;
  }
}

@media (max-width: 1100px) {
  .reader {
    grid-template-columns: 56px 210px 360px 1fr;
  }

  .reader.video-mode {
    grid-template-columns: 56px 210px 1fr;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .article-body {
    padding: 32px 44px 72px;
  }
}

@media (max-width: 820px) {
  .reader {
    grid-template-columns: 48px 1fr;
  }

  .sources {
    display: none;
  }

  .entries {
    border-right: 0;
  }

  .article {
    display: none;
  }

  .reader.video-mode {
    grid-template-columns: 48px 1fr;
  }

  .nav > .icon-button:first-of-type,
  .nav > .icon-button:last-of-type {
    margin: 0;
  }

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