/* Desktop UI normalization for GrowSiteX Enterprise. */
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --line: #d6dde8;
  --line-soft: #e7ecf3;
  --primary: #1f66d1;
  --primary-weak: #e8f1ff;
  --success: #0f9f6e;
  --warning: #b7791f;
  --danger: #c2413b;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --radius: 8px;
  --sidebar: #f7f9fc;
  --desktop-font: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #b7c2d1 transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--desktop-font);
  font-size: 14px;
}

.app-shell,
.app-shell.sidebar-collapsed {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--bg);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 14px 12px;
  overflow: hidden auto;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  box-shadow: none;
}

.brand {
  min-height: 54px;
  margin: 0 0 8px;
  padding: 7px 6px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.brand-logo-shell {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand-logo {
  width: 28px;
  height: 28px;
  filter: none;
}

.brand-copy strong {
  color: #101828;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 700;
}

.brand-copy span {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
}

.collapse-menu {
  height: 30px;
  min-width: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #475467;
  box-shadow: none;
}

.collapse-menu:hover {
  background: #f2f6fb;
  color: #111827;
}

.nav {
  display: grid;
  gap: 1px;
  padding-top: 1px;
  align-content: start;
  grid-auto-rows: max-content;
}

.nav-group {
  display: grid;
  gap: 0;
}

.nav-group.open .subnav {
  display: grid;
  gap: 0;
}

.nav button,
.nav-parent,
.subnav button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 7px;
  color: #384252;
  background: transparent;
  text-align: left;
  font-weight: 600;
}

.sidebar .nav > button,
.sidebar .nav .nav-parent {
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  line-height: 1;
}

.app-shell.sidebar-collapsed .sidebar .nav > button,
.app-shell.sidebar-collapsed .sidebar .nav .nav-parent {
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.sidebar .subnav button {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  line-height: 1;
}

.nav button:hover,
.nav-parent:hover,
.subnav button:hover {
  color: #101828;
  background: #eef3f8;
}

.nav button.active,
.nav-parent.active,
.subnav button.active {
  color: #174ea6;
  background: var(--primary-weak);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  color: inherit;
}

.nav-icon svg,
.btn svg,
.home-quick-icon svg,
.home-metric-icon svg,
.home-summary-icon svg,
.home-effect-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.9;
}

.subnav {
  margin: 0 0 2px 18px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.subnav button {
  min-height: 32px;
  color: #5d6675;
  font-size: 13px;
  font-weight: 500;
}

.submark {
  color: #8a96a8;
}

.collapse-menu {
  margin-top: 10px;
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  justify-content: center;
  gap: 8px;
}

.app-shell.sidebar-collapsed .sidebar .collapse-menu {
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.app-shell.sidebar-collapsed .sidebar {
  padding-left: 10px;
  padding-right: 10px;
}

.app-shell.sidebar-collapsed .brand {
  grid-template-columns: 1fr;
  justify-items: center;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav button > span:not(.nav-icon):not(.nav-arrow),
.app-shell.sidebar-collapsed .subnav,
.app-shell.sidebar-collapsed .collapse-menu span {
  display: none;
}

.app-shell.sidebar-collapsed .nav button,
.app-shell.sidebar-collapsed .nav-parent,
.app-shell.sidebar-collapsed .collapse-menu {
  justify-content: center;
  padding: 0;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.topbar h2 {
  margin: 0;
  color: #101828;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 700;
}

.page-heading p {
  margin: 4px 0 0;
  max-width: 960px;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.admin-console-link,
.profile-trigger,
.profile-chip {
  height: 34px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #344054;
  box-shadow: none;
}

.admin-console-link {
  padding: 0 8px;
}

.profile-trigger {
  padding: 0 2px;
}

.admin-console-link:hover,
.profile-trigger:hover,
.profile-chip:hover {
  background: rgba(52, 64, 84, 0.06);
  border-color: transparent;
  box-shadow: none;
}

.avatar {
  width: 26px;
  height: 26px;
  background: transparent;
  border: 0;
  color: #0f7a56;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.chevron {
  width: 16px;
  height: 16px;
  color: #667085;
}

.profile-dropdown {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(16, 24, 40, 0.14);
}

.content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px 20px 26px;
}

.panel,
.dashboard-card,
.summary-card,
.home-metric-card,
.home-summary-card,
.home-effect-card,
.publish-kpi-card,
.seo-kpi-card,
.account-card,
.enterprise-card,
.home-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  overflow: hidden;
}

.panel-head,
.home-panel-head,
.publish-plan-section-head,
.seo-title-table-head,
.seo-table-panel .panel-head {
  min-height: 48px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h3,
.home-panel-head h3,
.publish-plan-section-head h3,
.seo-table-head h3 {
  margin: 0;
  color: #172033;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 700;
}

.panel-body,
.home-panel-body {
  padding: 15px 16px;
}

.home-page,
.enterprise-page,
.materials-page,
.publish-page,
.publish-plan-page,
.publish-account-page,
.seo-title-page,
.seo-article-page,
.prompt-lab-page {
  display: grid;
  gap: 12px;
}

.home-metrics,
.dashboard-metrics,
.publish-plan-kpi-grid,
.seo-keyword-kpi-grid,
.seo-article-kpi-grid,
.home-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-metric-card,
.publish-kpi-card,
.seo-kpi-card {
  min-height: 96px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.home-metric-main span,
.publish-kpi-card p,
.seo-kpi-card p,
.home-summary-card p,
.home-package-stats span,
.home-token-stat span {
  color: #667085;
  font-size: 12px;
}

.home-metric-main strong,
.publish-kpi-card strong,
.seo-kpi-card strong,
.home-summary-card strong,
.home-package-stats strong,
.home-token-stat strong {
  color: #101828;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 750;
}

.home-metric-icon,
.home-summary-icon,
.home-effect-icon,
.home-quick-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e8f1ff;
  color: var(--primary);
}

.home-metric-icon.green,
.home-effect-card.green .home-effect-icon,
.home-quick-icon.green {
  background: #e9f8f2;
  color: var(--success);
}

.home-metric-icon.orange,
.home-metric-icon.yellow,
.home-effect-card.cyan .home-effect-icon {
  background: #fff4df;
  color: var(--warning);
}

.home-metric-icon.purple,
.home-effect-card.purple .home-effect-icon,
.home-quick-icon.purple {
  background: #f0edff;
  color: #6750c7;
}

.home-main-grid,
.home-bottom-grid,
.split,
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 0.85fr);
  gap: 12px;
  align-items: start;
}

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

.home-package-body,
.home-effect-grid {
  padding: 15px 16px;
}

.home-effect-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.home-effect-card {
  min-height: 102px;
  padding: 13px;
  box-shadow: none;
}

.home-effect-card strong {
  display: block;
  margin-top: 10px;
  color: #101828;
  font-size: 21px;
}

.home-effect-card p,
.home-effect-card em {
  color: #667085;
}

.home-trend-chart {
  min-height: 260px;
}

.home-recent-list,
.home-quick-panel .home-panel-body {
  display: grid;
  gap: 8px;
}

.home-recent-item,
.home-quick-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}

.home-quick-item {
  min-height: 62px;
  padding: 12px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 11px;
  text-align: left;
}

.home-quick-item:hover,
.home-recent-item:hover {
  border-color: #b9c6d8;
  background: #f8fbff;
}

.btn,
.auth-submit,
.confirm-btn,
.home-more-btn,
.seo-action-btn,
.publish-link-btn,
.pager-btn {
  min-height: 32px;
  border-radius: 7px;
  font-weight: 600;
}

.btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #344054;
  box-shadow: none;
}

.btn:hover {
  border-color: #b9c6d8;
  background: #f7f9fc;
}

.btn.primary,
.auth-submit,
.confirm-btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.btn.primary:hover,
.auth-submit:hover,
.confirm-btn.primary:hover {
  background: #1857b7;
}

.btn.ghost {
  background: transparent;
}

.input,
.select,
.textarea {
  min-height: 34px;
  border: 1px solid #cfd8e6;
  border-radius: 7px;
  background: #ffffff;
  color: #172033;
  box-shadow: none;
}

.textarea {
  line-height: 1.55;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid rgba(31, 102, 209, 0.16);
  border-color: var(--primary);
}

.form-grid,
.publish-content-filter-grid,
.publish-plan-filter-grid,
.seo-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.field span,
.seo-filter-item span {
  margin-bottom: 5px;
  color: #526074;
  font-size: 12px;
  font-weight: 650;
}

.field.full,
.publish-content-filter-actions,
.publish-plan-filter-actions {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: #243247;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fc;
  color: #526074;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

th,
td,
.seo-keyword-table-wrap th,
.seo-keyword-table-wrap td,
.seo-title-table-wrap th,
.seo-title-table-wrap td,
.seo-article-table th,
.seo-article-table td,
.publish-table th,
.publish-table td,
.publish-plan-table th,
.publish-plan-table td,
.publish-account-table th,
.publish-account-table td,
.materials-table th,
.materials-table td,
.account-logs-table th,
.account-logs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

tbody tr:hover td {
  background: #f8fbff;
}

.tag,
.seo-status,
.seo-article-status,
.publish-status,
.publish-plan-status,
.materials-status,
.home-status {
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
}

.seo-status.enabled,
.seo-article-status.success,
.publish-status.success,
.publish-plan-status.running,
.materials-status.enabled,
.home-status.success,
.tag.success {
  background: #e8f7f1;
  border-color: #b9ead8;
  color: #137a5c;
}

.seo-article-status.warning,
.publish-status.warning,
.home-status.warning,
.tag.warning {
  background: #fff4df;
  border-color: #f4d69b;
  color: #99620f;
}

.seo-status.disabled,
.seo-article-status.danger,
.publish-status.danger,
.materials-status.disabled,
.home-status.danger,
.tag.danger {
  background: #fdeceb;
  border-color: #f5bebb;
  color: #a3342f;
}

.seo-article-status.muted,
.publish-status.muted,
.home-status.muted {
  background: #eef2f7;
  border-color: #d9e1ec;
  color: #526074;
}

.seo-table-footer,
.publish-footer,
.publish-pager-wrap,
.materials-pager-wrap,
.publish-account-footer {
  padding: 11px 16px;
  border-top: 1px solid var(--line-soft);
  background: #fbfcfe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pager-btn {
  min-width: 32px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #344054;
}

.pager-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.modal,
.confirm-modal,
.publish-plan-modal,
.publish-account-modal,
.seo-article-generate-modal {
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.2);
}

.modal-head,
.confirm-head {
  min-height: 52px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfe;
}

.modal-body,
.confirm-body {
  background: #ffffff;
}

.enterprise-status-bar {
  padding: 13px 16px;
}

.enterprise-status-line {
  gap: 10px;
}

.empty,
.empty-state {
  color: #667085;
}

.toast {
  border-radius: 8px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.16);
}

.auth-page {
  background: #f3f5f8;
}

.auth-card {
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 22px 54px rgba(16, 24, 40, 0.14);
}

.auth-side {
  background: #f7f9fc;
  color: #101828;
  border-right: 1px solid var(--line);
}

.auth-side::before,
.auth-side::after {
  display: none;
}

.auth-side p {
  color: #667085;
}

.auth-logo-row strong,
.auth-side h1 {
  color: #101828;
}

@media (max-width: 1280px) {
  .home-metrics,
  .dashboard-metrics,
  .publish-plan-kpi-grid,
  .seo-keyword-kpi-grid,
  .seo-article-kpi-grid,
  .home-summary-grid,
  .home-effect-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .form-grid,
  .publish-content-filter-grid,
  .publish-plan-filter-grid,
  .seo-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .topbar {
    position: relative;
    padding: 14px;
    align-items: flex-start;
  }

  .content {
    padding: 14px;
  }

  .home-metrics,
  .dashboard-metrics,
  .publish-plan-kpi-grid,
  .seo-keyword-kpi-grid,
  .seo-article-kpi-grid,
  .home-summary-grid,
  .home-effect-grid,
  .form-grid,
  .publish-content-filter-grid,
  .publish-plan-filter-grid,
  .seo-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
