:root {
  --ink: #151b24;
  --ink-soft: #37404d;
  --muted: #78808d;
  --canvas: #f3f0e9;
  --paper: #fffdf9;
  --line: #ded9cf;
  --line-soft: #ebe7df;
  --accent: #e7653f;
  --accent-dark: #bd4323;
  --accent-soft: #f8dfd5;
  --mint: #dcebe3;
  --green: #2f775a;
  --warning: #8a5316;
  --warning-bg: #fff3dd;
  --sidebar: #171c24;
  --sidebar-soft: #232a34;
  --shadow: 0 18px 55px rgba(34, 39, 49, 0.08);
  --radius: 22px;
  --font: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 4%, rgba(231, 101, 63, 0.08), transparent 26rem),
    var(--canvas);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 22px;
  color: #f9f8f5;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.045), transparent 38%),
    var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  padding: 0 7px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--accent);
  border-radius: 13px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 22px rgba(231, 101, 63, 0.28);
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  font-size: 14px;
  letter-spacing: 0.12em;
}

.brand-copy span {
  color: #9ea6b1;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.main-nav {
  margin-top: 46px;
  display: grid;
  gap: 7px;
}

.nav-label {
  margin: 0 0 8px 12px;
  color: #717b88;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: #aab2bc;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
}

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

.nav-item.active {
  color: #fff;
  background: var(--sidebar-soft);
  border-color: rgba(255, 255, 255, 0.07);
}

.nav-item.active svg {
  color: var(--accent);
}

.nav-item small {
  margin-left: auto;
  color: #68717d;
  font-size: 9px;
}

.nav-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(231, 101, 63, 0.12);
}

.nav-item:disabled {
  cursor: default;
  opacity: 0.76;
}

.sidebar-note {
  margin-top: auto;
  display: flex;
  gap: 11px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 15px;
}

.shield-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #8eb8a4;
  background: rgba(89, 164, 126, 0.12);
  border-radius: 9px;
}

.shield-icon svg {
  width: 16px;
  height: 16px;
}

.sidebar-note strong {
  display: block;
  color: #eef0f2;
  font-size: 11px;
}

.sidebar-note p {
  margin: 4px 0 0;
  color: #818b97;
  font-size: 10px;
  line-height: 1.55;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 0 8px;
  color: #6f7884;
  font-size: 9px;
}

.pulse {
  width: 6px;
  height: 6px;
  background: #65ad87;
  border-radius: 50%;
}

.main {
  min-width: 0;
  padding: 0 42px 22px;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(21, 27, 36, 0.08);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.breadcrumb i {
  color: #b7b0a4;
  font-style: normal;
}

.breadcrumb strong {
  color: var(--ink-soft);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.text-button,
.ghost-button,
.icon-button,
.dialog-close {
  border: 0;
  cursor: pointer;
}

.text-button {
  padding: 8px 10px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
}

.text-button:hover {
  color: var(--accent-dark);
}

.secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: #557060;
  background: rgba(74, 129, 99, 0.08);
  border: 1px solid rgba(74, 129, 99, 0.15);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.secure-pill span {
  width: 5px;
  height: 5px;
  background: #4e8f6d;
  border-radius: 50%;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 42px;
  padding: 42px 2px 31px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.hero h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(36px, 4vw, 59px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.lede {
  max-width: 630px;
  margin: 18px 0 0;
  color: #656b74;
  font-size: 12px;
  line-height: 1.85;
}

.price-ticket {
  position: relative;
  min-width: 168px;
  padding: 18px 20px 16px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 17px;
  box-shadow: 0 12px 32px rgba(42, 40, 35, 0.05);
}

.price-ticket::before,
.price-ticket::after {
  content: "";
  position: absolute;
  top: 55%;
  width: 12px;
  height: 12px;
  background: var(--canvas);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
}

.price-ticket::before {
  left: -7px;
}

.price-ticket::after {
  right: -7px;
}

.ticket-kicker {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ticket-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 7px;
}

.ticket-price small {
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
}

.ticket-price strong {
  font-family: "Avenir Next", sans-serif;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.ticket-price span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
}

.price-ticket p {
  margin: 10px 0 0;
  padding-top: 9px;
  color: #858078;
  border-top: 1px dashed var(--line);
  font-size: 8.5px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(285px, 0.71fr) minmax(0, 1.65fr);
  gap: 18px;
  align-items: start;
}

.control-panel,
.results-panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid rgba(21, 27, 36, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 22px;
}

.results-panel {
  min-height: 605px;
  padding: 22px 22px 17px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.panel-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.step-number {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.panel-hint,
.result-state {
  color: #8d877d;
  font-size: 9px;
}

.result-state {
  padding: 5px 9px;
  background: #f2eee7;
  border-radius: 999px;
}

.result-state.success {
  color: var(--green);
  background: var(--mint);
}

.result-state.error {
  color: #9c3523;
  background: #fbe2db;
}

.result-state.warning {
  color: var(--warning);
  background: var(--warning-bg);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.url-field {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #faf8f3;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.url-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(231, 101, 63, 0.1);
}

.url-field--batch {
  height: auto;
  min-height: 132px;
  align-items: flex-start;
  padding-top: 13px;
  padding-bottom: 13px;
}

.url-field--batch .link-icon {
  margin-top: 2px;
}

.link-icon svg,
.search-field svg {
  width: 17px;
  height: 17px;
  color: #938b80;
}

.url-field input,
.search-field input {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 11px;
}

.url-field textarea {
  min-width: 0;
  flex: 1;
  min-height: 108px;
  padding: 0;
  resize: vertical;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 10px;
  line-height: 1.7;
}

input::placeholder {
  color: #aaa49b;
}

.clear-input {
  width: 20px;
  height: 20px;
  padding: 0;
  color: #aaa49b;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.field-help {
  margin: 7px 0 19px;
  color: #9b958c;
  font-size: 9px;
  line-height: 1.5;
}

.field-help-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.field-help-row .field-help {
  flex: 1;
}

.text-button.compact {
  margin-top: 3px;
  padding: 3px 0 3px 8px;
  color: #9b6957;
  font-size: 8px;
  white-space: nowrap;
}

.link-preview {
  margin: -4px 0 17px;
  padding: 11px 12px;
  background: #f8f5ee;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.preview-head strong {
  font-size: 9px;
}

.preview-head span {
  color: #9b9489;
  font-size: 7.5px;
}

.link-preview ol {
  display: grid;
  gap: 5px;
  max-height: 153px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.link-preview li {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #615b53;
  font-size: 8px;
}

.preview-order {
  color: #aaa298;
  font-family: "Avenir Next", sans-serif;
  font-size: 7px;
}

.preview-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-more {
  padding-left: 23px;
  color: #9b9489;
  font-size: 7.5px;
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 35px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.platform-douyin {
  color: #9a3d2b;
  background: #fae7df;
}

.platform-xiaohongshu {
  color: #a12931;
  background: #ffe3e5;
}

.platform-unknown {
  color: #6d6860;
  background: #eee9df;
}

.option-card {
  margin-bottom: 17px;
  padding: 13px 14px;
  background: #f7f4ed;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch-row > span:first-child {
  display: grid;
  flex: 1;
  gap: 3px;
}

.switch-row strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.switch-row small {
  color: #928c83;
  font-size: 8.5px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 36px;
  height: 21px;
  flex: 0 0 auto;
  background: #c9c5bd;
  border-radius: 999px;
  transition: background 160ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
  transition: transform 160ms ease;
}

.switch-row input:checked + .switch {
  background: var(--accent);
}

.switch-row input:checked + .switch::after {
  transform: translateX(15px);
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.field-block {
  display: grid;
  gap: 7px;
}

.field-block .field-label {
  margin: 0;
}

.field-block select,
.money-field {
  height: 39px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: #faf8f3;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  font-size: 10px;
}

.field-block select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #817a70 50%),
    linear-gradient(135deg, #817a70 50%, transparent 50%);
  background-position:
    calc(100% - 13px) 16px,
    calc(100% - 9px) 16px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.money-field {
  display: flex;
  align-items: center;
  gap: 5px;
}

.money-field span {
  color: var(--muted);
  font-size: 10px;
}

.money-field input {
  width: 100%;
  min-width: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 10px;
}

.field-block small {
  color: #99938a;
  font-size: 8px;
}

.estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 0 14px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

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

.estimate--three div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.estimate div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.estimate span {
  color: var(--muted);
  font-size: 8.5px;
}

.estimate strong {
  font-size: 10px;
}

.primary-button {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: transform 150ms ease, background 150ms ease;
}

.primary-button:hover {
  background: #222b37;
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.form-status {
  min-height: 15px;
  margin: 8px 0 0;
  color: #a24833;
  font-size: 9px;
  line-height: 1.5;
}

.privacy-note {
  display: flex;
  gap: 8px;
  margin-top: 13px;
  padding-top: 13px;
  color: #9a948a;
  border-top: 1px solid var(--line-soft);
}

.privacy-note span {
  color: var(--accent);
  font-size: 12px;
}

.privacy-note p {
  margin: 0;
  font-size: 8.2px;
  line-height: 1.65;
}

.empty-state,
.loading-state {
  min-height: 490px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state h3 {
  margin: 25px 0 7px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
}

.empty-state > p {
  max-width: 365px;
  margin: 0;
  color: #8e887e;
  font-size: 10px;
  line-height: 1.7;
}

.empty-visual {
  position: relative;
  width: 176px;
  height: 128px;
  display: grid;
  place-items: center;
}

.empty-window {
  position: relative;
  z-index: 2;
  width: 142px;
  height: 93px;
  padding: 13px;
  background: #fbf8f1;
  border: 1px solid #ded8cd;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(56, 50, 42, 0.09);
}

.empty-window > span {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 3px;
  background: #d6cec2;
  border-radius: 50%;
}

.empty-window > span:first-child {
  background: var(--accent);
}

.empty-lines {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.empty-lines i {
  display: block;
  width: 100%;
  height: 6px;
  background: #e9e2d7;
  border-radius: 999px;
}

.empty-lines i:nth-child(2) {
  width: 80%;
}

.empty-lines i:nth-child(3) {
  width: 91%;
}

.empty-lines i:nth-child(4) {
  width: 57%;
}

.empty-orbit {
  position: absolute;
  border: 1px solid #ddd6ca;
  border-radius: 50%;
}

.orbit-one {
  width: 170px;
  height: 92px;
  transform: rotate(-16deg);
}

.orbit-two {
  width: 142px;
  height: 124px;
  transform: rotate(24deg);
  border-style: dashed;
}

.empty-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 21px;
}

.empty-tags span {
  padding: 5px 8px;
  color: #817a70;
  background: #f5f1e9;
  border: 1px solid #e7e0d5;
  border-radius: 999px;
  font-size: 8px;
}

.loading-state strong {
  margin-top: 20px;
  font-size: 14px;
}

.loading-state p {
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 9.5px;
}

.loader {
  width: 45px;
  height: 45px;
  border: 2px solid #e3ddd3;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-track {
  width: 175px;
  height: 2px;
  overflow: hidden;
  background: #e8e1d6;
  border-radius: 99px;
}

.loading-track span {
  display: block;
  width: 42%;
  height: 100%;
  background: var(--accent);
  animation: load 1.2s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes load {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(340%);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 13px;
}

.stats-grid article {
  padding: 12px 13px;
  background: #f7f4ed;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.stats-grid span {
  display: block;
  color: #918b81;
  font-size: 8px;
}

.stats-grid strong {
  display: block;
  margin-top: 5px;
  font-family: "Avenir Next", sans-serif;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stats-grid .cost-stat {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.stats-grid .cost-stat span {
  color: #aab1b9;
}

.stats-grid .cost-stat strong {
  color: #fff;
}

.warning-box {
  margin-bottom: 12px;
  padding: 10px 12px;
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid #f0dfbd;
  border-radius: 10px;
  font-size: 9px;
  line-height: 1.55;
}

.warning-box p {
  margin: 0;
}

.warning-box p + p {
  margin-top: 4px;
}

.result-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.toolbar-page-size {
  flex: 0 0 auto;
}

.search-field {
  min-width: 160px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  padding: 0 10px;
  background: #faf8f3;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.search-field svg {
  width: 14px;
  height: 14px;
}

.search-field input {
  font-size: 9px;
}

.result-toolbar select {
  height: 34px;
  padding: 0 25px 0 10px;
  color: var(--ink-soft);
  background-color: #faf8f3;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  font-size: 9px;
}

.export-actions {
  display: flex;
  gap: 5px;
}

.ghost-button,
.icon-button {
  height: 34px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 8.5px;
  font-weight: 700;
}

.ghost-button:hover,
.icon-button:hover {
  color: var(--accent-dark);
  border-color: #d5a896;
}

.icon-button {
  width: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

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

.table-wrap {
  min-width: 0;
  max-height: 426px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.batch-groups {
  display: grid;
  gap: 14px;
}

.batch-group {
  overflow: hidden;
  background: #fffefa;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}

.batch-group-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px 11px;
  background:
    linear-gradient(90deg, rgba(231, 101, 63, 0.045), transparent 55%),
    #fbf8f2;
  border-bottom: 1px solid var(--line-soft);
}

.group-index {
  min-width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  font-family: "Avenir Next", sans-serif;
  font-size: 9px;
  font-weight: 700;
}

.group-identity {
  min-width: 0;
  flex: 1;
}

.group-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.group-source {
  overflow: hidden;
  color: #4a5665;
  font-size: 9px;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.group-source:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.group-meta {
  margin: 4px 0 0;
  color: #9a9389;
  font-size: 7.5px;
}

.group-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 700;
}

.group-status.success {
  color: var(--green);
  background: var(--mint);
}

.group-status.warning {
  color: var(--warning);
  background: var(--warning-bg);
}

.group-status.error {
  color: #9c3523;
  background: #fbe2db;
}

.group-warning {
  padding: 8px 14px;
  color: var(--warning);
  background: #fff9ee;
  border-bottom: 1px solid #f3e6ca;
  font-size: 8px;
  line-height: 1.55;
}

.group-warning p {
  margin: 0;
}

.group-warning p + p {
  margin-top: 3px;
}

.group-table-wrap {
  max-height: 390px;
  border: 0;
  border-radius: 0;
}

.group-empty {
  padding: 26px 18px;
  color: #948d82;
  font-size: 9px;
  text-align: center;
}

.group-error {
  color: #9c3523;
  background: #fff9f6;
}

.group-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #fcfaf5;
  border-top: 1px solid var(--line-soft);
}

.group-page-note {
  color: #948d82;
  font-size: 7.5px;
}

.comment-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9px;
}

.comment-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 9px;
  color: #817a71;
  background: #f4f0e8;
  border-bottom: 1px solid #e4ddd2;
  font-size: 7.5px;
  font-weight: 700;
  text-align: left;
}

.comment-table th:first-child,
.comment-table td:first-child {
  width: 34px;
  text-align: center;
}

.comment-table th:nth-child(3),
.comment-table td:nth-child(3) {
  width: 270px;
}

.comment-table td {
  padding: 11px 9px;
  color: #333b46;
  border-bottom: 1px solid #eee9e0;
  vertical-align: top;
  line-height: 1.5;
  word-break: break-word;
}

.comment-table tr:last-child td {
  border-bottom: 0;
}

.comment-table tbody tr:hover td {
  background: #fcfaf5;
}

.comment-table tr.reply-row td {
  background: #fcf9f3;
}

.comment-table tr.reply-row:hover td {
  background: #faf4ea;
}

.row-index {
  color: #aaa49a;
  font-size: 8px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  color: #6c655c;
  background: #f1ede5;
  border-radius: 999px;
  font-size: 7px;
  white-space: nowrap;
}

.type-badge.reply {
  color: #7c4a31;
  background: var(--accent-soft);
}

.type-badge.reply::before {
  content: "↳";
  font-size: 8px;
}

.comment-text {
  color: #2f3741;
  font-size: 9px;
  line-height: 1.65;
}

.comment-text.muted {
  color: #a39c91;
  font-style: italic;
}

.number-cell {
  color: #777068;
  text-align: center;
}

.root-badge {
  display: inline-block;
  padding: 3px 6px;
  color: #8b4a32;
  background: #f8e5db;
  border-radius: 6px;
  font-size: 7px;
  font-weight: 700;
}

.account-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-name {
  overflow: hidden;
  color: #2c3540;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.account-name:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.account-handle {
  overflow: hidden;
  color: #9b9489;
  font-size: 7.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-url {
  display: block;
  margin-top: 2px;
  color: #3f6f8f;
  font-size: 7.5px;
  line-height: 1.45;
  text-decoration: none;
  word-break: break-all;
}

.account-url:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-arrow {
  margin-left: 2px;
  color: var(--accent);
  font-size: 8px;
}

.muted {
  color: #a39c91;
  font-style: italic;
}

.accounts-section {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
}

.accounts-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  list-style: none;
}

.accounts-heading::-webkit-details-marker {
  display: none;
}

.accounts-heading::before {
  content: "＋";
  color: var(--accent);
  font-size: 11px;
}

.accounts-section[open] .accounts-heading::before {
  content: "－";
}

.accounts-heading span {
  margin-right: auto;
}

.accounts-heading small {
  color: #928c83;
  font-size: 8px;
  font-weight: 400;
}

.account-table-wrap {
  max-height: 330px;
}

.account-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8.5px;
}

.account-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 8px;
  color: #817a71;
  background: #f4f0e8;
  border-bottom: 1px solid #e4ddd2;
  font-size: 7.5px;
  font-weight: 700;
  text-align: left;
}

.account-table td {
  padding: 9px 8px;
  color: #3b424c;
  border-bottom: 1px solid #eee9e0;
  line-height: 1.5;
  vertical-align: top;
  word-break: break-word;
}

.account-table tr:last-child td {
  border-bottom: 0;
}

.account-table tbody tr:hover td {
  background: #fcfaf5;
}

.account-table th:first-child,
.account-table td:first-child {
  width: 110px;
}

.account-table th:nth-child(2),
.account-table td:nth-child(2) {
  width: 88px;
}

.account-table th:nth-child(3),
.account-table td:nth-child(3),
.account-table th:nth-child(4),
.account-table td:nth-child(4),
.account-table th:nth-child(5),
.account-table td:nth-child(5),
.account-table th:nth-child(6),
.account-table td:nth-child(6),
.account-table th:nth-child(8),
.account-table td:nth-child(8) {
  width: 54px;
  text-align: right;
}

.account-table th:nth-child(7),
.account-table td:nth-child(7) {
  width: 250px;
}

.account-details {
  display: grid;
  gap: 3px;
  color: #746d64;
  font-size: 8px;
  line-height: 1.5;
}

.account-tags {
  color: #9a5b3f;
}

.table-empty {
  padding: 22px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.table-scroll-hint {
  display: none;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.page-size {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8b8479;
  font-size: 8px;
}

.page-size select {
  height: 28px;
  padding: 0 22px 0 8px;
  color: var(--ink-soft);
  background-color: #faf8f3;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 8px;
}

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

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-button,
.page-number {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  color: var(--ink-soft);
  background: #faf8f3;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 8px;
  font-weight: 700;
}

.page-button:hover:not(:disabled),
.page-number:hover {
  color: var(--accent-dark);
  border-color: #d5a896;
}

.page-button:disabled {
  opacity: 0.42;
}

.page-number.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.page-gap {
  padding: 0 2px;
  color: #a29b91;
  font-size: 9px;
}

.result-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 9px;
  color: #9a948a;
  font-size: 7.5px;
}

.history-panel {
  margin-top: 18px;
  padding: 23px;
  background: var(--paper);
  border: 1px solid rgba(21, 27, 36, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scroll-margin-top: 18px;
}

.history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.history-heading .eyebrow {
  margin-bottom: 7px;
}

.history-heading h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
}

.history-heading p:not(.eyebrow) {
  max-width: 620px;
  margin: 6px 0 0;
  color: #898278;
  font-size: 9px;
  line-height: 1.65;
}

.history-list {
  display: grid;
  gap: 7px;
}

.history-item {
  width: 100%;
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr) auto 82px;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fbf8f2;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease;
}

.history-item:hover {
  border-color: #d5a896;
  transform: translateY(-1px);
}

.history-date {
  color: #8f887d;
  font-family: "Avenir Next", sans-serif;
  font-size: 8px;
}

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

.history-main strong {
  font-size: 10px;
}

.history-main small {
  overflow: hidden;
  color: #9a9389;
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-platforms {
  display: flex;
  gap: 4px;
}

.history-action {
  color: var(--accent-dark);
  font-size: 8px;
  font-weight: 700;
  text-align: right;
}

.history-empty {
  padding: 26px;
  color: #9a9389;
  background: #faf7f1;
  border: 1px dashed var(--line);
  border-radius: 11px;
  font-size: 9px;
  text-align: center;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 3px 0;
  color: #a19a8f;
  font-size: 8px;
}

dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(21, 27, 36, 0.24);
}

dialog::backdrop {
  background: rgba(18, 22, 28, 0.56);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 15px;
  border-bottom: 1px solid var(--line-soft);
}

.dialog-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 24px;
}

.dialog-close {
  width: 32px;
  height: 32px;
  align-self: flex-start;
  color: var(--muted);
  background: #f1ede5;
  border-radius: 50%;
  font-size: 20px;
}

.dialog-body {
  padding: 20px 26px 26px;
}

.dialog-body > p {
  margin: 0 0 17px;
  color: #666159;
  font-size: 11px;
  line-height: 1.8;
}

.dialog-body dl {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line-soft);
}

.dialog-body dl div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.dialog-body dt {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.dialog-body dd {
  margin: 0;
  color: #777067;
  font-size: 10px;
  line-height: 1.6;
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .sidebar {
    padding: 24px 13px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand-copy,
  .nav-label,
  .nav-item span:not(.nav-dot),
  .nav-item small,
  .sidebar-note,
  .sidebar-foot {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-dot {
    position: absolute;
    margin: 0 0 15px 20px;
  }

  .main {
    padding: 0 28px 20px;
  }

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

  .hero {
    gap: 24px;
  }

  .history-item {
    grid-template-columns: 112px minmax(0, 1fr) auto;
  }

  .history-action {
    display: none;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 13px 18px;
  }

  .brand-copy {
    display: grid;
  }

  .main-nav {
    display: flex;
    margin: 0 0 0 auto;
  }

  .main-nav .nav-item {
    width: 40px;
    min-height: 40px;
  }

  .nav-item:not(:first-of-type) {
    display: none;
  }

  .main {
    padding: 0 18px 18px;
  }

  .hero {
    align-items: flex-start;
    padding-top: 31px;
  }

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

  .results-panel {
    min-height: 480px;
  }

  .empty-state,
  .loading-state {
    min-height: 370px;
  }

  .history-panel {
    padding: 19px;
  }

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

  .history-platforms {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero {
    display: block;
  }

  .price-ticket {
    width: 100%;
    margin-top: 20px;
  }

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

  .control-panel,
  .results-panel {
    padding: 17px;
    border-radius: 17px;
  }

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

  .estimate--three {
    grid-template-columns: 1fr;
  }

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

  .stats-grid .cost-stat {
    grid-column: span 2;
  }

  .result-toolbar {
    flex-wrap: wrap;
  }

  .search-field {
    flex-basis: 100%;
  }

  .export-actions {
    margin-left: auto;
  }

  .toolbar-page-size {
    margin-left: auto;
  }

  .pagination-bar {
    align-items: flex-start;
  }

  .page-nav {
    justify-content: flex-end;
  }

  .table-wrap {
    max-height: none;
  }

  .group-table-wrap {
    max-height: none;
  }

  .comment-table {
    min-width: 0;
  }

  .comment-table th:nth-child(1),
  .comment-table td:nth-child(1) {
    display: none;
  }

  .comment-table th:nth-child(3),
  .comment-table td:nth-child(3) {
    width: 132px;
  }

  .table-scroll-hint {
    display: block;
    margin: 7px 2px 0;
    color: #9a948a;
    font-size: 8px;
    text-align: right;
  }

  .topbar {
    height: 62px;
  }

  .secure-pill {
    display: none;
  }

  .history-heading {
    display: block;
  }

  .history-heading .ghost-button {
    margin-top: 12px;
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .history-date {
    order: 2;
  }

  .group-pagination {
    align-items: flex-start;
  }

  .group-pagination .page-nav {
    justify-content: flex-end;
  }
}

@media print {
  @page {
    size: A4;
    margin: 13mm;
  }

  html,
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .hero,
  .control-panel,
  .history-panel,
  .result-toolbar,
  .page-footer,
  dialog {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main {
    padding: 0;
  }

  .workspace {
    display: block;
  }

  .results-panel {
    min-height: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
  }

  .comment-table th,
  .account-table th {
    position: static;
  }

  .comment-table tr,
  .account-table tr {
    break-inside: avoid;
  }
}

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

/* SHENQAI account */
.workspace-link {
  padding: 8px 10px;
  color: var(--ink-soft);
  font-size: 11px;
  text-decoration: none;
}

.workspace-link:hover {
  color: var(--accent-dark);
}

.account-login {
  padding: 9px 14px;
  color: #fff;
  background: linear-gradient(135deg, #2d6bff 0%, #5a6bff 48%, #7c3aed 100%);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(45, 107, 255, 0.22);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
}

.account-login:hover {
  transform: translateY(-1px);
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 8px 5px 6px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(20, 20, 58, 0.05);
}

.account-chip[hidden],
.account-login[hidden] {
  display: none !important;
}

.account-avatar {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, #2d6bff, #7c3aed);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.account-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  max-width: 150px;
}

.account-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-balance {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: #254fa5;
  background: #eef3ff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  color: #5b6484;
  background: #f5f6fb;
  border-radius: 50%;
  font-size: 13px;
}

.account-icon:hover {
  color: #2d6bff;
  background: #eef2ff;
}

.option-grid--single {
  grid-template-columns: 1fr 1fr;
}

.billing-note p {
  min-height: 39px;
  margin: 0;
  padding: 9px 10px;
  color: #7a7d88;
  background: #faf8f3;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 8.5px;
  line-height: 1.55;
}

.login-hint {
  margin: 8px 0 0;
  color: #a15b2a;
  font-size: 9px;
}

.login-dialog-inner {
  padding-bottom: 22px;
}

.login-lead {
  margin: 16px 26px 0;
  color: #7a7d88;
  font-size: 10px;
  line-height: 1.7;
}

.login-tabs {
  display: flex;
  gap: 4px;
  margin: 16px 26px 14px;
  padding: 4px;
  background: #f2f4fb;
  border-radius: 12px;
}

.login-tabs button {
  flex: 1;
  padding: 9px;
  color: #7a7d99;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
}

.login-tabs button.on {
  color: #2d6bff;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 20, 58, 0.08);
}

.login-form {
  display: grid;
  gap: 12px;
  padding: 0 26px;
}

.login-form[hidden] {
  display: none;
}

.login-form label {
  display: grid;
  gap: 6px;
}

.login-form label span {
  color: #2a2a55;
  font-size: 10px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dfe3ef;
  border-radius: 10px;
  outline: none;
  font: inherit;
  font-size: 11px;
}

.login-form input:focus {
  border-color: #2d6bff;
  box-shadow: 0 0 0 3px rgba(45, 107, 255, 0.12);
}

.login-form .primary-button {
  margin-top: 2px;
}

.login-error {
  min-height: 16px;
  margin: 0;
  color: #d33;
  font-size: 9px;
}

.login-foot {
  margin: 16px 26px 0;
  color: #7a7d99;
  font-size: 9px;
  text-align: center;
}

.login-foot a {
  color: #2d6bff;
  text-decoration: none;
}

@media (max-width: 820px) {
  .topbar {
    height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .account-chip {
    order: 5;
    width: 100%;
  }

  .account-copy {
    max-width: none;
    flex: 1;
  }

  .option-grid--single {
    grid-template-columns: 1fr;
  }
}
