:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-2: #eef2f8;
  --text: #172033;
  --muted: #667085;
  --muted-2: #8a94a6;
  --card: rgba(255, 255, 255, 0.68);
  --card-strong: rgba(255, 255, 255, 0.82);
  --border: rgba(120, 133, 155, 0.2);
  --shadow: 0 24px 80px rgba(55, 70, 110, 0.14);
  --shadow-soft: 0 12px 36px rgba(55, 70, 110, 0.1);
  --accent: #5b8cff;
  --accent-2: #8fd3ff;
  --accent-3: #ffc6e8;
  --success: #15a46c;
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 20px;
  --blur: blur(28px) saturate(145%);
  --max-width: 1180px;
  --background-image: none;
  --background-opacity: 0.36;
  --background-blur: 0px;
  --background-position: center;
  --background-size: cover;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1118;
  --bg-2: #151b25;
  --text: #f6f7fb;
  --muted: #a4adbd;
  --muted-2: #717b8d;
  --card: rgba(25, 31, 43, 0.66);
  --card-strong: rgba(31, 38, 52, 0.82);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.24);
  --accent: #7aa7ff;
  --accent-2: #75ddff;
  --accent-3: #ff8fd3;
  --success: #45d390;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(143, 211, 255, 0.52), transparent 32vw),
    radial-gradient(circle at 88% 8%, rgba(255, 198, 232, 0.46), transparent 34vw),
    radial-gradient(circle at 68% 88%, rgba(91, 140, 255, 0.20), transparent 30vw),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  overflow-x: hidden;
  transition: background 280ms ease, color 280ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--background-image);
  background-position: var(--background-position);
  background-size: var(--background-size);
  background-repeat: no-repeat;
  opacity: var(--background-opacity);
  filter: blur(var(--background-blur));
  transform: scale(1.02);
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.22) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  opacity: 0.20;
  z-index: -1;
}

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

button {
  font: inherit;
}

.shell {
  width: min(var(--max-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.glass {
  position: relative;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  overflow: hidden;
}

.glass::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.34), transparent 38%, rgba(255,255,255,0.12));
  opacity: 0.48;
}

.sidebar {
  position: sticky;
  top: 34px;
  border-radius: var(--radius-xl);
  padding: 26px;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.avatar {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 18px 34px rgba(91, 140, 255, 0.22);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.06em;
  color: rgba(255, 255, 255, 0.92);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.86), rgba(255,255,255,0.22)),
    radial-gradient(circle at 20% 18%, var(--accent-2), transparent 42%),
    radial-gradient(circle at 76% 80%, var(--accent-3), transparent 46%),
    linear-gradient(135deg, var(--accent), #c6d7ff);
}

.avatar.has-image {
  background: rgba(255,255,255,0.2);
}

.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.name-wrap h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.name-wrap p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.intro {
  position: relative;
  z-index: 1;
  margin: 24px 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.status {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.42);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

html[data-theme="dark"] .status {
  background: rgba(255,255,255,0.06);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(21, 164, 108, 0.13);
}

.section-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.social-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.social-card {
  --social-icon-color: #111827;
  --social-icon-bg: linear-gradient(145deg, rgba(23, 32, 51, 0.10), rgba(91, 140, 255, 0.08));
  --social-icon-border: rgba(23, 32, 51, 0.12);
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.44);
  border: 1px solid var(--border);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

html[data-theme="dark"] .social-card {
  background: rgba(255,255,255,0.06);
}

.social-card:hover {
  transform: translateY(-2px);
  background: var(--card-strong);
  box-shadow: var(--shadow-soft);
  border-color: rgba(91, 140, 255, 0.32);
}

.icon {
  width: 34px;
  height: 34px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--social-icon-bg);
  border: 1px solid var(--social-icon-border);
  color: var(--social-icon-color);
  font-size: 16px;
  flex: 0 0 auto;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.56), 0 8px 18px rgba(55, 70, 110, 0.08);
}

html[data-theme="dark"] .social-card {
  --social-icon-color: var(--text);
  --social-icon-bg: linear-gradient(145deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05));
  --social-icon-border: rgba(255,255,255,0.12);
}

.icon img,
.icon svg {
  width: 19px;
  height: 19px;
  object-fit: contain;
  color: var(--social-icon-color) !important;
}

/*
  外部 SVG / iconfont 常会把 path 写死为 fill="#fff"。
  仅依赖 JS 清洗时，浏览器缓存或部分 SVG 写法可能仍保留原色，
  所以这里再用 CSS 做一层兜底，确保浅色模式也能清晰显示。
*/
.icon svg[data-normalized-icon="true"][fill]:not([fill="none"]),
.icon svg[data-normalized-icon="true"] [fill]:not([fill="none"]) {
  fill: currentColor !important;
}

.icon svg[data-normalized-icon="true"][stroke]:not([stroke="none"]),
.icon svg[data-normalized-icon="true"] [stroke]:not([stroke="none"]) {
  stroke: currentColor !important;
}

.icon svg * {
  vector-effect: non-scaling-stroke;
}

.social-card strong {
  display: block;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.social-card span:last-child span,
.social-card .desc {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.theme-btn {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  width: 100%;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  background: rgba(255,255,255,0.46);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 180ms ease, background 180ms ease;
}

html[data-theme="dark"] .theme-btn {
  background: rgba(255,255,255,0.06);
}

.theme-btn:hover {
  transform: translateY(-1px);
  background: var(--card-strong);
}

.theme-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  line-height: 1;
}

.theme-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

html[data-theme="light"] .theme-icon {
  filter: drop-shadow(0 2px 5px rgba(44, 44, 44, 0.16));
}

.main {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.hero {
  border-radius: var(--radius-xl);
  padding: 30px;
  min-height: 186px;
  display: grid;
  align-content: center;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.hero h2 {
  margin: 0;
  max-width: 650px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.075em;
}

.hero p {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.rss-panel {
  border-radius: var(--radius-xl);
  padding: 22px;
  max-height: calc(100vh - 252px);
  min-height: 520px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.045em;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.feed-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.42);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

html[data-theme="dark"] .feed-tabs {
  background: rgba(255,255,255,0.06);
}

.tab {
  border: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background 180ms ease, color 180ms ease;
}

.tab.active {
  color: var(--text);
  background: var(--card-strong);
  box-shadow: 0 4px 18px rgba(55, 70, 110, 0.08);
}

.rss-list {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  align-content: start;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 133, 155, 0.36) transparent;
}

.rss-item,
.empty-state,
.rss-more {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.46);
  border: 1px solid var(--border);
}

.rss-more {
  width: 100%;
  place-items: center;
  min-height: 56px;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.rss-more:hover {
  transform: translateY(-1px);
  background: var(--card-strong);
  border-color: rgba(91, 140, 255, 0.32);
}

html[data-theme="dark"] .rss-item,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .rss-more {
  background: rgba(255,255,255,0.055);
}

.rss-item {
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.rss-item:hover {
  transform: translateY(-2px);
  background: var(--card-strong);
  border-color: rgba(91, 140, 255, 0.32);
}

.rss-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 12px;
}

.rss-source {
  color: var(--accent);
  font-weight: 700;
}

.rss-item h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.025em;
}

.rss-item p,
.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.footer {
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
  padding: 4px 0 10px;
}

.fade-in {
  animation: fadeIn 560ms ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 28px, 680px);
    padding: 18px 0 26px;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 22px;
  }

  .profile-top {
    justify-content: center;
    text-align: left;
  }

  .intro {
    text-align: center;
  }

  .status {
    display: flex;
    width: fit-content;
    margin: 0 auto;
  }

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

  .hero {
    padding: 24px;
  }

  .rss-panel {
    max-height: none;
    min-height: auto;
    overflow: visible;
  }

  .rss-list {
    overflow: visible;
  }
}

@media (max-width: 560px) {
  body {
    background:
      radial-gradient(circle at 12% 2%, rgba(143, 211, 255, 0.38), transparent 70vw),
      radial-gradient(circle at 88% 4%, rgba(255, 198, 232, 0.34), transparent 76vw),
      linear-gradient(135deg, var(--bg), var(--bg-2));
  }

  .shell {
    width: calc(100% - 22px);
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .sidebar,
  .hero,
  .rss-panel {
    border-radius: 28px;
  }

  .profile-top {
    justify-content: flex-start;
  }

  .avatar {
    width: 64px;
    height: 64px;
    border-radius: 21px;
  }

  .name-wrap h1 {
    font-size: 23px;
  }

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

  .hero h2 {
    font-size: 38px;
  }

  .hero p,
  .intro {
    font-size: 14px;
  }

  .panel-head {
    display: grid;
  }

  .feed-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    justify-content: stretch;
    scrollbar-width: none;
  }

  .feed-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 1 0 64px;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
  }

  .rss-item p {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
