:root {
  color-scheme: light;
  --ink: #07111f;
  --muted: #5f6f86;
  --soft: #eff6ff;
  --card: #ffffff;
  --line: #d8e5f4;
  --accent: #00a6fb;
  --accent-dark: #0077b6;
  --accent-soft: #d9f3ff;
  --blue: #2563eb;
  --dark: #07111f;
  --shadow: 0 18px 50px rgba(7, 17, 31, 0.1);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 42px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 166, 251, 0.12), transparent 24rem),
    radial-gradient(circle at 92% 6%, rgba(37, 99, 235, 0.12), transparent 20rem),
    linear-gradient(180deg, #f5fbff 0%, #edf5fb 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 12px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 16%, rgba(0, 166, 251, 0.35), transparent 20rem),
    radial-gradient(circle at 16% 18%, rgba(59, 130, 246, 0.18), transparent 14rem),
    linear-gradient(135deg, #04111f 0%, #0a2239 52%, #103a5e 100%);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  right: -90px;
  bottom: -130px;
  width: 280px;
  height: 280px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.topbar,
.brand,
.search-row,
.section-head,
.card-meta,
.detail-meta {
  display: flex;
  align-items: center;
}

.topbar {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  gap: 10px;
  color: inherit;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}

.nav-pill,
.tag,
.read-time {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.nav-pill {
  color: #d7f4ff;
  background: rgba(255, 255, 255, 0.12);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 24px 0 4px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.hero .eyebrow {
  color: #7dd3fc;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 12em;
  margin-bottom: 10px;
  font-size: clamp(34px, 9vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.07em;
}

.hero-desc {
  max-width: 40em;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.75;
}

.search-card {
  width: min(100%, 620px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.search-card label {
  display: block;
  margin: 0 0 8px 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.search-row {
  gap: 10px;
}

.search-row input {
  min-width: 0;
  flex: 1;
  border: 0;
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.search-row button,
.ghost-button,
.back-button {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 16px 34px rgba(0, 166, 251, 0.24);
  font-weight: 900;
}

main {
  padding: 18px 0 42px;
}

.spotlight-section,
.feed-section,
.info-panel,
.assistant-panel,
.article-detail,
.recommend-section {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.04);
}

.spotlight-section,
.feed-section {
  padding: 16px;
}

.assistant-panel {
  margin-top: 14px;
  padding: 16px;
}

.assistant-head {
  align-items: flex-end;
}

.assistant-pill {
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.assistant-chat-shell {
  display: grid;
  gap: 14px;
}

.chat-messages {
  display: grid;
  gap: 12px;
  min-height: 180px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

.message {
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: min(100%, 760px);
  border-radius: 18px;
  padding: 14px 16px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-bubble > :first-child {
  margin-top: 0;
}

.message-bubble > :last-child {
  margin-bottom: 0;
}

.message-bubble p {
  margin: 0 0 6px;
}

.message-bubble ul,
.message-bubble ol {
  margin: 6px 0;
  padding-left: 20px;
}

.message-bubble li {
  margin: 2px 0;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
  margin: 12px 0 8px;
  line-height: 1.45;
}

.message-bubble h1 {
  font-size: 22px;
}

.message-bubble h2 {
  font-size: 19px;
}

.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
  font-size: 17px;
}

.message-bubble pre {
  margin: 10px 0;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #e5eefc;
  white-space: pre;
}

.message-bubble code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
}

.message-bubble :not(pre) > code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.message-bubble blockquote {
  margin: 8px 0;
  padding: 2px 0 2px 12px;
  border-left: 3px solid rgba(37, 99, 235, 0.28);
  color: var(--muted);
}

.message-bubble a {
  color: #1d4ed8;
  text-decoration: underline;
}

.message-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 14px;
}

.message-bubble th,
.message-bubble td {
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 8px 10px;
  text-align: left;
}

.message.assistant .message-bubble {
  color: var(--ink);
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  border: 1px solid var(--line);
}

.message.user .message-bubble {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 16px 34px rgba(0, 166, 251, 0.18);
}

.message-bubble.pending {
  opacity: 0.72;
}

.chat-input-wrap {
  display: grid;
  gap: 10px;
}

.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.chat-input-bar textarea {
  flex: 1;
  min-height: 52px;
  max-height: 140px;
  border: 0;
  resize: none;
  outline: none;
  font: inherit;
  color: var(--ink);
  background: transparent;
  line-height: 1.6;
}

.send-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 16px 34px rgba(0, 166, 251, 0.24);
  font-size: 20px;
  font-weight: 900;
}

.send-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ai-disclaimer {
  color: var(--muted);
  font-size: 12px;
}

.section-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.section-head h2,
.recommend-head h2 {
  margin: 0;
  font-size: clamp(24px, 6vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.05em;
}

.ghost-button {
  flex: 0 0 auto;
  background: var(--dark);
  box-shadow: none;
}

.spotlight-grid {
  display: grid;
  gap: 12px;
}

.spotlight-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.spotlight-cover {
  min-height: 174px;
  background:
    linear-gradient(135deg, rgba(7, 17, 31, 0.2), rgba(0, 166, 251, 0.18)),
    linear-gradient(135deg, #dbeafe, #eff6ff);
  background-position: center;
  background-size: cover;
}

.spotlight-body {
  padding: 16px;
}

.tag {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.read-time {
  color: var(--muted);
  background: var(--soft);
}

.spotlight-card h3 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.spotlight-card p,
.article-card p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.7;
  -webkit-box-orient: vertical;
}

.spotlight-card p {
  margin-bottom: 16px;
  font-size: 14px;
  -webkit-line-clamp: 3;
}

.spotlight-card button,
.article-card button {
  border: 0;
  padding: 0;
  color: var(--accent-dark);
  background: transparent;
  font-weight: 900;
}

.news-layout {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.article-list {
  display: grid;
  gap: 10px;
}

.article-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
  border-color: rgba(0, 166, 251, 0.28);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.card-body {
  min-width: 0;
}

.card-meta {
  gap: 8px;
  margin-bottom: 10px;
}

.article-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.03em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-card p {
  margin-bottom: 12px;
  font-size: 13px;
  -webkit-line-clamp: 2;
}

.info-panel {
  margin-top: 10px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(7, 17, 31, 0.02), rgba(0, 166, 251, 0.06)),
    #fff;
}

.info-panel h3 {
  margin-bottom: 14px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.info-panel ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.info-panel button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  line-height: 1.55;
}

.info-panel button span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.state-box,
.load-more-status {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 16px;
  color: var(--muted);
  background: #fff;
  text-align: center;
  font-size: 13px;
}

.state-box {
  display: none;
}

.state-box.visible,
.load-more-status {
  display: block;
}

.load-more-status {
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.detail-view {
  overflow: hidden;
}

.back-button {
  margin-bottom: 14px;
  background: var(--dark);
  box-shadow: none;
}

.article-detail,
.recommend-section {
  padding: 20px 18px;
}

.article-detail h1 {
  margin-bottom: 16px;
  font-size: clamp(30px, 8vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.detail-meta {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.article-content {
  color: #1f2937;
  font-size: 16px;
  line-height: 1.92;
}

.article-content p {
  margin-bottom: 16px;
}

.article-content img {
  display: block;
  height: auto;
  max-width: 100%;
  border-radius: 14px;
}

.recommend-section {
  margin-top: 16px;
}

.recommend-head {
  margin-bottom: 12px;
}

.site-footer {
  display: flex;
  justify-content: center;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  font-size: 12px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-dark);
}

@media (min-width: 720px) {
  .site-shell {
    padding: 20px;
  }

  .hero {
    padding: 24px;
  }

  .hero-content {
    padding-top: 32px;
  }

  .spotlight-section,
  .feed-section,
  .info-panel,
  .article-detail,
  .recommend-section {
    border-radius: 28px;
  }

  .spotlight-section,
  .feed-section,
  .article-detail,
  .recommend-section {
    padding: 24px;
  }

  .spotlight-grid {
    grid-template-columns: 1.35fr 1fr;
  }

  .spotlight-card:first-child {
    grid-row: span 2;
  }

  .spotlight-card:first-child .spotlight-cover {
    min-height: 320px;
  }

  .spotlight-card:not(:first-child) {
    grid-template-columns: 148px 1fr;
  }

  .spotlight-card:not(:first-child) .spotlight-cover {
    min-height: 100%;
  }

  .spotlight-card:first-child h3 {
    font-size: 30px;
  }

  .info-panel {
    padding: 22px;
  }
}

@media (min-width: 1040px) {
  .news-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }

  .info-panel {
    position: sticky;
    top: 20px;
  }
}
