:root {
  --editorial-ink: #17181d;
  --editorial-ink-2: #393c43;
  --editorial-muted: #747983;
  --editorial-paper: #f5f2ec;
  --editorial-paper-2: #faf8f3;
  --editorial-surface: rgba(255, 255, 255, .72);
  --editorial-line: rgba(23, 24, 29, .13);
  --editorial-line-strong: rgba(23, 24, 29, .22);
  --editorial-violet: #7065d8;
  --editorial-jade: #2f927a;
  --editorial-amber: #b67c2b;
  --editorial-blue: #557aaf;
  --editorial-danger: #b95561;
  --sidebar-paper: #f7f8fc;
  --sidebar-text: #536078;
  --sidebar-muted: #98a4ba;
  --sidebar-violet: #5b55f7;
  --sidebar-violet-soft: #ecebff;
  --editorial-ease: cubic-bezier(.22, 1, .36, 1);
  --primary: #25262c;
  --primary-dark: #090a0c;
  --primary-soft: #ebe8e1;
  --canvas: var(--editorial-paper);
  --surface: var(--editorial-surface);
  --surface-2: #f3f0e9;
  --ink: var(--editorial-ink);
  --ink-2: var(--editorial-ink-2);
  --muted: var(--editorial-muted);
  --line: var(--editorial-line);
  --line-strong: var(--editorial-line-strong);
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 12px 35px rgba(44, 39, 31, .045);
  --shadow-md: 0 26px 70px rgba(44, 39, 31, .12);
}

body {
  color: var(--editorial-ink);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}

.brand strong,
.page-heading h1,
.card-head h2,
.login-heading h2 {
  font-family: "STSong", "Songti SC", "SimSun", Georgia, serif;
}

.button {
  border-radius: 4px;
  letter-spacing: .01em;
}

.button-primary {
  border-color: #1b1c20;
  background: #1b1c20;
  color: #fff;
  box-shadow: 0 9px 22px rgba(27, 28, 32, .13);
}

.button-primary:hover {
  border-color: #000;
  background: #000;
  box-shadow: 0 12px 28px rgba(27, 28, 32, .18);
}

.button-secondary,
.button-ghost {
  border-color: var(--editorial-line);
  background: rgba(255, 255, 255, .42);
  color: var(--editorial-ink-2);
}

/* Final login direction A: full-screen silk refraction. */
.login-body {
  background: #f4f2ee;
}

.login-shell {
  background: linear-gradient(135deg, #f7f5f1 0%, #f2f1f7 52%, #eef3f4 100%);
}

.editorial-motion {
  inset: 0;
  background: linear-gradient(135deg, #f7f5f1, #f2f1f7 52%, #eef3f4);
}

.silk-ribbon {
  position: absolute;
  display: block;
  border-radius: 48% 52% 46% 54%;
  filter: blur(7px);
  will-change: transform;
}

.silk-ribbon-one {
  width: clamp(720px, 60vw, 1120px);
  height: clamp(330px, 36vw, 620px);
  right: -28%;
  top: -28%;
  background: linear-gradient(116deg, rgba(255, 255, 255, .08), rgba(119, 98, 242, .34), rgba(255, 255, 255, .72));
  transform: rotate(-28deg);
  animation: editorial-silk-one 14s ease-in-out infinite alternate;
}

.silk-ribbon-two {
  width: clamp(640px, 52vw, 960px);
  height: clamp(280px, 31vw, 520px);
  left: -28%;
  bottom: -24%;
  background: linear-gradient(102deg, rgba(75, 184, 158, .27), rgba(255, 255, 255, .72), rgba(225, 183, 137, .18));
  transform: rotate(18deg);
  animation: editorial-silk-two 19s ease-in-out infinite alternate;
}

.silk-ribbon-three {
  width: 48vw;
  height: 18vw;
  left: 23%;
  top: 35%;
  background: linear-gradient(104deg, transparent, rgba(255, 255, 255, .9), rgba(122, 104, 233, .11), transparent);
  filter: blur(18px);
  transform: rotate(-16deg);
  animation: editorial-silk-three 16s ease-in-out infinite alternate;
}

.silk-lines {
  position: absolute;
  inset: -20%;
  display: block;
  opacity: .4;
  background: repeating-linear-gradient(112deg, transparent 0 48px, rgba(255, 255, 255, .78) 49px, transparent 50px);
  animation: editorial-silk-lines 30s linear infinite;
}

.login-copy .eyebrow,
.form-kicker {
  color: #45474d !important;
}

.field-with-icon input:focus {
  border-color: #45474d;
  box-shadow: 0 0 0 3px rgba(69, 71, 77, .09);
}

.login-form .button-large:hover {
  background: #000;
  box-shadow: 0 11px 28px rgba(27, 29, 37, .22);
}

@keyframes editorial-silk-one {
  to { transform: translate(-7vw, 5vh) rotate(-19deg) scale(1.08); }
}

@keyframes editorial-silk-two {
  to { transform: translate(8vw, -5vh) rotate(11deg) scale(1.12); }
}

@keyframes editorial-silk-three {
  to { transform: translate(4vw, -4vh) rotate(-9deg) scaleX(1.14); }
}

@keyframes editorial-silk-lines {
  to { transform: translate(130px, 80px); }
}

/* Shared editorial application frame. */
.app-body {
  background:
    linear-gradient(112deg, rgba(255, 255, 255, .48), transparent 35%),
    var(--editorial-paper);
}

.sidebar {
  padding: 22px 14px 16px;
  border-right: 1px solid #e1e5ef;
  background: rgba(247, 248, 252, .97);
  backdrop-filter: blur(18px);
}

.sidebar-head {
  height: 44px;
  margin: 0 7px 26px;
}

.sidebar-head .brand-copy small {
  color: #778198;
  font-family: Georgia, serif;
  letter-spacing: .18em;
}

.sidebar-toggle {
  border: 1px solid transparent;
}

.sidebar-toggle:hover {
  border-color: var(--editorial-line);
  background: rgba(255, 255, 255, .6);
}

.nav-section {
  margin: 25px 12px 9px;
  color: var(--sidebar-muted);
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .14em;
}

.nav-item {
  min-height: 42px;
  margin: 2px 0;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 600;
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.nav-item:hover {
  color: #4a45d8;
  background: #f0f0fb;
}

.nav-item.active {
  color: var(--sidebar-violet);
  background: linear-gradient(90deg, var(--sidebar-violet-soft), #f1efff);
  box-shadow: inset 0 0 0 1px rgba(91, 85, 247, .035);
  font-weight: 750;
}

.nav-item.active::before {
  left: 0;
  width: 3px;
  height: 24px;
  border-radius: 0 3px 3px 0;
  background: var(--sidebar-violet);
}

.nav-icon,
.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-item.active .nav-icon {
  transform: translateX(1px);
}

.sidebar-user {
  border-top: 1px solid var(--editorial-line);
}

.avatar {
  border-radius: 50%;
  background: linear-gradient(145deg, var(--sidebar-violet), #7669ee);
}

.sidebar-collapsed .sidebar-head {
  height: 82px;
  margin: 0 0 12px;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}

.sidebar-collapsed .sidebar-head .brand {
  display: flex;
  width: 32px;
  height: 32px;
}

.sidebar-collapsed .sidebar-head .brand-copy {
  display: none;
}

.sidebar-collapsed .nav-item.active::before {
  left: -14px;
}

.topbar {
  border-bottom: 1px solid var(--editorial-line);
  background: rgba(250, 248, 243, .82);
  backdrop-filter: blur(18px);
}

.breadcrumbs b {
  color: #b3b0aa;
  font-weight: 400;
}

.top-search input {
  border-color: var(--editorial-line);
  background: rgba(255, 255, 255, .5);
}

.content,
.records-content {
  width: min(100%, 1640px);
  padding: 30px 34px 48px;
}

.page-heading {
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--editorial-line-strong);
}

.page-heading h1 {
  font-size: clamp(25px, 2.2vw, 34px);
  font-weight: 600;
  letter-spacing: -.035em;
}

.page-heading p:not(.eyebrow) {
  margin-top: 7px;
  color: var(--editorial-muted);
  font-size: 11px;
}

.heading-actions select {
  border-radius: 3px;
  background-color: rgba(255, 255, 255, .52);
}

.dashboard-date-control {
  position: relative;
}

.dashboard-date-control > select {
  min-width: 116px;
}

.dashboard-custom-range {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  padding: 15px;
  border: 1px solid var(--editorial-line-strong);
  border-radius: 4px;
  background: #fbfaf7;
  box-shadow: 0 20px 55px rgba(37, 32, 25, .14);
}

.dashboard-custom-range[hidden] {
  display: none;
}

.dashboard-custom-range > strong {
  display: block;
  margin-bottom: 12px;
  color: var(--editorial-ink);
  font-family: Georgia, "Songti SC", serif;
  font-size: 16px;
  font-weight: 500;
}

.dashboard-custom-range label {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--editorial-muted);
  font-size: 11px;
}

.dashboard-custom-range input {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--editorial-line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .7);
  color: var(--editorial-ink);
}

.dashboard-custom-range > p {
  min-height: 17px;
  margin: 6px 0 4px;
  color: #a44b53;
  font-size: 10px;
}

.dashboard-custom-range > div {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.dashboard-custom-range button {
  min-width: 58px;
  height: 32px;
  border: 1px solid var(--editorial-line);
  border-radius: 3px;
  background: transparent;
  color: var(--editorial-ink-2);
  cursor: pointer;
}

.dashboard-custom-range button.primary {
  border-color: var(--editorial-ink);
  background: var(--editorial-ink);
  color: #fff;
}

.card {
  border: 1px solid var(--editorial-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .55);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.card-head {
  padding: 21px 22px 12px;
}

.card-head h2 {
  color: var(--editorial-ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.025em;
}

.card-head p {
  color: var(--editorial-muted);
}

/* Dashboard: continuous metric rail and restrained data regions. */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 22px;
  border-top: 1px solid var(--editorial-line-strong);
  border-bottom: 1px solid var(--editorial-line-strong);
  background: rgba(255, 255, 255, .24);
}

.metric-card {
  min-height: 142px;
  padding: 20px 22px 18px;
  border: 0;
  border-right: 1px solid var(--editorial-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card:hover {
  transform: none;
  background: rgba(255, 255, 255, .38);
}

.metric-top {
  min-height: 25px;
}

.metric-icon {
  width: 27px;
  height: 27px;
  border: 1px solid var(--editorial-line);
  border-radius: 50%;
  background: transparent !important;
  color: var(--editorial-ink-2) !important;
}

.metric-icon svg {
  width: 14px;
  height: 14px;
}

.metric-card > p {
  margin: 16px 0 4px;
  color: #777a81;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}

.metric-card > strong {
  color: #141519;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(31px, 3vw, 45px);
  font-weight: 500;
  letter-spacing: -.04em;
}

.metric-card > small {
  color: #8b8e96;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 2fr) minmax(300px, .72fr);
  gap: 18px;
  margin-top: 0;
}

.chart-card {
  min-height: 418px;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .3);
}

.chart-wrap {
  padding: 5px 21px 13px;
}

.trend-chart {
  height: 315px;
}

.trend-chart .grid-lines path {
  stroke: rgba(23, 24, 29, .09);
}

.trend-chart .line-primary {
  stroke: var(--editorial-ink);
}

.trend-chart .line-secondary {
  stroke: var(--editorial-violet);
  opacity: .55;
}

.trend-chart .area-path {
  fill: rgba(112, 101, 216, .09);
}

.trend-chart .chart-points circle {
  fill: var(--editorial-paper-2);
  stroke: var(--editorial-ink);
}

.legend-line.primary {
  background: var(--editorial-ink);
}

.legend-line.soft {
  background: var(--editorial-violet);
}

.platform-card {
  border-radius: 0;
  border-top-color: var(--editorial-line-strong);
  border-bottom-color: var(--editorial-line-strong);
  background: rgba(255, 255, 255, .42);
}

.donut {
  background: conic-gradient(#1f2024 0 24%, #6e65bf 24% 42%, #3b9a81 42% 60%, #6288b8 60% 78%, #c08a43 78% 90%, #aaa69f 90% 100%);
  box-shadow: none;
}

.donut::after {
  background: #f8f5ef;
}

.platform-list > div {
  border-bottom-color: rgba(23, 24, 29, .07);
}

.bottom-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .85fr);
  gap: 18px;
  margin-top: 18px;
}

.bottom-grid .card {
  border-radius: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
}

.performance-list > div,
.recent-list a {
  border-bottom-color: rgba(23, 24, 29, .09);
}

.performance-list > div:hover,
.recent-list a:hover {
  background: rgba(255, 255, 255, .42);
}

.performance-rank {
  color: #878a91;
  font-family: Georgia, serif;
}

.source-performance-card .card-head {
  padding-bottom: 16px;
}

.source-performance-head,
.source-performance-row {
  display: grid;
  grid-template-columns: 44px minmax(190px, 1fr) 90px minmax(150px, .72fr);
  align-items: center;
  gap: 14px;
}

.source-performance-head {
  margin: 0 22px;
  padding: 0 0 9px;
  color: #92959d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

.source-performance-row {
  min-height: 58px;
  margin: 0 22px;
  border-top: 1px solid rgba(23, 24, 29, .09);
}

.source-performance-row:first-child {
  border-top-color: var(--editorial-line-strong);
}

.source-performance-row:hover {
  background: rgba(255, 255, 255, .42);
}

.source-rank {
  color: #8e929b;
  font-family: Georgia, serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.source-site {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.source-site strong {
  overflow: hidden;
  color: var(--editorial-ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-site small {
  overflow: hidden;
  color: #9398a5;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-count,
.source-share > strong {
  color: var(--editorial-ink-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.source-share {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.source-share > div {
  height: 4px;
  overflow: hidden;
  background: #e8e7ee;
}

.source-share i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22232a, #6459ec);
  transform-origin: left center;
  animation: source-bar-reveal .65s ease both;
}

@keyframes source-bar-reveal {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Records: editorial ledger with high information clarity. */
.records-content .page-heading {
  margin-bottom: 18px;
}

.filter-card {
  margin-bottom: 16px;
  padding: 15px 16px;
  border-width: 1px 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .28);
}

.filter-grid {
  grid-template-columns: 136px 136px 136px 130px minmax(260px, 1fr) auto;
  gap: 10px;
}

.filter-grid label > span {
  color: #8a8d94;
  font-family: Georgia, "Microsoft YaHei", sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
}

.filter-grid select,
.filter-grid input {
  height: 38px;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, .58);
}

.table-card {
  overflow: visible;
  border-width: 1px 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .37);
}

.table-toolbar {
  border-bottom: 1px solid var(--editorial-line);
  background: transparent;
}

.table-scroll {
  overflow: auto;
  min-height: 478px;
}

.data-table {
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead {
  position: sticky;
  z-index: 5;
  top: 0;
}

.data-table th {
  height: 48px;
  border-bottom: 1px solid var(--editorial-line-strong);
  background: rgba(239, 236, 229, .96);
  color: #666970;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .06em;
}

.data-table td {
  height: 72px;
  border-bottom: 1px solid rgba(23, 24, 29, .075);
  color: #353840;
  font-size: 10px;
  line-height: 1.5;
}

.data-table tbody tr:nth-child(even) td {
  background: rgba(248, 246, 241, .42);
}

.data-table tbody tr:hover td,
.data-table tbody tr.selected td {
  background: rgba(230, 226, 218, .66);
}

.table-brand strong {
  color: #17181d;
}

.brand-avatar {
  border: 1px solid var(--editorial-line);
  border-radius: 50%;
  background: #f2eee7;
  color: #4b4e55;
}

.brand-avatar.frombio {
  background: #eae8e2;
  color: #1d1e22;
}

.intent-tag,
.badge {
  border-radius: 3px;
}

.intent-tag {
  background: #ece9e2;
  color: #4a4c52;
}

.badge-success {
  background: #e4f1eb;
  color: #236f5c;
}

.badge-warning {
  background: #f4ead8;
  color: #8a5d1e;
}

.badge-neutral {
  background: #ebe9e5;
  color: #62656c;
}

.question-cell {
  color: #202126;
  font-weight: 600;
}

.answer-cell {
  color: #646871;
}

.mention-rank strong {
  color: #34363c;
}

.row-menu,
.column-menu {
  border-radius: 4px;
  box-shadow: 0 20px 55px rgba(37, 32, 25, .13);
}

.table-footer {
  border-top: 0;
  background: transparent;
}

.page-button {
  border-radius: 3px;
}

.page-button.active {
  border-color: #1b1c20;
  background: #1b1c20;
  color: #fff;
}

.modal {
  border-radius: 6px;
  background: #f8f5ef;
}

.modal-head,
.modal-foot {
  border-color: var(--editorial-line);
}

.detail-block {
  border-radius: 3px;
  background: rgba(255, 255, 255, .58);
}

@media (max-width: 1200px) {
  .content,
  .records-content {
    padding: 24px 24px 40px;
  }

  .dashboard-grid,
  .bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .platform-card {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
  }

  .platform-card .card-head {
    grid-column: 1 / -1;
  }

  .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-search {
    grid-column: span 3;
  }
}

@media (max-width: 820px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card:nth-child(2) {
    border-right: 0;
  }

  .metric-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--editorial-line);
  }

  .page-heading {
    align-items: stretch;
  }

  .heading-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body[data-page="dashboard"] .heading-actions .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .silk-ribbon-one {
    right: -65%;
    top: -12%;
  }

  .silk-ribbon-two {
    left: -65%;
    bottom: -8%;
  }

  .silk-ribbon-three {
    display: none;
  }

  .content,
  .records-content {
    padding: 20px 16px 32px;
  }

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

  .metric-card,
  .metric-card:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--editorial-line);
  }

  .metric-card:last-child {
    border-bottom: 0;
  }

  .platform-card {
    display: block;
  }

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

  .filter-search,
  .filter-actions {
    grid-column: 1 / -1;
  }

  .dashboard-custom-range {
    right: auto;
    left: 0;
    width: min(310px, calc(100vw - 32px));
  }

  .source-performance-head {
    display: none;
  }

  .source-performance-row {
    grid-template-columns: 34px minmax(130px, 1fr) 58px;
    gap: 10px;
    padding: 10px 0;
  }

  .source-share {
    grid-column: 2 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .editorial-motion *,
  .login-form-wrap {
    animation: none !important;
    transform: none !important;
  }
}
