/*
 * OSS Intelligence UI system
 * One restrained product language across the desktop shell, reader, daily digest
 * and management console. Functional selectors remain compatible with the
 * existing application markup and JavaScript.
 */

:root {
  color-scheme: light;
  --ui-primary: #0f6b5c;
  --ui-primary-hover: #0b584c;
  --ui-primary-strong: #09483f;
  --ui-primary-soft: #e9f4f1;
  --ui-primary-tint: #f3f9f7;
  --ui-secondary: #4e5f5b;
  --ui-bg: #f3f5f4;
  --ui-bg-strong: #e9eeec;
  --ui-surface: #ffffff;
  --ui-surface-subtle: #f8faf9;
  --ui-surface-tint: #f2f7f5;
  --ui-border: #dce3e1;
  --ui-border-strong: #c8d2cf;
  --ui-text: #17211f;
  --ui-text-secondary: #52605d;
  --ui-text-muted: #7b8784;
  --ui-success: #18734a;
  --ui-success-bg: #eaf6ef;
  --ui-warning: #9a6700;
  --ui-warning-bg: #fff7e5;
  --ui-error: #b42318;
  --ui-error-bg: #fff0ee;
  --ui-info: #2563eb;
  --ui-info-bg: #edf4ff;
  --ui-rail: #0d2b26;
  --ui-rail-soft: #153b34;
  --ui-rail-line: rgba(255, 255, 255, 0.1);
  --ui-rail-text: #e7f2ef;
  --ui-rail-muted: #9db8b1;
  --ui-radius-sm: 8px;
  --ui-radius: 12px;
  --ui-radius-lg: 16px;
  --ui-shadow-sm: 0 1px 2px rgba(15, 35, 30, 0.05);
  --ui-shadow: 0 12px 32px rgba(15, 35, 30, 0.08);
  --ui-shadow-lg: 0 24px 64px rgba(15, 35, 30, 0.12);
  --ui-font: "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ui-font-display: "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ui-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ui-primary: #55c9b0;
  --ui-primary-hover: #73d8c2;
  --ui-primary-strong: #9ae5d5;
  --ui-primary-soft: #163b35;
  --ui-primary-tint: #102d28;
  --ui-bg: #0b1110;
  --ui-bg-strong: #111a18;
  --ui-surface: #121c1a;
  --ui-surface-subtle: #172320;
  --ui-surface-tint: #142521;
  --ui-border: #263633;
  --ui-border-strong: #354844;
  --ui-text: #e7efed;
  --ui-text-secondary: #b2c0bd;
  --ui-text-muted: #82918e;
  --ui-success: #72d8a6;
  --ui-success-bg: #113326;
  --ui-warning: #f1c26d;
  --ui-warning-bg: #332712;
  --ui-error: #ffaaa2;
  --ui-error-bg: #39191a;
  --ui-info: #8fc2ff;
  --ui-info-bg: #16283e;
  --ui-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --ui-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  --ui-shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.34);
}

::selection {
  background: rgba(15, 107, 92, 0.18);
}

:where(button, input, select, textarea, a):focus-visible {
  outline: 2px solid var(--ui-primary);
  outline-offset: 2px;
}

:where(input, select, textarea) {
  accent-color: var(--ui-primary);
}

:where(
  .desktop-shell,
  .reader-page,
  .daily-page,
  .manage-page
) {
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--ui-border-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--ui-border-strong);
  background-clip: padding-box;
}

/* -------------------------------------------------------------------------- */
/* Desktop shell                                                              */
/* -------------------------------------------------------------------------- */

[hidden] {
  display: none !important;
}

.desktop-shell {
  --desktop-bg: var(--ui-bg);
  --desktop-panel: var(--ui-surface);
  --desktop-ink: var(--ui-text);
  --desktop-muted: var(--ui-text-muted);
  --desktop-line: var(--ui-border);
  --desktop-accent: var(--ui-primary);
  --desktop-accent-dark: var(--ui-primary-hover);
  --desktop-navy: var(--ui-rail);
  --desktop-error: var(--ui-error);
  --desktop-error-bg: var(--ui-error-bg);
  --desktop-shadow: var(--ui-shadow-lg);
  background: var(--ui-bg);
}

.desktop-shell button,
.desktop-shell input {
  font-family: var(--ui-font);
}

.desktop-shell .login-view {
  overflow: auto;
  padding: 32px;
  background:
    linear-gradient(rgba(15, 107, 92, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 107, 92, 0.035) 1px, transparent 1px),
    var(--ui-bg);
  background-size: 32px 32px;
}

.desktop-shell .login-card {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(380px, 0.95fr);
  width: min(1080px, 100%);
  min-height: 650px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-lg);
}

.login-brand-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 42px;
  background:
    radial-gradient(circle at 80% 10%, rgba(90, 211, 181, 0.15), transparent 32%),
    linear-gradient(145deg, #0d2b26, #123b33 72%, #16493f);
  color: #f3fbf8;
}

.login-brand-top,
.brand-lockup,
.product-badge {
  display: flex;
  align-items: center;
}

.login-brand-top {
  justify-content: space-between;
  gap: 16px;
}

.brand-lockup {
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
}

.login-brand-pane .brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.product-badge {
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #b7d9d0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.login-brand-copy {
  max-width: 520px;
  margin: 74px 0 60px;
}

.login-brand-copy .eyebrow {
  color: #77d9c3;
}

.login-brand-copy h1 {
  max-width: 500px;
  margin: 10px 0 18px;
  color: #f7fffc;
  font-family: var(--ui-font-display);
  font-size: clamp(34px, 4.2vw, 52px);
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.login-brand-copy p:last-child {
  max-width: 480px;
  margin: 0;
  color: #b4ccc6;
  font-size: 15px;
  line-height: 1.75;
}

.login-benefits {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  list-style: none;
}

.login-benefits li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  background: rgba(7, 31, 27, 0.48);
}

.login-benefits strong {
  color: #edf9f6;
  font-size: 13px;
}

.login-benefits span {
  color: #9ebbb4;
  font-size: 13px;
  line-height: 1.5;
}

.login-form-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 54px 50px;
  background: var(--ui-surface);
}

.login-form-head {
  margin-bottom: 28px;
}

.login-form-head .eyebrow {
  color: var(--ui-primary);
}

.login-form-head h2 {
  margin: 6px 0 12px;
  color: var(--ui-text);
  font-family: var(--ui-font-display);
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.login-form-head p:last-child {
  margin: 0;
  color: var(--ui-text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.desktop-shell .token-field {
  display: grid;
  gap: 9px;
  margin-bottom: 8px;
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 700;
}

.desktop-shell .token-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-subtle);
  color: var(--ui-text);
  font-size: 15px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.desktop-shell .token-field input:focus {
  border-color: var(--ui-primary);
  background: var(--ui-surface);
  box-shadow: 0 0 0 4px rgba(15, 107, 92, 0.1);
}

.desktop-shell .form-message {
  min-height: 22px;
  margin: 4px 0 10px;
  color: var(--ui-error);
  font-size: 13px;
  line-height: 1.5;
}

.desktop-shell .primary-button {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: var(--ui-radius-sm);
  background: var(--ui-primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 107, 92, 0.16);
  font-size: 15px;
  font-weight: 700;
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.desktop-shell .primary-button:hover {
  background: var(--ui-primary-hover);
  box-shadow: 0 10px 24px rgba(15, 107, 92, 0.22);
  transform: translateY(-1px);
}

.desktop-shell .primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.desktop-shell .security-note {
  margin: 18px 0 0;
  color: var(--ui-text-muted);
  font-size: 12px;
  line-height: 1.65;
}

.desktop-shell .desktop-app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--ui-bg);
}

.desktop-shell .desktop-nav {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 14px 18px;
  border: 0;
  background: var(--ui-rail);
  color: var(--ui-rail-text);
}

.desktop-shell .brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 9px 22px;
  border-bottom: 1px solid var(--ui-rail-line);
}

.desktop-shell .brand-block .brand-mark,
.desktop-shell .brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.desktop-shell .brand-block > div:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.desktop-shell .brand-block strong {
  color: #f2faf7;
  font-size: 15px;
}

.desktop-shell .brand-block span {
  overflow: hidden;
  color: var(--ui-rail-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-shell .nav-section-label {
  padding: 23px 11px 9px;
  color: #789a92;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.desktop-shell .route-nav {
  display: grid;
  gap: 6px;
}

.desktop-shell .route-button {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ui-rail-muted);
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.desktop-shell .route-button:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
  color: #d9eae5;
}

.desktop-shell .route-button.active {
  border-color: rgba(90, 211, 181, 0.16);
  background: #163d35;
  color: #f2fffb;
  box-shadow: inset 3px 0 0 #5ad3b5;
}

.desktop-shell .route-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.desktop-shell .route-button.active .route-icon {
  background: rgba(90, 211, 181, 0.12);
  color: #84e4ce;
}

.desktop-shell .route-icon svg,
.desktop-shell .header-logout svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.desktop-shell .route-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.desktop-shell .route-copy strong {
  font-size: 14px;
  font-weight: 680;
}

.desktop-shell .route-copy small {
  overflow: hidden;
  color: #7fa099;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-shell .route-button.active .route-copy small {
  color: #a9cbc3;
}

.desktop-shell .nav-footer {
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid var(--ui-rail-line);
}

.desktop-shell .session-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a8c4bd;
  font-size: 11px;
}

.desktop-shell .session-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #46d39d;
  box-shadow: 0 0 0 4px rgba(70, 211, 157, 0.1);
}

.desktop-shell .desktop-main {
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: var(--ui-bg);
}

.desktop-shell .desktop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, 0.96);
}

.desktop-shell .page-context {
  min-width: 0;
}

.desktop-shell .page-context .eyebrow {
  margin-bottom: 2px;
  color: var(--ui-primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.desktop-shell .page-context h1 {
  overflow: hidden;
  color: var(--ui-text);
  font-family: var(--ui-font-display);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-shell .head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.desktop-shell .connection-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  background: var(--ui-surface-subtle);
  color: var(--ui-text-secondary);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.desktop-shell .connection-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d6a02d;
  content: "";
}

.desktop-shell .connection-status.ready {
  border-color: #cde7da;
  background: var(--ui-success-bg);
  color: var(--ui-success);
}

.desktop-shell .connection-status.ready::before {
  background: #36b47a;
}

.desktop-shell .connection-status.error {
  border-color: #f1c4bf;
  background: var(--ui-error-bg);
  color: var(--ui-error);
}

.desktop-shell .connection-status.error::before {
  background: var(--ui-error);
}

.desktop-shell .header-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
  font-size: 12px;
  font-weight: 650;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.desktop-shell .header-logout:hover {
  border-color: #e8b7b2;
  background: var(--ui-error-bg);
  color: var(--ui-error);
}

.desktop-shell .header-logout:disabled {
  cursor: wait;
  opacity: 0.6;
}

.desktop-shell .frame-host {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--ui-bg);
}

.desktop-shell .frame-host > .desktop-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--ui-bg);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.desktop-shell .frame-host > .desktop-frame.ready {
  opacity: 1;
}

.desktop-shell .frame-host > .desktop-frame[hidden] {
  display: none;
}

.desktop-shell .frame-loading {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--ui-text-muted);
  font-size: 13px;
}

.desktop-shell .frame-loading span {
  width: 26px;
  height: 26px;
  border: 2px solid var(--ui-border);
  border-top-color: var(--ui-primary);
  border-radius: 50%;
  animation: ui-spin 0.8s linear infinite;
}

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

/* -------------------------------------------------------------------------- */
/* Shared product primitives                                                  */
/* -------------------------------------------------------------------------- */

:where(.reader-page, .daily-page, .manage-page) {
  color: var(--ui-text);
  background: var(--ui-bg);
}

:where(.reader-page, .daily-page, .manage-page) button,
:where(.reader-page, .daily-page, .manage-page) input,
:where(.reader-page, .daily-page, .manage-page) select,
:where(.reader-page, .daily-page, .manage-page) textarea {
  font-family: var(--ui-font);
}

:where(.reader-page, .daily-page, .manage-page) button {
  font-weight: 650;
}

:where(.reader-page, .daily-page, .manage-page) :where(
  button.primary,
  button.primary-button,
  .primary-button,
  .sync-panel button:not(.secondary):not(.danger):not(.icon-action)
) {
  border-color: var(--ui-primary);
  background: var(--ui-primary);
  color: #fff;
}

:where(.reader-page, .daily-page, .manage-page) :where(
  button.primary:hover,
  button.primary-button:hover,
  .primary-button:hover,
  .sync-panel button:not(.secondary):not(.danger):not(.icon-action):hover
) {
  border-color: var(--ui-primary-hover);
  background: var(--ui-primary-hover);
}

:where(.reader-page, .daily-page, .manage-page) :where(
  button.secondary,
  .light-button,
  .link-button
) {
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
}

:where(.reader-page, .daily-page, .manage-page) :where(
  button.secondary:hover,
  .light-button:hover,
  .link-button:hover
) {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface-subtle);
  color: var(--ui-primary);
}

:where(.reader-page, .daily-page, .manage-page) :where(input, select, textarea) {
  border-color: var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  color: var(--ui-text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

:where(.reader-page, .daily-page, .manage-page) :where(input, select, textarea):focus {
  border-color: var(--ui-primary);
  box-shadow: 0 0 0 3px rgba(15, 107, 92, 0.1);
  outline: 0;
}

:where(.reader-page, .daily-page, .manage-page) .eyebrow {
  color: var(--ui-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

:where(.reader-page, .daily-page, .manage-page) .empty {
  padding: 34px 24px;
  border: 1px dashed var(--ui-border-strong);
  border-radius: var(--ui-radius);
  background: var(--ui-surface-subtle);
  color: var(--ui-text-muted);
  text-align: center;
}

:where(.reader-page, .daily-page, .manage-page) .error {
  color: var(--ui-error);
}

:where(.reader-page, .daily-page, .manage-page) .success {
  color: var(--ui-success);
}

:where(.reader-page, .daily-page, .manage-page) .warning {
  color: var(--ui-warning);
}

/* -------------------------------------------------------------------------- */
/* Reader                                                                     */
/* -------------------------------------------------------------------------- */

body.reader-page {
  --bg: var(--ui-bg);
  --rail: var(--ui-rail);
  --source: var(--ui-surface-subtle);
  --panel: var(--ui-surface);
  --text: var(--ui-text);
  --muted: var(--ui-text-muted);
  --line: var(--ui-border);
  --accent: var(--ui-primary);
  --accent-soft: var(--ui-primary-soft);
  --accent-strong: var(--ui-primary-hover);
  --accent-dark: var(--ui-primary-strong);
  --orange: var(--ui-primary);
  --shadow: var(--ui-shadow);
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
}

body.reader-page .reader {
  background: var(--ui-bg);
}

body.reader-page .reader > .nav {
  gap: 10px;
  padding: 18px 9px;
  border-color: var(--ui-border);
  background: var(--ui-surface);
}

body.reader-page .reader > .nav .brand {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--ui-rail);
  color: #67d8be;
  font-size: 10px;
}

body.reader-page .reader > .nav .icon-button {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

body.reader-page .reader > .nav .icon-button:hover,
body.reader-page .reader > .nav .icon-button.active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  box-shadow: none;
}

body.reader-page .sources {
  border-color: var(--ui-border);
  background: var(--ui-surface-subtle);
}

body.reader-page .mode-switch {
  padding: 3px;
  border-color: var(--ui-border);
  border-radius: 10px;
  background: var(--ui-bg-strong);
  box-shadow: none;
}

body.reader-page .mode-button {
  min-height: 34px;
  border-radius: 7px;
  font-size: 12px;
}

body.reader-page .mode-button.active {
  background: var(--ui-surface);
  color: var(--ui-primary);
  box-shadow: var(--ui-shadow-sm);
}

body.reader-page :where(.source, .feed, .group, .group-feed) {
  min-height: 34px;
  border-radius: 7px;
}

body.reader-page :where(.source, .feed, .group, .group-feed):hover {
  background: rgba(255, 255, 255, 0.7);
}

body.reader-page :where(.source, .feed, .group, .group-feed).active {
  background: var(--ui-primary-soft);
  box-shadow: inset 3px 0 0 var(--ui-primary);
}

body.reader-page .group-title {
  padding: 18px 7px 8px;
  color: var(--ui-text-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

body.reader-page .entries {
  border-color: var(--ui-border);
  background: var(--ui-surface);
}

body.reader-page .entries-head {
  border-color: var(--ui-border);
  background: rgba(255, 255, 255, 0.97);
}

body.reader-page .entries-head h1 {
  font-size: 16px;
  letter-spacing: -0.01em;
}

body.reader-page .entry-list {
  padding: 6px 7px 32px;
}

body.reader-page .entry {
  padding: 14px 10px;
  border-bottom-color: var(--ui-border);
  border-radius: 8px;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

body.reader-page .entry:hover {
  background: var(--ui-surface-subtle);
}

body.reader-page .entry.selected {
  background: var(--ui-primary-tint);
  box-shadow: inset 3px 0 0 var(--ui-primary);
}

body.reader-page .entry .dot {
  background: var(--ui-primary);
}

body.reader-page .entry strong {
  color: var(--ui-text);
  font-size: 15px;
  line-height: 1.45;
}

body.reader-page .entry p,
body.reader-page .entry small {
  color: var(--ui-text-muted);
  line-height: 1.55;
}

body.reader-page .entry img {
  border-radius: 9px;
  background: var(--ui-bg-strong);
}

body.reader-page .article {
  background: var(--ui-surface);
}

body.reader-page .article-tools {
  border-color: var(--ui-border);
  background: rgba(255, 255, 255, 0.97);
}

body.reader-page .article-body {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  color: var(--ui-text);
}

body.reader-page .article-body h2 {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
  color: var(--ui-text);
  font-family: var(--ui-font-display);
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

body.reader-page .article-body :where(p, li) {
  color: var(--ui-text-secondary);
  font-size: 16px;
  line-height: 1.85;
}

body.reader-page .article-meta {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
  color: var(--ui-text-muted);
}

body.reader-page .video-grid {
  gap: 16px;
  padding: 18px;
  background: var(--ui-bg);
}

body.reader-page .video-card {
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

body.reader-page .video-card:hover {
  border-color: var(--ui-border-strong);
  box-shadow: var(--ui-shadow);
  transform: translateY(-1px);
}

body.reader-page .video-card strong {
  color: var(--ui-text);
  line-height: 1.45;
}

/* -------------------------------------------------------------------------- */
/* Daily intelligence                                                         */
/* -------------------------------------------------------------------------- */

body.daily-page {
  --bg: var(--ui-bg);
  --rail: var(--ui-rail);
  --paper: var(--ui-surface);
  --ink: var(--ui-text);
  --text: var(--ui-text);
  --muted: var(--ui-text-muted);
  --line: var(--ui-border);
  --accent: var(--ui-primary);
  --accent-strong: var(--ui-primary-hover);
  --theme-hover: var(--ui-primary-soft);
  --theme-active: var(--ui-primary-soft);
  --theme-active-text: var(--ui-primary);
  --theme-input: var(--ui-surface);
  --theme-content-bg: var(--ui-bg);
  --theme-content-text: var(--ui-text);
  --shadow: var(--ui-shadow);
  background: var(--ui-bg);
  color: var(--ui-text);
}

body.daily-page .daily-shell {
  background: var(--ui-bg);
}

body.daily-page .daily-shell > .nav {
  border-color: var(--ui-border);
  background: var(--ui-surface);
}

body.daily-page .daily-shell > .nav .brand {
  border: 0;
  border-radius: 10px;
  background: var(--ui-rail);
  color: #67d8be;
  font-size: 10px;
}

body.daily-page .daily-shell > .nav .icon-button {
  border-radius: 9px;
}

body.daily-page .daily-shell > .nav .icon-button:hover,
body.daily-page .daily-shell > .nav .icon-button.active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  box-shadow: none;
}

body.daily-page .newspaper {
  width: min(1380px, calc(100vw - 84px));
  padding: 28px 0 64px;
}

body.daily-page .daily-head {
  align-items: center;
  padding: 22px 24px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body.daily-page .daily-head h1 {
  color: var(--ui-text);
  font-family: var(--ui-font-display);
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 720;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

body.daily-page .daily-head .meta {
  margin-top: 8px;
  color: var(--ui-text-secondary);
  font-size: 13px;
}

body.daily-page .head-actions .primary-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 9px;
  background: var(--ui-primary);
  box-shadow: 0 8px 18px rgba(15, 107, 92, 0.12);
}

body.daily-page .head-actions .primary-button:hover {
  background: var(--ui-primary-hover);
}

body.daily-page .icon-action {
  border-color: var(--ui-border);
  background: var(--ui-surface-subtle);
  color: var(--ui-text-secondary);
}

body.daily-page .status-line {
  min-height: 0;
  margin: 0;
  padding: 14px 2px 0;
  color: var(--ui-primary);
  font-size: 13px;
}

body.daily-page .daily-content {
  gap: 28px;
  padding-top: 24px;
}

body.daily-page .lead-stats {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body.daily-page .lead-stats div {
  padding: 18px 20px;
  border-color: var(--ui-border);
}

body.daily-page .lead-stats span {
  color: var(--ui-text-muted);
  font-size: 11px;
  font-weight: 650;
}

body.daily-page .lead-stats strong {
  margin-top: 7px;
  color: var(--ui-text);
  font-family: var(--ui-font-display);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

body.daily-page .section {
  padding-top: 0;
  border-top: 0;
}

body.daily-page .section-head {
  align-items: flex-end;
  margin-bottom: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--ui-border);
}

body.daily-page .section h2 {
  color: var(--ui-text);
  font-family: var(--ui-font-display);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

body.daily-page .section-head::before {
  flex: 0 0 auto;
  width: 3px;
  height: 25px;
  border-radius: 999px;
  background: var(--ui-primary);
  content: "";
}

body.daily-page .section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(240px, 520px);
  gap: 12px;
  align-items: end;
}

body.daily-page .section-head h2 {
  grid-column: 2;
}

body.daily-page .section-head p {
  grid-column: 3;
  color: var(--ui-text-muted);
  font-size: 13px;
  line-height: 1.55;
}

body.daily-page .story-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

body.daily-page .story {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body.daily-page .story:hover,
body.daily-page .story:focus-visible {
  border-color: rgba(15, 107, 92, 0.34);
  box-shadow: var(--ui-shadow);
  transform: translateY(-2px);
}

body.daily-page .story-body {
  gap: 9px;
  padding: 16px;
}

body.daily-page .story-kicker {
  color: var(--ui-primary);
  font-size: 10px;
  letter-spacing: 0.08em;
}

body.daily-page .story h3 {
  color: var(--ui-text);
  font-family: var(--ui-font-display);
  font-size: 18px;
  line-height: 1.38;
  letter-spacing: -0.012em;
}

body.daily-page .story p {
  color: var(--ui-text-secondary);
  font-size: 13px;
  line-height: 1.65;
}

body.daily-page .story small {
  margin-top: 4px;
  color: var(--ui-text-muted);
  font-size: 11px;
}

body.daily-page .score {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

body.daily-page .modal {
  padding: 20px;
  background: rgba(10, 28, 24, 0.52);
  backdrop-filter: blur(6px);
}

body.daily-page .modal-card {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-lg);
}

body.daily-page .detail-modal-head {
  border-color: var(--ui-border);
  background: rgba(255, 255, 255, 0.96);
}

body.daily-page .detail-insight {
  border-color: rgba(15, 107, 92, 0.18);
  background: var(--ui-primary-tint);
}

/* Embedded mode removes repeated page chrome while preserving functionality. */
html.desktop-embed body.daily-page .newspaper {
  width: 100%;
  padding: 20px 22px 48px;
}

html.desktop-embed body.daily-page .daily-head {
  padding: 15px 18px;
}

html.desktop-embed body.daily-page .daily-head > div:first-child .eyebrow,
html.desktop-embed body.daily-page .daily-head h1 {
  display: none;
}

html.desktop-embed body.daily-page .daily-head .meta {
  margin: 0;
}

html.desktop-embed body.daily-page .daily-content {
  padding-top: 18px;
}

/* -------------------------------------------------------------------------- */
/* Management console                                                         */
/* -------------------------------------------------------------------------- */

body.manage-page {
  --bg: var(--ui-bg);
  --rail: var(--ui-rail);
  --panel: var(--ui-surface);
  --text: var(--ui-text);
  --muted: var(--ui-text-muted);
  --line: var(--ui-border);
  --accent: var(--ui-primary);
  --accent-dark: var(--ui-primary-hover);
  --accent-soft: var(--ui-primary-soft);
  --success: var(--ui-success);
  --error: var(--ui-error);
  --error-bg: var(--ui-error-bg);
  --warning: var(--ui-warning);
  --orange: var(--ui-primary);
  background: var(--ui-bg);
  color: var(--ui-text);
}

body.manage-page > .app-nav {
  width: 60px;
  border-color: var(--ui-border);
  background: var(--ui-surface);
}

body.manage-page > .app-nav .brand {
  border: 0;
  border-radius: 10px;
  background: var(--ui-rail);
  color: #67d8be;
  font-size: 11px;
}

body.manage-page > .app-nav .icon-button {
  border-radius: 9px;
}

body.manage-page > .app-nav .icon-button:hover,
body.manage-page > .app-nav .icon-button.active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
}

body.manage-page .shell {
  width: min(1240px, calc(100vw - 108px));
  margin: 30px auto 52px;
}

body.manage-page .page-head {
  align-items: flex-end;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ui-border);
}

body.manage-page .page-head h1 {
  color: var(--ui-text);
  font-family: var(--ui-font-display);
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

body.manage-page .settings-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: var(--ui-bg-strong);
}

body.manage-page .settings-tab {
  min-height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ui-text-secondary);
  font-size: 13px;
}

body.manage-page .settings-tab:hover {
  color: var(--ui-text);
}

body.manage-page .settings-tab.active {
  background: var(--ui-surface);
  color: var(--ui-primary);
  box-shadow: var(--ui-shadow-sm);
}

body.manage-page .settings-view {
  background: transparent;
}

body.manage-page .view-head {
  margin-bottom: 16px;
}

body.manage-page .view-head h2 {
  font-family: var(--ui-font-display);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

body.manage-page :where(
  .sync-panel,
  .panel,
  .advanced-panel,
  .primary-panel,
  .backup-panel,
  .auth-panel,
  .queue-panel
) {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body.manage-page .sync-panel-head h3,
body.manage-page .panel h3,
body.manage-page .backup-panel h3 {
  color: var(--ui-text);
  font-size: 15px;
  line-height: 1.4;
}

body.manage-page :where(.hint, .inline-status, .status) {
  color: var(--ui-text-muted);
  font-size: 12px;
  line-height: 1.55;
}

body.manage-page :where(input, select, textarea) {
  min-height: 40px;
  padding-right: 12px;
  padding-left: 12px;
  font-size: 14px;
}

body.manage-page label {
  color: var(--ui-text-secondary);
  font-size: 13px;
}

body.manage-page :where(.stats, .status-panel) {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

body.manage-page :where(.stats, .status-panel) > div {
  min-height: 78px;
  padding: 15px 16px;
  border-color: var(--ui-border);
}

body.manage-page :where(.stats, .status-panel) span {
  color: var(--ui-text-muted);
  font-size: 11px;
  font-weight: 650;
}

body.manage-page :where(.stats, .status-panel) strong {
  margin-top: 6px;
  color: var(--ui-text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

body.manage-page button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

body.manage-page button:not(.secondary):not(.danger):not(.icon-button):not(.settings-tab):not(.inline-link) {
  border-color: var(--ui-primary);
  background: var(--ui-primary);
  color: #fff;
}

body.manage-page button:not(.secondary):not(.danger):not(.icon-button):not(.settings-tab):not(.inline-link):hover {
  border-color: var(--ui-primary-hover);
  background: var(--ui-primary-hover);
  transform: translateY(-1px);
}

body.manage-page button.secondary {
  border-color: var(--ui-border);
  background: var(--ui-surface-subtle);
  color: var(--ui-text-secondary);
}

body.manage-page button.secondary:hover {
  border-color: var(--ui-border-strong);
  background: var(--ui-bg-strong);
  color: var(--ui-text);
}

body.manage-page button.danger {
  border-color: #efc6c1;
  background: var(--ui-error-bg);
  color: var(--ui-error);
}

body.manage-page button.danger:hover {
  border-color: #e7a9a1;
  background: #ffe8e5;
}

body.manage-page .link-button {
  min-height: 38px;
  border-color: var(--ui-border);
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
}

body.manage-page .feed-card {
  grid-template-columns: 42px minmax(220px, 1fr) 92px 80px 156px;
  gap: 12px;
  padding: 12px 14px;
  border-color: var(--ui-border);
  border-radius: 9px;
  background: var(--ui-surface-subtle);
}

body.manage-page .feed-card:hover {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface);
}

body.manage-page .feed-avatar {
  border-color: var(--ui-border);
  border-radius: 9px;
  background: var(--ui-bg-strong);
}

body.manage-page .feed-card h3 {
  color: var(--ui-text);
  font-size: 14px;
}

body.manage-page .feed-main :where(p, small),
body.manage-page .feed-meta,
body.manage-page .feed-technical {
  color: var(--ui-text-muted);
  font-size: 12px;
}

body.manage-page .badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}

body.manage-page .badge.douyin {
  background: #1f2937;
  color: #fff;
}

body.manage-page .badge.bilibili {
  background: #e8f6fb;
  color: #08769a;
}

body.manage-page .badge.blocked {
  background: var(--ui-error-bg);
  color: var(--ui-error);
}

body.manage-page .log-item,
body.manage-page .pending-card {
  padding: 13px 14px;
  border-color: var(--ui-border);
  border-radius: 9px;
  background: var(--ui-surface-subtle);
}

body.manage-page .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
}

body.manage-page table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ui-text);
  font-size: 13px;
}

body.manage-page th {
  padding: 11px 13px;
  border-bottom: 1px solid var(--ui-border);
  background: var(--ui-surface-subtle);
  color: var(--ui-text-muted);
  font-size: 11px;
  font-weight: 750;
  text-align: left;
}

body.manage-page td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--ui-border);
  vertical-align: top;
}

body.manage-page tr:last-child td {
  border-bottom: 0;
}

body.manage-page .switch {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface-subtle);
}

body.manage-page .switch input {
  width: 16px;
  height: 16px;
}

body.manage-page .login-dialog {
  border-color: var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-lg);
}

body.manage-page .login-dialog::backdrop {
  background: rgba(10, 28, 24, 0.54);
  backdrop-filter: blur(5px);
}

body.manage-page .login-qr {
  border-color: var(--ui-border);
  border-radius: 10px;
}

html.desktop-embed body.manage-page .shell {
  width: 100%;
  margin: 0;
  padding: 22px 24px 46px;
}

html.desktop-embed body.manage-page .page-head h1 {
  font-size: 26px;
}

/* -------------------------------------------------------------------------- */
/* Responsive shell and tablet/mobile product layouts                         */
/* -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .desktop-shell .desktop-app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 64px minmax(0, 1fr) 64px;
  }

  .desktop-shell .desktop-nav {
    grid-row: 3;
    flex-direction: row;
    align-items: center;
    padding: 6px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .desktop-shell .brand-block,
  .desktop-shell .nav-section-label,
  .desktop-shell .nav-footer {
    display: none;
  }

  .desktop-shell .route-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .desktop-shell .route-button {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 50px;
    padding: 5px 10px;
    border-radius: 9px;
  }

  .desktop-shell .route-button.active {
    box-shadow: inset 0 2px 0 #5ad3b5;
  }

  .desktop-shell .route-icon {
    width: 30px;
    height: 30px;
  }

  .desktop-shell .route-copy small {
    display: none;
  }

  .desktop-shell .desktop-main {
    grid-row: 1 / span 2;
    grid-template-rows: 64px minmax(0, 1fr);
  }

  .desktop-shell .desktop-head {
    padding: 0 18px;
  }

  html.desktop-embed body.manage-page .shell {
    padding: 20px 22px 42px;
  }
}

@media (max-width: 760px) {
  .desktop-shell .login-view {
    display: block;
    padding: 14px;
  }

  .desktop-shell .login-card {
    display: block;
    min-height: 0;
    margin: 0 auto;
    border-radius: 14px;
  }

  .login-brand-pane {
    min-height: 250px;
    padding: 24px;
  }

  .login-brand-copy {
    margin: 40px 0 0;
  }

  .login-brand-copy h1 {
    max-width: 620px;
    font-size: 30px;
  }

  .login-brand-copy p:last-child,
  .login-benefits {
    display: none;
  }

  .login-form-pane {
    padding: 32px 24px 36px;
  }

  .desktop-shell .desktop-head {
    padding: 0 14px;
  }

  .desktop-shell .page-context .eyebrow {
    display: none;
  }

  .desktop-shell .page-context h1 {
    font-size: 19px;
  }

  .desktop-shell .connection-status {
    min-height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }

  .desktop-shell .header-logout {
    width: 36px;
    min-height: 36px;
    padding: 0;
  }

  .desktop-shell .header-logout span {
    display: none;
  }

  .desktop-shell .route-button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 50px;
    padding: 3px;
    text-align: center;
  }

  .desktop-shell .route-icon {
    width: 25px;
    height: 25px;
    background: transparent;
  }

  .desktop-shell .route-copy strong {
    font-size: 11px;
  }

  body.daily-page .newspaper {
    width: 100%;
    padding: 16px 14px 78px;
  }

  body.daily-page .daily-head {
    display: grid;
    gap: 16px;
    padding: 18px;
  }

  body.daily-page .daily-head h1 {
    font-size: 30px;
  }

  body.daily-page .head-actions {
    justify-content: flex-start;
  }

  body.daily-page .lead-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.daily-page .lead-stats div:nth-child(2) {
    border-right: 0;
  }

  body.daily-page .lead-stats div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--ui-border);
  }

  body.daily-page .section-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.daily-page .section-head p {
    grid-column: 2;
  }

  body.daily-page .story-grid {
    grid-template-columns: 1fr;
  }

  html.desktop-embed body.daily-page .newspaper {
    padding: 14px 14px 74px;
  }

  html.desktop-embed body.daily-page .daily-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
  }

  html.desktop-embed body.daily-page .daily-head .meta {
    font-size: 11px;
  }

  body.reader-page .article-body {
    padding-right: 20px;
    padding-left: 20px;
  }

  body.reader-page .article-body h2 {
    font-size: 26px;
  }

  body.reader-page .entry strong {
    font-size: 14px;
  }

  body.manage-page .shell,
  html.desktop-embed body.manage-page .shell {
    width: 100%;
    margin: 0;
    padding: 16px 12px 40px;
  }

  body.manage-page .page-head {
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  body.manage-page .page-head h1 {
    font-size: 25px;
  }

  body.manage-page .settings-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  body.manage-page .settings-tab {
    min-width: 0;
    padding: 0 8px;
  }

  body.manage-page :where(
    .sync-panel,
    .panel,
    .advanced-panel,
    .primary-panel,
    .backup-panel,
    .auth-panel,
    .queue-panel
  ) {
    padding: 15px;
  }

  body.manage-page :where(
    .settings-grid,
    .add-grid,
    .queue-grid,
    .platform-add-grid,
    .stats,
    .status-panel
  ) {
    grid-template-columns: 1fr;
  }

  body.manage-page .feed-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  body.manage-page .feed-meta,
  body.manage-page .feed-switch,
  body.manage-page .feed-actions {
    grid-column: 2;
    align-items: flex-start;
    justify-content: flex-start;
  }

  body.manage-page [data-panel="subscriptions"] .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body.manage-page [data-panel="subscriptions"] table,
  body.manage-page [data-panel="subscriptions"] tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  body.manage-page [data-panel="subscriptions"] thead {
    display: none;
  }

  body.manage-page [data-panel="subscriptions"] tr {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 5px 12px;
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
  }

  body.manage-page [data-panel="subscriptions"] tr:last-child {
    margin-bottom: 0;
  }

  body.manage-page [data-panel="subscriptions"] td {
    width: auto !important;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  body.manage-page [data-panel="subscriptions"] td:first-child {
    grid-row: 1 / span 2;
  }

  body.manage-page [data-panel="subscriptions"] td:nth-child(2) {
    align-self: end;
    color: var(--ui-text);
    font-size: 15px;
    font-weight: 750;
  }

  body.manage-page [data-panel="subscriptions"] td:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  body.manage-page [data-panel="subscriptions"] td:nth-child(4) {
    color: var(--ui-text-muted);
    font-size: 12px;
  }

  body.manage-page [data-panel="subscriptions"] td:nth-child(4)::before {
    margin-right: 6px;
    color: var(--ui-text-muted);
    content: "最近更新";
  }

  body.manage-page [data-panel="subscriptions"] td:nth-child(5) {
    grid-column: 1 / -1;
    margin-top: 6px;
    padding: 9px 10px;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: 7px;
    background: var(--ui-surface-subtle);
    color: var(--ui-text-secondary);
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  body.manage-page [data-panel="subscriptions"] td:nth-child(5)::before {
    display: block;
    margin-bottom: 3px;
    color: var(--ui-text-muted);
    content: "RSS 地址";
    font-size: 10px;
    font-weight: 750;
  }

  body.manage-page [data-panel="subscriptions"] td:last-child {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: 2px;
  }

  body.manage-page [data-panel="subscriptions"] .avatar {
    width: 42px;
    height: 42px;
  }

  body.manage-page [data-panel="subscriptions"] .table-action {
    min-width: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(.desktop-shell, .reader-page, .daily-page, .manage-page) *,
  :where(.desktop-shell, .reader-page, .daily-page, .manage-page) *::before,
  :where(.desktop-shell, .reader-page, .daily-page, .manage-page) *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Desktop workspace: compact horizontal navigation                            */
/* -------------------------------------------------------------------------- */

.desktop-shell .desktop-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--ui-bg);
}

.desktop-shell .desktop-topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(174px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px 24px;
  min-width: 0;
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 2px rgba(15, 35, 30, 0.035);
}

.desktop-shell .brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
}

.desktop-shell .brand-block .brand-mark,
.desktop-shell .brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.desktop-shell .brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.desktop-shell .brand-copy strong,
.desktop-shell .brand-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-shell .brand-copy strong {
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.desktop-shell .brand-copy span {
  margin-top: 0;
  color: var(--ui-text-muted);
  font-size: 10px;
}

.desktop-shell .route-nav {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 2px;
  width: auto;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: var(--ui-surface-subtle);
}

.desktop-shell .route-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ui-text-secondary);
  text-align: center;
  box-shadow: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.desktop-shell .route-button:hover {
  border-color: transparent;
  background: rgba(15, 107, 92, 0.055);
  color: var(--ui-primary);
}

.desktop-shell .route-button.active {
  border-color: var(--ui-border);
  background: var(--ui-surface);
  color: var(--ui-primary);
  box-shadow: var(--ui-shadow-sm);
}

.desktop-shell .route-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.desktop-shell .route-icon svg {
  width: 17px;
  height: 17px;
}

.desktop-shell .route-copy {
  display: block;
  min-width: 0;
}

.desktop-shell .route-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.desktop-shell .route-copy small {
  display: none;
}

.desktop-shell .topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}

.desktop-shell .connection-status {
  min-height: 32px;
  padding: 0 10px;
  background: var(--ui-surface-subtle);
  font-size: 11px;
}

.desktop-shell .header-logout {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  background: var(--ui-surface);
}

.desktop-shell .desktop-main {
  display: grid;
  grid-row: 2;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: var(--ui-bg);
}

.desktop-shell .desktop-page-context {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.desktop-shell .frame-host {
  min-width: 0;
  min-height: 0;
}

@media (max-width: 900px) {
  .desktop-shell .desktop-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 0 14px;
  }

  .desktop-shell .brand-copy span {
    display: none;
  }

  .desktop-shell .route-button {
    padding: 0 10px;
  }
}

@media (max-width: 680px) {
  .desktop-shell .desktop-app {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-rows: 58px minmax(0, 1fr) calc(58px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(var(--ui-surface) 0 58px, var(--ui-bg) 58px 100%);
  }

  .desktop-shell .desktop-topbar {
    display: contents;
  }

  .desktop-shell .brand-copy {
    display: none;
  }

  .desktop-shell .brand-block {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    justify-self: start;
    margin-left: 10px;
  }

  .desktop-shell .brand-block .brand-mark,
  .desktop-shell .brand-mark {
    width: 34px;
    height: 34px;
  }

  .desktop-shell .topbar-actions {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    margin-right: 10px;
  }

  .desktop-shell .route-nav {
    grid-column: 1 / -1;
    grid-row: 3;
    align-self: stretch;
    align-items: stretch;
    justify-self: stretch;
    width: 100%;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid var(--ui-border);
    border-radius: 0;
    background: var(--ui-surface);
  }

  .desktop-shell .desktop-main {
    grid-row: 2;
  }

  .desktop-shell .route-button {
    flex: 1 1 0;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 3px 8px;
    gap: 2px;
    flex-direction: column;
  }

  .desktop-shell .route-copy strong {
    font-size: 12px;
  }

  .desktop-shell .connection-status {
    justify-content: center;
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .desktop-shell .connection-status::before {
    width: 7px;
    height: 7px;
  }

  .desktop-shell .header-logout {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
  }

  .desktop-shell .header-logout span {
    display: none;
  }

  .desktop-shell .route-icon {
    width: 25px;
    height: 25px;
    background: transparent;
  }

  .desktop-shell .route-icon svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 420px) {
  .desktop-shell .route-icon {
    width: 16px;
    height: 16px;
  }

  .desktop-shell .route-icon svg {
    width: 15px;
    height: 15px;
  }

  .desktop-shell .route-copy strong {
    font-size: 11px;
  }
}

@media (prefers-color-scheme: dark) {
  .desktop-shell .desktop-topbar {
    background: rgba(18, 28, 26, 0.97);
    box-shadow: none;
  }

  .desktop-shell .route-button:hover {
    background: rgba(85, 201, 176, 0.08);
  }
}
