@font-face {
  font-family: "MiSans";
  src: url("https://assets-persist.lovart.ai/agent-static-assets/MiSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "MiSans";
  src: url("https://assets-persist.lovart.ai/agent-static-assets/MiSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: "MiSans";
  src: url("https://assets-persist.lovart.ai/agent-static-assets/MiSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --primary: #fb7299;
  --primary-strong: #ff0000;
  --primary-soft: #ffebee;
  --secondary: #00aeec;
  --success: #00c853;
  --warning: #ffb300;
  --danger: #d32f2f;
  --text-main: #18191c;
  --text-secondary: #61666d;
  --text-tertiary: #9499a0;
  --bg-body: #f4f5f7;
  --bg-card: #ffffff;
  --bg-muted: #f6f7f9;
  --border: #e3e5e7;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --sidebar-width: 250px;
  --topbar-height: 60px;
  --rail-width: 60px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "MiSans", "Noto Sans", "Segoe UI", sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
}

body[data-page="login"] {
  background: linear-gradient(135deg, #f7f7fb 0%, #f3f5f8 45%, #fdf0f5 100%);
}

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

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.logo-area {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.logo-area i {
  font-size: 26px;
  color: var(--primary);
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
}

.nav-menu {
  padding: 16px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-item i {
  font-size: 20px;
}

.nav-item:hover {
  background: #f1f2f3;
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.nav-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

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

.nav-meta {
  width: 100%;
  display: grid;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.nav-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-meta-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-meta-value {
  color: var(--text-secondary);
}

.nav-footer .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.topbar {
  position: fixed;
  left: var(--sidebar-width);
  right: var(--rail-width);
  top: 0;
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  z-index: 90;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-muted);
  padding: 8px 16px;
  border-radius: 20px;
  width: 360px;
}

.search-bar input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  color: var(--text-main);
}

.search-bar input:focus {
  outline: none;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-toggle {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lang-toggle:hover {
  color: var(--text-main);
  background: #fff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-muted);
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.env-badge {
  padding: 4px 12px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.right-rail {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--rail-width);
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 90px;
  gap: 12px;
  z-index: 95;
}

.rail-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: #f7f8f9;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.rail-btn:hover {
  background: #eceef0;
  color: var(--primary-strong);
}

.rail-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 52px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.content {
  margin-left: var(--sidebar-width);
  margin-right: var(--rail-width);
  padding: 88px 32px 40px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 20px;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  margin: 12px 0 6px;
}

.kpi-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(24, 25, 28, 0.08);
  color: var(--text-secondary);
}

.platform-chip.platform-douyin {
  background: linear-gradient(135deg, rgba(20, 20, 24, 0.95), rgba(255, 45, 85, 0.85));
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 45, 85, 0.18);
}

.platform-chip.platform-tiktok {
  background: linear-gradient(135deg, rgba(20, 20, 24, 0.95), rgba(0, 240, 255, 0.85));
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 240, 255, 0.18);
}

.tag i {
  margin-right: 4px;
  font-size: 12px;
}

.tag.success {
  background: rgba(0, 200, 83, 0.12);
  color: var(--success);
}

.tag.warning {
  background: rgba(255, 179, 0, 0.15);
  color: var(--warning);
}

.tag.danger {
  background: rgba(211, 47, 47, 0.12);
  color: var(--danger);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.test-ref {
  font-size: 12px;
  color: var(--text-tertiary);
}

.test-detail {
  font-size: 12px;
  color: var(--text-secondary);
}

.split {
  display: grid;
  gap: 20px;
  grid-template-columns: 2fr 1fr;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fafbfc;
}

.list-item strong {
  font-size: 14px;
}

.list-item span {
  font-size: 12px;
  color: var(--text-tertiary);
}

.empty-state {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 6px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  background: var(--bg-card);
  color: var(--text-main);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-outline {
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.form-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-input,
.form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.form-input:disabled,
.form-select:disabled {
  background: #f2f3f5;
  color: var(--text-tertiary);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.table-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  text-align: left;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

tr:hover td {
  background: #fafbfc;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.status-badge.active {
  background: rgba(0, 200, 83, 0.12);
  color: var(--success);
}

.status-badge.banned {
  background: rgba(211, 47, 47, 0.12);
  color: var(--danger);
}

.status-badge.paused {
  background: rgba(255, 179, 0, 0.15);
  color: var(--warning);
}

.status-badge.registered {
  background: rgba(0, 174, 236, 0.15);
  color: var(--secondary);
}

.status-badge.new {
  background: rgba(251, 114, 153, 0.15);
  color: var(--primary-strong);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.catalog-url {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.code-highlight {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  padding: 0 4px;
  border-radius: 4px;
}

.console {
  background: #1f2937;
  color: #e5e7eb;
  padding: 14px;
  border-radius: var(--radius-md);
  font-family: "SFMono-Regular", ui-monospace, monospace;
  font-size: 12px;
  min-height: 120px;
  white-space: pre-wrap;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 200;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 210;
  padding: 24px;
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.drawer-title {
  font-size: 18px;
  font-weight: 700;
}

.toast-container {
  position: fixed;
  top: 80px;
  right: 90px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 300;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-main);
}

.section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.login-panel {
  width: min(980px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
}

.login-visual {
  padding: 48px;
  background: linear-gradient(160deg, #fff 0%, #fff4f8 40%, #f2f9ff 100%);
  position: relative;
}

.login-visual::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(251, 114, 153, 0.15);
  right: -60px;
  top: 30px;
}

.login-visual::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 40px;
  background: rgba(0, 174, 236, 0.12);
  left: -40px;
  bottom: 40px;
  transform: rotate(12deg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.login-brand i {
  font-size: 32px;
  color: var(--primary);
}

.login-brand span {
  font-size: 20px;
  font-weight: 700;
}

.login-visual h1 {
  margin-top: 30px;
  font-size: 28px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.login-visual p {
  margin-top: 10px;
  color: var(--text-secondary);
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.login-metrics {
  margin-top: 32px;
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.login-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
}

.login-form {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form h2 {
  font-size: 22px;
  font-weight: 700;
}

.login-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  background: var(--bg-muted);
  padding: 10px 12px;
  border-radius: 10px;
}

.login-error {
  font-size: 13px;
  color: var(--danger);
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.login-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-tertiary);
}

@media (max-width: 900px) {
  .login-panel {
    grid-template-columns: 1fr;
  }

  .login-visual {
    padding: 32px;
  }
}

@media (max-width: 1200px) {
  .topbar {
    right: 0;
  }

  .right-rail {
    display: none;
  }

  .content {
    margin-right: 0;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .topbar {
    position: static;
    left: 0;
    right: 0;
  }

  .content {
    margin: 0;
    padding: 24px;
  }

  .search-bar {
    width: 100%;
  }
}
