:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #222831;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f3f4f6;
  --primary: #111827;
  --accent: #217346;
  --accent-dark: #1a5c38;
  --blue: #2563eb;
  --danger: #dc2626;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

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

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
}

.boot-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 58px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  max-width: 1180px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: 0;
  min-width: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #111827;
  color: #fff;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a,
.header-actions button,
.header-actions a {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 12px;
  color: #4b5563;
  border: 0;
  background: transparent;
}

.main-nav a.active,
.main-nav a:hover,
.header-actions button:hover,
.header-actions a:hover {
  background: #f1f5f9;
  color: #111827;
}

.fish-button {
  background: #111827 !important;
  color: #fff !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.page-wrap {
  max-width: 1180px;
  width: 100%;
  margin: 18px auto 0;
  padding: 0 18px;
}

.layout-grid {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr) 286px;
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.left-rail,
.right-rail {
  position: sticky;
  top: 76px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  min-width: 0;
}

.category-menu {
  padding: 8px;
}

.category-menu a,
.category-menu button {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  text-align: left;
}

.category-menu a.active,
.category-menu a:hover,
.category-menu button.active,
.category-menu button:hover {
  background: #f3f4f6;
  color: #111827;
}

.content-panel {
  min-height: 680px;
  overflow: hidden;
  min-width: 0;
}

.source-tabs {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.subtab,
.refresh-btn {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  padding: 0 11px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.chip.active,
.subtab.active {
  color: #111827;
  background: #f1f5f9;
  border-color: #d1d5db;
  font-weight: 650;
}

.list-toolbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.subtabs {
  display: flex;
  gap: 8px;
  overflow: auto;
}

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

.news-list {
  padding: 0;
}

.news-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.news-item:hover {
  background: #fbfdff;
}

.news-item.no-image {
  grid-template-columns: 42px minmax(0, 1fr);
}

.rank {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #6b7280;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.news-item:nth-child(1) .rank,
.news-item:nth-child(2) .rank,
.news-item:nth-child(3) .rank {
  background: #111827;
  color: #fff;
}

.news-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.news-desc {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.news-meta {
  margin-top: 9px;
  display: flex;
  gap: 10px;
  color: #9ca3af;
  font-size: 12px;
}

.thumb {
  width: 82px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef2f7;
}

.skeleton {
  padding: 16px;
}

.skeleton-row {
  height: 66px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f1f5f9, #ffffff, #f1f5f9);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.empty-state {
  min-height: 320px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 40px;
}

.right-rail {
  display: grid;
  gap: 12px;
}

.side-card {
  padding: 14px;
}

.side-card h2,
.side-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.side-card p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.tag {
  height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  background: #f1f5f9;
  color: #475569;
}

.service-item {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.service-item:first-of-type {
  border-top: 0;
}

.service-title {
  font-weight: 650;
}

.service-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.footer {
  max-width: 1180px;
  margin: 26px auto 0;
  padding: 24px 18px 36px;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  background: rgba(15, 23, 42, 0.32);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.show {
  display: flex;
}

.theme-modal {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.theme-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.theme-card {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  align-items: center;
}

.theme-icon {
  height: 64px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
}

.primary-btn,
.ghost-btn,
.icon-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 34px;
  padding: 0 12px;
  background: #fff;
}

.primary-btn {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.page-document {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 32px;
  min-height: 620px;
}

.page-document h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.page-document section {
  margin-top: 26px;
}

.page-document p,
.page-document li {
  line-height: 1.8;
  color: #4b5563;
}

.changelog-entry {
  border-left: 3px solid #111827;
  padding-left: 16px;
  margin: 22px 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
}

.settings-list,
.setting-source-grid {
  display: grid;
  gap: 10px;
}

.subscription-item,
.setting-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.subscription-item {
  cursor: grab;
}

.toggle {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: #d1d5db;
  padding: 3px;
}

.toggle::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.16s ease;
}

.toggle.on {
  background: var(--accent);
}

.toggle.on::after {
  transform: translateX(18px);
}

/* Excel theme */
.excel-page {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #fff;
  color: #1f2937;
  display: flex;
  flex-direction: column;
}

.excel-titlebar {
  height: 36px;
  flex: 0 0 36px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  user-select: none;
}

.excel-title-left,
.excel-title-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
}

.excel-titlebar button {
  border: 0;
  background: transparent;
  color: inherit;
  height: 28px;
  padding: 0 10px;
}

.excel-titlebar button:hover {
  background: var(--accent-dark);
}

.excel-tabs {
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 8px;
  border-bottom: 1px solid #d1d5db;
  background: #fff;
}

.excel-tabs button {
  height: 30px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  padding: 0 10px;
}

.excel-tabs button.active {
  background: var(--accent);
  color: #fff;
}

.excel-ribbon {
  height: 88px;
  flex: 0 0 88px;
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 1fr 1fr 1.2fr;
  background: #f3f2f1;
  border-bottom: 1px solid #d1d5db;
  overflow: hidden;
}

.ribbon-group {
  border-right: 1px solid #d1d5db;
  padding: 6px 8px;
}

.ribbon-label {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 5px;
}

.ribbon-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ribbon-buttons button,
.ribbon-buttons select {
  height: 25px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 3px;
  padding: 0 7px;
  font-size: 12px;
}

.formula-bar {
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  grid-template-columns: 58px 36px 1fr;
  border-bottom: 1px solid #d1d5db;
  background: #fff;
  font-size: 12px;
}

.formula-bar div,
.formula-bar input {
  border-right: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
}

.formula-bar input {
  border: 0;
  justify-content: flex-start;
  padding: 0 8px;
  outline: none;
}

.excel-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 186px minmax(0, 1fr);
  background: #fff;
}

.excel-side {
  border-right: 1px solid #d1d5db;
  background: #f8fafc;
  overflow: auto;
}

.excel-side h2 {
  font-size: 13px;
  margin: 12px 12px 8px;
}

.excel-side button {
  width: calc(100% - 16px);
  margin: 3px 8px;
  height: 30px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  text-align: left;
  padding: 0 8px;
}

.excel-side button.active {
  background: #e7f3ea;
  border-color: #b7d8c0;
  color: var(--accent-dark);
}

.excel-grid-wrap {
  min-width: 0;
  overflow: auto;
  position: relative;
  background-image:
    linear-gradient(#e5e7eb 1px, transparent 1px),
    linear-gradient(90deg, #e5e7eb 1px, transparent 1px);
  background-size: 120px 32px;
}

.excel-controls {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #d1d5db;
}

.excel-controls select,
.excel-controls button {
  height: 30px;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 4px;
  padding: 0 8px;
}

.excel-subtabs {
  display: flex;
  gap: 6px;
  overflow: auto;
}

.excel-subtabs button.active {
  background: var(--accent);
  color: #fff;
}

.excel-table {
  width: max(960px, 100%);
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.78);
}

.excel-table th,
.excel-table td {
  border: 1px solid #d1d5db;
  height: 32px;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.excel-table th {
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
}

.excel-table tr:hover td {
  background: #eef6f0;
}

.excel-statusbar {
  height: 22px;
  flex: 0 0 22px;
  border-top: 1px solid #d1d5db;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11px;
}

.boss-hidden .excel-side,
.boss-hidden .excel-controls,
.boss-hidden .preview-box {
  visibility: hidden;
}

.boss-hidden .excel-grid-wrap::after {
  content: "2024年度数据统计表";
  position: absolute;
  top: 90px;
  left: 80px;
  font-size: 18px;
  font-weight: 650;
  color: #374151;
}

.preview-box {
  position: fixed;
  z-index: 70;
  top: 160px;
  left: 280px;
  width: 720px;
  height: 480px;
  min-width: 320px;
  min-height: 220px;
  background: #fff;
  border: 1px solid #9ca3af;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
}

.preview-box.show {
  display: flex;
}

.preview-title {
  height: 34px;
  flex: 0 0 34px;
  background: #f3f4f6;
  border-bottom: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 12px;
  cursor: move;
}

.preview-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

.preview-hint {
  padding: 8px 10px;
  font-size: 12px;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
}

.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
}

.resize-handle::before {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #9ca3af;
  border-bottom: 2px solid #9ca3af;
}

@media (max-width: 980px) {
  .layout-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .left-rail,
  .right-rail {
    position: static;
  }

  .category-menu {
    display: flex;
    overflow: auto;
  }

  .source-tabs,
  .subtabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
  }

  .list-toolbar {
    min-width: 0;
  }

  .category-menu a,
  .category-menu button {
    width: auto;
    flex: 0 0 auto;
  }

  .main-nav {
    display: none;
  }

  .header-actions a {
    display: none;
  }

  .fish-button {
    padding: 0 10px !important;
    white-space: nowrap;
  }

  .news-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .thumb {
    display: none;
  }

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

  .footer {
    flex-direction: column;
  }

  .excel-ribbon {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    overflow-x: auto;
  }

  .excel-workspace {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .preview-box {
    left: 16px;
    top: 120px;
    width: calc(100vw - 32px);
  }
}
