:root {
  --bg: #080b16;
  --bg-2: #0b1020;
  --text: #eef2ff;
  --muted: #8b93b8;
  --line: rgba(255, 255, 255, .11);
  --glass: rgba(255, 255, 255, .062);
  --glass-strong: rgba(20, 26, 48, .92);
  --accent: #7dd3fc;
  --accent-2: #818cf8;
  --pink: #f472b6;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans SC", Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(1100px 560px at 50% -12%, #1d2e5d 0%, rgba(15, 23, 49, .92) 45%, rgba(8, 11, 22, 0) 72%),
    radial-gradient(620px 360px at 15% 15%, rgba(125, 211, 252, .09), transparent 70%),
    radial-gradient(540px 420px at 88% 20%, rgba(129, 140, 248, .08), transparent 70%),
    linear-gradient(180deg, #080b16 0%, #0b1020 52%, #080b16 100%);
  background-attachment: fixed;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .26;
  background-image:
    linear-gradient(rgba(255, 255, 255, .032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.shell {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
  padding: 40px 0 32px;
}

.glass {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar,
.brand,
.weather-pill,
.panel-head,
.search-box,
.nav-site,
.rank-row,
.video-card-head {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
}

.brand {
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .01em;
}

.brand-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  box-shadow: 0 0 22px rgba(125, 211, 252, .68);
  object-fit: contain;
}

.weather-pill {
  gap: 10px;
  max-width: 100%;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.weather-more,
.soft-link,
.accent {
  color: var(--accent);
}

.clock-panel {
  margin-top: 36px;
  text-align: center;
}

.clock {
  font-size: clamp(48px, 7vw, 64px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: .02em;
}

.date-line,
.muted,
.soft-link,
.footer {
  color: var(--muted);
}

.date-line {
  margin-top: 10px;
  font-size: 14px;
}

.search-box {
  width: min(720px, 100%);
  min-height: 58px;
  margin: 28px auto 0;
  gap: 12px;
  padding: 8px 8px 8px 14px;
  border-radius: 999px;
}

.engine-switch {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.engine,
.tab {
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.engine {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
}

.engine.is-active {
  color: var(--bg-2);
  font-weight: 700;
  background: var(--text);
}

.search-box input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-button,
.dialog-primary {
  cursor: pointer;
  color: var(--bg-2);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 28px rgba(125, 211, 252, .18);
}

.search-button {
  flex: 0 0 auto;
  padding: 10px 26px;
  border-radius: 999px;
  font-size: 14px;
}

.quick-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 30px;
}

.quick-item,
.quick-add {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 66px;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  border: 0;
  background: transparent;
}

.quick-item:hover,
.quick-add:hover,
.nav-site:hover,
.video-card:hover,
.rank-row:hover,
.chip:hover,
.taya-news-card:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.quick-name {
  width: 66px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-tile {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: linear-gradient(145deg, #16213e, #2b3563);
  font-size: 16px;
  font-weight: 800;
}

.icon-tile.small {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 13px;
}

.icon-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  background: #fff;
}

.quick-add {
  cursor: pointer;
  padding: 0;
}

.add-tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, .35);
  border-radius: 12px;
  font-size: 21px;
}

.quick-remove {
  position: absolute;
  top: -6px;
  right: 2px;
  display: none;
  padding: 1px 4px;
  color: rgba(255, 255, 255, .38);
  cursor: pointer;
  background: transparent;
  font-size: 15px;
}

.quick-item:hover .quick-remove {
  display: block;
}

.quick-remove:hover {
  color: var(--pink);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 36px;
}

.content-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel,
.video-card {
  border-radius: var(--radius);
  padding: 20px 22px;
}

.panel-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.panel h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
}

.soft-link,
.muted {
  flex: 0 0 auto;
  font-size: 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.tab {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
}

.tab.is-active {
  color: var(--accent);
  background: rgba(125, 211, 252, .16);
  font-weight: 700;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.nav-site {
  min-width: 0;
  gap: 10px;
  border-radius: 12px;
  transition: transform .18s ease, opacity .18s ease;
}

.site-text {
  min-width: 0;
}

.site-name,
.site-desc,
.rank-title,
.video-card h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.site-desc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.rank-list {
  display: grid;
}

.taya-news-section {
  padding: 16px 18px 18px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.taya-news-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.taya-news-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.taya-news-tab {
  min-width: 74px;
  min-height: 42px;
  padding: 8px 18px;
  color: var(--muted);
  border-radius: 22px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.taya-news-tab.is-active {
  color: var(--bg-2);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(125, 211, 252, .17);
}

.taya-news-tab:hover:not(.is-active) {
  color: var(--accent);
  background: rgba(125, 211, 252, .12);
}

.taya-news-more {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.taya-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.taya-news-card {
  display: flex;
  min-width: 0;
  min-height: 112px;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.taya-news-card:hover {
  border-color: rgba(125, 211, 252, .32);
  background: rgba(125, 211, 252, .08);
}

.taya-news-card img {
  width: 98px;
  height: 72px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.taya-news-card-body {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.taya-news-card strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.48;
  font-weight: 800;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.taya-news-card span span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rank-row {
  min-height: 44px;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  transition: transform .18s ease, opacity .18s ease;
}

.rank-row:first-child {
  border-top: 0;
}

.rank-num {
  width: 20px;
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.rank-title {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 14px;
}

.rank-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--pink);
  box-shadow: 0 0 16px rgba(244, 114, 182, .62);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.video-card {
  min-width: 0;
  transition: transform .18s ease, opacity .18s ease;
}

.video-card-head {
  gap: 10px;
  margin-bottom: 8px;
}

.video-card .source {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.video-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  font-size: 13px;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}

.footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
}

.float-panel {
  position: fixed;
  top: 50%;
  right: 24px;
  z-index: 10;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  transform: translateY(-50%);
}

.float-button {
  width: 42px;
  height: 42px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 14px;
  background: transparent;
  font-size: 18px;
}

.float-button:hover {
  color: var(--accent);
  background: rgba(125, 211, 252, .12);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 20;
  max-width: calc(100vw - 40px);
  padding: 12px 18px;
  color: var(--bg-2);
  border-radius: 999px;
  background: var(--text);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity .22s ease, transform .22s ease;
}

.toast.is-showing {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(4, 7, 16, .62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal.is-open {
  display: grid;
}

.dialog {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
}

.dialog h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.dialog p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.dialog label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dialog input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: rgba(255, 255, 255, .06);
  font-size: 15px;
}

.dialog input:focus {
  border-color: rgba(125, 211, 252, .55);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.dialog-secondary,
.dialog-primary {
  cursor: pointer;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}

.dialog-secondary {
  color: var(--muted);
  background: transparent;
}

@media (max-width: 1040px) {
  .shell {
    width: min(100% - 40px, 920px);
  }

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

  .nav-grid,
  .taya-news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .float-panel {
    right: 14px;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 28px, 560px);
    padding-top: 24px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .weather-pill {
    width: 100%;
    justify-content: space-between;
  }

  .clock-panel {
    margin-top: 28px;
  }

  .search-box {
    align-items: stretch;
    flex-direction: column;
    padding: 10px;
    border-radius: var(--radius);
  }

  .engine-switch {
    width: 100%;
  }

  .engine {
    flex: 1 1 0;
  }

  .search-box input {
    min-height: 44px;
    padding: 0 8px;
  }

  .search-button {
    width: 100%;
  }

  .panel,
  .video-card {
    padding: 18px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .tabs {
    justify-content: flex-start;
  }

  .nav-grid,
  .video-grid,
  .taya-news-grid {
    grid-template-columns: 1fr 1fr;
  }

  .taya-news-section {
    padding: 14px;
  }

  .taya-news-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .float-panel {
    top: auto;
    right: 14px;
    bottom: 14px;
    grid-auto-flow: column;
    transform: none;
  }
}

@media (max-width: 460px) {
  .shell {
    width: min(100% - 22px, 420px);
  }

  .weather-pill {
    white-space: normal;
  }

  .weather-more {
    display: none;
  }

  .quick-row {
    gap: 13px 10px;
  }

  .nav-grid,
  .video-grid,
  .taya-news-grid {
    grid-template-columns: 1fr;
  }

  .taya-news-card {
    min-height: 96px;
  }

  .rank-meta {
    display: none;
  }
}

/* Light theme variant: mist blue, teal, and violet */
:root {
  --bg: #f4fbff;
  --bg-2: #123142;
  --text: #173042;
  --muted: #66788a;
  --line: rgba(31, 92, 116, .16);
  --glass: rgba(255, 255, 255, .76);
  --glass-strong: rgba(255, 255, 255, .94);
  --accent: #0ea5a5;
  --accent-2: #5b7cfa;
  --pink: #ff6b8a;
  --shadow: 0 24px 60px rgba(57, 92, 115, .16);
}

body {
  color: var(--text);
  background:
    radial-gradient(940px 520px at 50% -12%, rgba(91, 124, 250, .22) 0%, rgba(255, 255, 255, 0) 68%),
    radial-gradient(680px 420px at 11% 18%, rgba(14, 165, 165, .18), transparent 70%),
    radial-gradient(560px 420px at 88% 18%, rgba(255, 107, 138, .12), transparent 72%),
    linear-gradient(180deg, #f8fdff 0%, #eef9f7 48%, #f6f2ff 100%);
  background-attachment: fixed;
}

body::before {
  opacity: .38;
  background-image:
    linear-gradient(rgba(31, 92, 116, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 92, 116, .06) 1px, transparent 1px);
}

.glass,
.panel,
.taya-news-section,
.video-card,
.float-panel {
  border-color: var(--line);
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .72);
}

.brand-icon {
  box-shadow: 0 12px 28px rgba(14, 165, 165, .24);
}

.weather-pill {
  color: #245064;
}

.engine-switch,
.b-seg {
  background: rgba(31, 92, 116, .08);
}

.engine.is-active,
.search-button,
.dialog-primary,
.taya-news-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px rgba(14, 165, 165, .2);
}

.search-box input {
  color: var(--text);
}

.search-box input::placeholder {
  color: #7d8fa0;
}

.quick-item,
.quick-add,
.date-line,
.muted,
.soft-link,
.footer,
.site-desc,
.video-card p,
.rank-meta,
.taya-news-card span span {
  color: var(--muted);
}

.add-tile {
  color: var(--muted);
  border-color: rgba(31, 92, 116, .28);
  background: rgba(255, 255, 255, .42);
}

.quick-remove {
  color: rgba(23, 48, 66, .35);
}

.icon-tile {
  border-color: rgba(31, 92, 116, .14);
  box-shadow: 0 10px 20px rgba(57, 92, 115, .12);
}

.tab.is-active {
  color: #047b82;
  background: rgba(14, 165, 165, .14);
}

.nav-site:hover,
.taya-news-card:hover,
.video-card:hover,
.rank-row:hover,
.chip:hover {
  background: rgba(14, 165, 165, .08);
}

.taya-news-head,
.rank-row {
  border-color: rgba(31, 92, 116, .12);
}

.taya-news-card {
  border-color: rgba(31, 92, 116, .12);
  background: rgba(255, 255, 255, .55);
}

.taya-news-card:hover {
  border-color: rgba(14, 165, 165, .32);
  background: rgba(232, 250, 249, .86);
}

.taya-news-card strong,
.video-card .source,
.video-card h3,
.site-name,
.rank-title,
.panel h2 {
  color: var(--text);
}

.chip {
  color: var(--text);
  border-color: rgba(31, 92, 116, .14);
  background: rgba(255, 255, 255, .56);
}

.live-dot {
  background: var(--pink);
  box-shadow: 0 0 16px rgba(255, 107, 138, .38);
}

.float-button {
  color: #5f7284;
}

.float-button:hover {
  color: #047b82;
  background: rgba(14, 165, 165, .12);
}

.toast {
  color: #fff;
  background: #123142;
}

.dialog {
  border-color: var(--line);
  background: rgba(255, 255, 255, .94);
}

.dialog input {
  color: var(--text);
  border-color: rgba(31, 92, 116, .16);
  background: rgba(255, 255, 255, .72);
}

.taya-news-card.no-image {
  min-height: 80px;
}

.taya-news-card.no-image .taya-news-card-body {
  justify-content: center;
}

.news-loading,
.news-error,
.news-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}
