@font-face {
  font-family: "MathGao WenKai Screen";
  src: url("fonts/MathGaoWenKaiScreen.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "MiSans";
  src: url("fonts/MiSans-Regular.subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "MiSans";
  src: url("fonts/MiSans-Medium.subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: only light;
  --page: #ffffff;
  --surface: #ffffff;
  --hover: #f8fafc;
  --text: #435166;
  --muted: #5f6f82;
  --faint: #8b98a8;
  --border: #e2e7ed;
  --accent: #087a7f;
  --accent-dark: #055f63;
  --danger: #b42318;
  --font-wenkai: "Segoe UI Variable Text", "Segoe UI", "MathGao WenKai Screen", "Kaiti SC", "STKaiti", "KaiTi", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  --font-sans: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: Georgia, "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --font-misans: "MiSans", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: var(--font-wenkai);
  --font-display: var(--font-body);
  --item-font-size: 15px;
  --index-font-size: 12px;
  --item-font-weight: 550;
  --feed-item-min-height: 31px;
  --feed-link-padding: 6px 5px;
  --feed-link-line-height: 20px;
  --feed-grid-gap: 12px;
  --page-padding: 10px;
  --feed-list-height: calc(100vh - 261px);
}

html[data-font="wenkai"] { --font-body: var(--font-wenkai); }
html[data-font="sans"] { --font-body: var(--font-sans); }
html[data-font="serif"] { --font-body: var(--font-serif); }
html[data-font="misans"] { --font-body: var(--font-misans); }
html[data-size="small"] { --item-font-size: 13px; --index-font-size: 11px; }
html[data-size="standard"] { --item-font-size: 15px; --index-font-size: 12px; }
html[data-size="large"] { --item-font-size: 16px; --index-font-size: 14px; }
html[data-size="xlarge"] { --item-font-size: 18px; --index-font-size: 16px; }
html[data-weight="regular"] { --item-font-weight: 400; }
html[data-weight="medium"] { --item-font-weight: 550; }
html[data-weight="bold"] { --item-font-weight: 700; }
html[data-density="compact"] {
  --feed-item-min-height: 26px;
  --feed-link-padding: 3px 5px;
  --feed-link-line-height: 18px;
}
html[data-density="standard"] {
  --feed-item-min-height: 31px;
  --feed-link-padding: 6px 5px;
  --feed-link-line-height: 20px;
}
html[data-density="relaxed"] {
  --feed-item-min-height: 38px;
  --feed-link-padding: 8px 5px;
  --feed-link-line-height: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html,
body {
  min-width: 320px;
  min-height: 100%;
}
html { background: var(--page); }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  font-kerning: normal;
  font-optical-sizing: auto;
  font-synthesis-style: none;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.settings-open { overflow: hidden; }
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button { letter-spacing: 0; }
#app {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
}
.site-header {
  position: relative;
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 20px 18px;
  text-align: center;
}
.site-title {
  margin: 0;
  color: #253b53;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
}
.header-tools {
  position: absolute;
  top: 34px;
  right: max(20px, var(--page-padding));
  display: flex;
  align-items: center;
  gap: 8px;
}
.refresh-countdown {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.refresh-countdown strong {
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.settings-button {
  display: inline-flex;
  min-width: 64px;
  height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .07);
  font-size: 13px;
  font-weight: 650;
}
.settings-button > span:first-child {
  font-size: 16px;
  line-height: 1;
}
.settings-button:hover,
.settings-button:focus-visible,
.settings-button[aria-expanded="true"] {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
  outline: none;
}
.feed-shell {
  width: 100%;
  padding: 8px var(--page-padding) 20px;
}
.feed-grid {
  display: grid;
  width: 100%;
  margin: 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--feed-grid-gap);
}
html[data-columns="2"] .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-columns="3"] .feed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html[data-columns="4"] .feed-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feed-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .07);
}
.feed-card-header {
  display: flex;
  height: 30px;
  align-items: center;
  margin: 20px 20px 10px;
  padding: 0 10px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--banner-color, var(--accent));
  color: var(--banner-text-color, #ffffff);
}
.feed-card-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-list {
  height: var(--feed-list-height);
  min-height: 420px;
  margin: 0;
  padding: 6px 8px 8px;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}
.feed-list::-webkit-scrollbar,
.drawer-scroll::-webkit-scrollbar { width: 6px; }
.feed-list::-webkit-scrollbar-track,
.drawer-scroll::-webkit-scrollbar-track { background: transparent; }
.feed-list::-webkit-scrollbar-thumb,
.drawer-scroll::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: #cbd5e1;
}
.feed-item {
  display: grid;
  min-width: 0;
  min-height: var(--feed-item-min-height);
  align-items: center;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, #ffffff);
  grid-template-columns: 24px minmax(0, 1fr);
}
html[data-show-index="false"] .feed-item { grid-template-columns: minmax(0, 1fr); }
html[data-show-index="false"] .feed-index { display: none; }
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: var(--hover); }
.feed-index {
  color: var(--faint);
  font-size: var(--index-font-size);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.feed-link {
  display: block;
  min-width: 0;
  padding: var(--feed-link-padding);
  overflow: hidden;
  color: var(--text);
  font-size: var(--item-font-size);
  font-weight: var(--item-font-weight);
  line-height: var(--feed-link-line-height);
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-title-lines="2"] .feed-link {
  display: -webkit-box;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
html[data-title-lines="2"] .feed-item {
  align-items: start;
  min-height: calc(var(--feed-item-min-height) + var(--feed-link-line-height));
}
.feed-link:hover,
.feed-link:focus-visible {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.feed-link:focus-visible {
  border-radius: 3px;
  outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.empty-state {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: var(--muted);
  grid-column: 1 / -1;
}
.site-footer {
  padding: 8px 16px 44px;
  color: var(--muted);
  font-size: 12px;
  line-height: 15px;
  text-align: center;
}
.site-footer a {
  margin-left: 3px;
  color: var(--accent-dark);
}
.site-footer a:hover { text-decoration: underline; }

.settings-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: rgba(15, 23, 42, .28);
  opacity: 0;
  transition: opacity 160ms ease;
}
.settings-backdrop.is-open { opacity: 1; }
.settings-drawer {
  position: fixed;
  z-index: 90;
  top: 0;
  right: 0;
  display: flex;
  width: min(470px, 100vw);
  height: 100dvh;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: #ffffff;
  box-shadow: -10px 0 30px rgba(15, 23, 42, .14);
  color: #435166;
  font-family: var(--font-sans);
  transform: translateX(100%);
  transition: transform 180ms ease;
}
.settings-drawer.is-open { transform: translateX(0); }
.drawer-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e7ed;
}
.drawer-header h2,
.settings-login h3,
.section-heading h3,
.settings-block h4 {
  margin: 0;
  color: #253b53;
  letter-spacing: 0;
}
.drawer-header h2 { font-size: 20px; }
.drawer-status {
  margin: 4px 0 0;
  color: #6b7788;
  font-size: 12px;
}
.drawer-status.is-dirty { color: #9a6700; }
.drawer-status.is-saved { color: #087a7f; }
.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f6f82;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}
.icon-button:hover,
.icon-button:focus-visible {
  background: #f1f5f9;
  color: #253b53;
  outline: none;
}
.settings-login {
  display: grid;
  flex: 1;
  padding: 24px;
  place-items: start stretch;
}
.settings-login form {
  width: 100%;
  max-width: 360px;
  margin: 12vh auto 0;
}
.settings-login h3 {
  margin-bottom: 20px;
  font-size: 22px;
}
.settings-content {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
.settings-tabs {
  display: grid;
  padding: 0 12px;
  border-bottom: 1px solid #e2e7ed;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.settings-tab {
  height: 44px;
  padding: 0 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #6b7788;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.settings-tab:hover,
.settings-tab:focus-visible {
  color: #087a7f;
  outline: none;
}
.settings-tab.is-active {
  border-bottom-color: #087a7f;
  color: #087a7f;
}
.drawer-scroll {
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}
.settings-page { display: none; }
.settings-page.is-active { display: block; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-heading h3 { font-size: 17px; }
.section-heading p,
.field-note {
  margin: 4px 0 0;
  color: #7a8797;
  font-size: 12px;
  line-height: 1.5;
}
.settings-block {
  padding: 16px 0;
  border-bottom: 1px solid #edf1f5;
}
.settings-block:first-child { padding-top: 0; }
.settings-block h4 {
  margin-bottom: 14px;
  font-size: 14px;
}
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 13px 0 6px;
  color: #5f6f82;
  font-size: 12px;
  font-weight: 650;
}
.text-input,
.text-area,
.number-input,
.source-input,
.source-select {
  width: 100%;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  background: #ffffff;
  color: #34465c;
  outline: none;
}
.text-input,
.number-input,
.source-input,
.source-select {
  height: 36px;
  padding: 0 10px;
}
.text-area {
  min-height: 72px;
  padding: 8px 10px;
  resize: vertical;
}
.text-input:focus,
.text-area:focus,
.number-input:focus,
.source-input:focus,
.source-select:focus {
  border-color: #087a7f;
  box-shadow: 0 0 0 3px rgba(8, 122, 127, .12);
}
.number-input { width: 110px; }
.inline-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.primary-button,
.secondary-button,
.text-button {
  min-height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.primary-button {
  padding: 0 14px;
  border: 1px solid #087a7f;
  background: #087a7f;
  color: #ffffff;
}
.primary-button:hover,
.primary-button:focus-visible { background: #05666b; outline: none; }
.secondary-button {
  padding: 0 12px;
  border: 1px solid #d9e0e7;
  background: #ffffff;
  color: #435166;
}
.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: #087a7f;
  color: #05666b;
  outline: none;
}
.text-button {
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: #6b7788;
}
.text-button:hover,
.text-button:focus-visible { color: #087a7f; outline: none; }
button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: .55;
}
.full-button { width: 100%; }
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.segmented button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  background: #ffffff;
  color: #435166;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.segmented button:hover,
.segmented button:focus-visible {
  border-color: #087a7f;
  color: #05666b;
  outline: none;
}
.segmented button.is-selected {
  border-color: #087a7f;
  background: #087a7f;
  color: #ffffff;
}
input[type="range"] {
  width: 100%;
  margin: 3px 0 8px;
  accent-color: #087a7f;
}
.range-with-toggle {
  display: grid;
  align-items: center;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
}
.toggle-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #435166;
  cursor: pointer;
  font-size: 13px;
}
.toggle-row input { accent-color: #087a7f; }
.compact-toggle { white-space: nowrap; }
.color-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.color-grid label {
  display: flex;
  height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  border: 1px solid #e2e7ed;
  border-radius: 6px;
  color: #5f6f82;
  font-size: 12px;
  font-weight: 650;
}
.color-grid input {
  width: 34px;
  height: 28px;
  padding: 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.legacy-import {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid #b9dfe0;
  border-radius: 6px;
  background: #f0fbfb;
  color: #315b5d;
  font-size: 12px;
}
.source-list {
  display: grid;
  gap: 10px;
}
.source-editor {
  overflow: hidden;
  border: 1px solid #dfe5eb;
  border-radius: 6px;
  background: #ffffff;
}
.source-editor.is-dragging { opacity: .55; }
.source-editor.is-drop-target { border-color: #087a7f; }
.source-editor-header {
  display: grid;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid #edf1f5;
  grid-template-columns: 22px auto minmax(0, 1fr) auto auto auto;
}
.drag-handle {
  border: 0;
  background: transparent;
  color: #98a4b2;
  cursor: grab;
  font-size: 18px;
}
.source-summary {
  min-width: 0;
  overflow: hidden;
  color: #34465c;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-action {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid #dfe5eb;
  border-radius: 5px;
  background: #ffffff;
  color: #607084;
  cursor: pointer;
}
.source-action:hover,
.source-action:focus-visible {
  border-color: #087a7f;
  color: #087a7f;
  outline: none;
}
.source-action.is-danger:hover { border-color: #b42318; color: #b42318; }
.source-editor-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}
.source-field-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 96px;
}
.source-field-grid.three {
  grid-template-columns: 72px minmax(0, 1fr) 90px;
}
.source-field label {
  display: block;
  margin-bottom: 5px;
  color: #748193;
  font-size: 11px;
  font-weight: 650;
}
.source-color {
  width: 100%;
  height: 36px;
  padding: 3px;
  border: 1px solid #d9e0e7;
  border-radius: 6px;
  background: #ffffff;
}
.source-test-row {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.source-test-result {
  min-width: 0;
  overflow: hidden;
  color: #6b7788;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-test-result.is-error { color: #b42318; }
.status-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.status-row {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid #edf1f5;
  border-radius: 6px;
}
.status-row strong {
  min-width: 0;
  overflow: hidden;
  color: #435166;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-row span {
  color: #7a8797;
  font-size: 11px;
}
.status-row .status-error { color: #b42318; }
.schedule-summary {
  padding: 10px;
  border-radius: 6px;
  background: #f6f8fa;
  color: #526276;
  font-size: 12px;
  line-height: 1.6;
}
.session-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dfe5eb;
  border-radius: 6px;
  background: #f8fafc;
  color: #6b7788;
  font-size: 12px;
}
.session-summary strong {
  color: #253b53;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.security-form { border-bottom: 0; }
.security-form .primary-button { margin-top: 4px; }
.form-message {
  min-height: 18px;
  margin: 8px 0;
  color: #087a7f;
  font-size: 12px;
}

.form-error {
  min-height: 18px;
  margin: 8px 0;
  color: #b42318;
  font-size: 12px;
  line-height: 1.4;
}
.drawer-error {
  margin: 0;
  padding: 0 18px;
}
.drawer-actions {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid #e2e7ed;
  background: #ffffff;
}
.action-group {
  display: flex;
  gap: 8px;
}

@media (max-width: 1050px) {
  .feed-grid,
  html[data-columns="3"] .feed-grid,
  html[data-columns="4"] .feed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 90px;
    align-content: center;
    flex-direction: column;
    gap: 6px;
    padding: 20px 16px 14px;
  }
  .site-title { font-size: 28px; }
  .header-tools {
    position: static;
    justify-content: center;
  }
  .feed-shell { padding: 8px var(--page-padding) 28px; }
  .feed-grid,
  html[data-columns="2"] .feed-grid,
  html[data-columns="3"] .feed-grid,
  html[data-columns="4"] .feed-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: max(12px, var(--feed-grid-gap));
  }
  .feed-card-header { margin: 14px 14px 6px; }
  .feed-list {
    height: min(var(--feed-list-height), 72vh);
    min-height: 360px;
    padding-right: 8px;
    padding-left: 8px;
  }
  .settings-drawer {
    width: 100vw;
    border-left: 0;
  }
  .drawer-scroll { padding: 14px; }
  .drawer-actions { padding: 10px 14px; }
  .source-field-grid,
  .source-field-grid.three {
    grid-template-columns: minmax(0, 1fr);
  }
  .source-editor-header {
    grid-template-columns: 22px auto minmax(0, 1fr) auto auto;
  }
  .source-action[data-action="move-up"],
  .source-action[data-action="move-down"] { display: none; }
}
