:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #7b8190;
  --line: #e8ebf0;
  --blue: #2b77ff;
  --blue-soft: #eaf2ff;
  --danger: #ef4444;
  --success: #16a34a;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --site-icon: url("/assets/mx_0430.png");
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button, input, textarea {
  font: inherit;
}

button {
  border: none;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 284px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fbfbfc;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px 18px;
  cursor: pointer;
}

.brand-logo,
.agent-icon,
.agent-mini-icon {
  display: grid;
  place-items: center;
  background-color: #000;
  background-image: var(--site-icon);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.brand-logo::before,
.agent-icon::before,
.agent-mini-icon::before {
  content: none;
}

.brand-logo span,
.agent-icon span,
.agent-mini-icon span {
  display: none;
}

.brand-logo span::after,
.agent-icon span::after,
.agent-mini-icon span::after {
  content: none;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: .2px;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid #f1f2f5;
  padding: 16px 0 0;
}

.nav-item {
  height: 46px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  color: #272a31;
  background: transparent;
  text-align: left;
  font-weight: 700;
  border-radius: 0;
  transition: .18s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.side-spacer { flex: 1; }

.side-card {
  margin: 0 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 25px rgba(15, 23, 42, .04);
}

.auth-card { background: linear-gradient(180deg, #fff, #f7fbff); }

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.user-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
}

.user-row img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef2ff;
}

.user-meta {
  min-width: 0;
}

.user-meta strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.user-meta span {
  display: inline-flex;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 11px;
  font-weight: 800;
}

.quota-line {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.quota-line strong { color: var(--blue); }

.main {
  min-width: 0;
  padding: 28px 30px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -.5px;
}

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

.search-box {
  width: 280px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
}

.primary,
.ghost,
.pill,
.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .18s ease;
  white-space: nowrap;
}

.primary {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(43, 119, 255, .18);
}

.primary:hover { transform: translateY(-1px); background: #1766ef; }
.primary:disabled { opacity: .62; cursor: not-allowed; transform: none; }

.ghost {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  background: #fff;
  color: var(--blue);
  border: 1px solid #cfe0ff;
  font-weight: 800;
}

.ghost:hover { background: #f4f8ff; }

.full { width: 100%; margin-top: 12px; }

.pill {
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #eff6ff;
  color: var(--blue);
}

.pill.danger { background: #eff6ff; color: var(--blue); }
.pill.danger:hover { background: #fee2e2; color: var(--danger); }

.mini {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.notice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  background: linear-gradient(90deg, #fff, #eef5ff);
  border: 1px solid #e3edff;
  border-radius: 20px;
  margin-bottom: 22px;
}

.notice-bar strong { display: block; margin-bottom: 4px; }
.notice-bar span { color: var(--muted); font-size: 14px; }

.agent-grid {
  max-width: 960px;
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 21px;
}

.agent-card {
  min-height: 154px;
  background: var(--panel);
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 21px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  transition: .18s ease;
}

.agent-card:hover {
  transform: translateY(-4px);
  border-color: #d9e7ff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .12);
}

.agent-card.locked {
  opacity: .72;
  background: linear-gradient(180deg, #fff, #f9fafb);
}

.agent-card.locked::after {
  content: "🔒";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff7ed;
  font-size: 13px;
}

.agent-icon {
  width: 57px;
  height: 57px;
  border-radius: 18px;
  margin-bottom: 16px;
}

.agent-icon.is-locked,
.agent-mini-icon.is-locked {
  filter: grayscale(1) brightness(.75);
}

.agent-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.agent-card p {
  min-height: 38px;
  margin: 8px 0 0;
  color: #8a8f99;
  font-weight: 600;
  line-height: 1.45;
  font-size: 14px;
}

.agent-card-meta {
  margin-top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 11px;
  font-weight: 900;
}

.card-badge.paid {
  background: #fff7ed;
  color: #c2410c;
}

.chat-view {
  height: calc(100vh - 115px);
  min-height: 560px;
  display: grid;
  grid-template-columns: 290px minmax(0, 850px);
  gap: 18px;
}

.conversation-panel,
.chat-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  min-height: 0;
}

.conversation-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3,
.chat-head h3 {
  margin: 0;
}

.conversation-list {
  overflow: auto;
  padding-right: 3px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.conversation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: stretch;
}

.conversation-item {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid transparent;
  text-align: left;
  color: var(--text);
}

.conversation-item:hover,
.conversation-row.active .conversation-item {
  background: #eef5ff;
  border-color: #cfe0ff;
}

.conversation-delete-btn {
  width: 34px;
  min-height: 100%;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.conversation-delete-btn:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}

.conversation-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.conversation-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.chat-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.agent-mini-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex: none;
}

.permission-pill {
  margin-left: auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 24px 22px;
  background:
    radial-gradient(circle at top left, rgba(43,119,255,.08), transparent 25%),
    linear-gradient(180deg, #fbfdff, #fff);
}

.empty-chat {
  height: 100%;
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-chat strong {
  display: block;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 18px;
}

.tool-view {
  max-width: 1040px;
}

.tool-agent-card {
  border-color: #dbeafe;
}

.tool-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tool-hero,
.tool-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.tool-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
}

.tool-hero-icon {
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #010617;
  color: #fff;
  font-size: 24px;
}

.tool-hero h3 {
  margin: 0;
  font-size: 22px;
}

.tool-hero p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.tool-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 18px;
}

.tool-panel {
  padding: 20px;
}

.tool-panel h3 {
  margin: 0 0 14px;
}

.tool-drop-zone {
  border: 2px dashed #dbe3ef;
  border-radius: 18px;
  padding: 30px;
  text-align: center;
  background: #f8fafc;
  transition: .18s ease;
}

.tool-drop-zone.is-dragover {
  border-color: var(--blue);
  background: #eef5ff;
}

.tool-drop-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.tool-drop-text {
  font-size: 15px;
  font-weight: 900;
}

.tool-drop-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 8px;
}

.tool-actions-bottom {
  margin-top: 14px;
}

.tool-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tool-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.tool-form-grid input {
  height: 42px;
  border: 1px solid #dbe3ef;
  border-radius: 13px;
  padding: 0 12px;
  outline: none;
}

.tool-form-grid input:focus {
  border-color: #9fc0ff;
}

.tool-form-grid small {
  color: var(--muted);
  font-weight: 600;
}

.tool-output-line {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #f8fafc;
  word-break: break-all;
}

.tool-output-line span,
.tool-status,
.tool-note,
.tool-preview-title {
  color: var(--muted);
  font-size: 13px;
}

.tool-output-line span {
  display: block;
  margin-bottom: 4px;
  font-weight: 800;
}

.tool-output-line strong {
  font-size: 14px;
}

.tool-progress {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.tool-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(135deg, var(--blue), #1766ef);
  transition: width .18s ease;
}

.tool-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.tool-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.tool-summary-item {
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #f8fafc;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.tool-summary-item strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 15px;
}

.tool-preview {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #f8fafc;
}

.tool-preview pre {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.tool-note {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8fafc;
}

.message {
  display: flex;
  margin-bottom: 18px;
}

.message.user { justify-content: flex-end; }
.message.assistant { justify-content: flex-start; }

.bubble {
  max-width: min(720px, 82%);
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.72;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.message.user .bubble {
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.message.assistant .bubble {
  background: #fff;
  color: #111827;
  border: 1px solid #edf0f5;
  border-bottom-left-radius: 5px;
}

.message-meta {
  margin-bottom: 6px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.composer {
  padding: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: #fff;
}

.composer textarea {
  flex: 1;
  max-height: 140px;
  min-height: 48px;
  resize: none;
  outline: none;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  padding: 13px 15px;
  line-height: 1.5;
  background: #f8fafc;
}

.composer textarea:focus {
  border-color: #9fc0ff;
  background: #fff;
}

.send { min-width: 86px; height: 48px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(6px);
}

.modal {
  width: min(440px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .25);
  position: relative;
}

.wide-modal { width: min(920px, 100%); }

.upgrade-modal-card {
  width: min(430px, 100%);
  text-align: center;
}

.upgrade-qr-card {
  width: 240px;
  height: 240px;
  margin: 22px auto 12px;
  padding: 12px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
}

.upgrade-qr-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.upgrade-tip {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 20px;
}

.modal-title h2 { margin: 0 0 8px; }
.modal-title span { color: var(--muted); font-size: 14px; line-height: 1.5; }

.tabbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 22px 0 16px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 999px;
}

.tab {
  height: 38px;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-weight: 900;
}

.tab.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 5px 16px rgba(15, 23, 42, .08);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  height: 44px;
  border: 1px solid #dbe3ef;
  border-radius: 13px;
  padding: 0 13px;
  outline: none;
}

.auth-form input:focus { border-color: #9fc0ff; }

.demo-box,
.security-note {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 13px;
}

.demo-box strong,
.security-note strong { color: var(--text); }
.demo-box p,
.security-note p { margin: 6px 0 0; line-height: 1.55; }

.profile-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.profile-stat {
  padding: 14px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.profile-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tier-card {
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 270px;
}

.tier-card.current {
  border-color: #9fc0ff;
  background: linear-gradient(180deg, #f8fbff, #fff);
  box-shadow: 0 10px 28px rgba(43, 119, 255, .11);
}

.tier-card h3 { margin: 0; }
.tier-card .price { margin: 8px 0 10px; color: var(--blue); font-size: 22px; font-weight: 900; }
.tier-card p { margin: 0 0 12px; color: var(--muted); line-height: 1.5; font-size: 13px; }
.tier-card ul { margin: 0 0 16px; padding-left: 18px; color: #475569; line-height: 1.8; font-size: 13px; }
.tier-card button { margin-top: auto; }

.user-center-page {
  position: fixed;
  inset: 0;
  z-index: 45;
  padding: 10px;
  background: #eef1f7;
  overflow: auto;
}

.user-center-card {
  min-height: calc(100vh - 20px);
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e6eaf1;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
}

.uc-header {
  height: 98px;
  padding: 0 26px 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e7eaf0;
}

.uc-header h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -.3px;
}

.uc-return {
  height: 52px;
  padding: 0 20px;
  border: 2px solid #4c8cff;
  font-size: 17px;
}

.uc-layout {
  min-height: calc(100vh - 118px);
  display: grid;
  grid-template-columns: 264px 1fr;
}

.uc-sidebar {
  padding: 20px 16px;
  border-right: 1px solid #e7eaf0;
  background: #fbfcfe;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uc-nav-item {
  height: 56px;
  padding: 0 16px;
  border-radius: 12px;
  background: transparent;
  color: #374151;
  text-align: left;
  font-size: 18px;
  font-weight: 900;
}

.uc-nav-item:hover,
.uc-nav-item.active {
  color: #0b5fc4;
  background: #ddebff;
  box-shadow: inset 0 0 0 1px #acd0ff;
}

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

.uc-panel h3 {
  margin: 0 0 12px;
  color: #4b5563;
  font-size: 20px;
}

.uc-search-row {
  display: grid;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
}

.copy-search-row { grid-template-columns: minmax(220px, 1fr) minmax(220px, .72fr) 72px; }
.ip-search-row { grid-template-columns: minmax(280px, 1fr) 72px 124px; max-width: 990px; }

.uc-search-row input,
.uc-pagination select,
.ip-profile-form input,
.ip-profile-form textarea {
  border: 1px solid #d7dde6;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: #111827;
}

.uc-search-row input {
  height: 46px;
  padding: 0 14px;
  font-size: 18px;
  font-weight: 700;
}

.uc-search-row input:focus,
.ip-profile-form input:focus,
.ip-profile-form textarea:focus {
  border-color: #8fc5ff;
  box-shadow: 0 0 0 3px rgba(43, 119, 255, .12);
}

.primary.square {
  min-height: 46px;
  border-radius: 10px;
  padding: 0 16px;
}

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

.uc-empty {
  min-height: 140px;
  display: grid;
  place-items: center;
  color: #8a94a6;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.copy-card,
.ip-profile-card,
.credit-record {
  width: 100%;
  border: 1px solid #e4e8ef;
  border-radius: 16px;
  background: #fff;
  text-align: left;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.copy-card,
.ip-profile-card {
  padding: 16px 18px;
}

.copy-card-head,
.ip-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.copy-card h4,
.ip-profile-card h4 {
  margin: 0;
  font-size: 18px;
}

.copy-card p,
.ip-profile-card p {
  margin: 10px 0 0;
  color: #64748b;
  line-height: 1.65;
}

.copy-meta,
.ip-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #8a94a6;
  font-size: 13px;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #2b77ff;
  font-size: 12px;
  font-weight: 900;
}

.active-ip-tag {
  background: #dcfce7;
  color: #047857;
  align-self: center;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.card-actions .mini {
  background: #f3f6fb;
  color: #475569;
}

.card-actions .mini.primary-lite {
  background: #edf4ff;
  color: var(--blue);
}

.uc-pagination {
  height: 66px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #edf0f4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: #4b5563;
  font-size: 17px;
}

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

.uc-pagination select {
  height: 38px;
  padding: 0 10px;
  font-weight: 800;
}

.page-btn {
  min-height: 42px;
  border-color: #edf0f4;
  color: #9aa3b2;
}
.page-btn:disabled { opacity: .55; cursor: not-allowed; }

.account-info-card {
  max-width: 980px;
  border: 1px solid #dfe3ea;
  border-radius: 14px;
  padding: 26px 22px;
}

.account-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px dashed #e5e7eb;
  font-size: 18px;
}

.account-row:last-child { border-bottom: none; }
.account-row span { color: #5b6472; font-weight: 800; }
.account-row strong { font-weight: 500; }

.account-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #eaf2ff;
  object-fit: cover;
}

.detail-link-btn {
  min-height: 36px;
  width: max-content;
  border-radius: 999px;
  padding: 0 16px;
  border: 2px solid #3b82f6;
  background: #fff;
  color: #1d72f3;
  font-weight: 900;
}

.credit-detail-page {
  min-height: calc(100vh - 118px);
  padding: 22px 38px;
}

.credit-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.credit-tab {
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d7dde6;
  color: #4b5563;
  font-size: 17px;
  font-weight: 900;
}

.credit-tab.active {
  color: #0b5fc4;
  background: #e9f3ff;
  border-color: #b7d8ff;
}

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

.credit-record {
  min-height: 112px;
  padding: 18px 20px;
  position: relative;
}

.credit-record h4 {
  margin: 0 150px 10px 0;
  font-size: 20px;
}

.credit-time {
  position: absolute;
  right: 20px;
  top: 18px;
  color: #8a94a6;
  font-weight: 700;
}

.credit-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ffeaf0;
  color: #d7335d;
  font-weight: 900;
}

.credit-badge.recharge {
  background: #e8fff3;
  color: #047857;
}

.credit-values {
  margin-top: 12px;
  display: flex;
  gap: 22px;
  font-size: 17px;
  font-weight: 900;
}

.credit-values .negative { color: #d7335d; }
.credit-values .positive { color: #047857; }
.credit-values .balance { color: #22695c; }

.ip-profile-modal-card {
  width: min(1180px, calc(100vw - 32px));
  max-height: min(92vh, 840px);
}

.ip-profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ip-profile-form h2 {
  margin: 0;
  font-size: 22px;
}

.ip-profile-form label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: #4b5563;
  font-size: 16px;
  font-weight: 800;
}

.ip-profile-form input {
  height: 52px;
  padding: 0 16px;
  font-size: 18px;
  font-weight: 700;
}

.ip-profile-form textarea {
  min-height: 390px;
  resize: vertical;
  padding: 16px;
  line-height: 1.7;
  font-size: 16px;
}

.insert-template-btn {
  width: max-content;
  height: 46px;
  border-radius: 10px;
  background: #eef1f5;
  color: #4b5563;
  font-size: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
}

.detail-modal-card {
  width: min(860px, calc(100vw - 32px));
}

.detail-modal-card h2 {
  margin: 0 42px 12px 0;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.detail-meta span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.detail-body {
  max-height: 58vh;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.75;
  color: #111827;
}

.admin-modal {
  width: min(1120px, 100%);
}

.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 20px 0 18px;
}

.admin-section {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h3,
.prompt-card h4 {
  margin: 0;
}

.section-head p,
.prompt-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.form-grid input {
  height: 44px;
  border: 1px solid #dbe3ef;
  border-radius: 13px;
  padding: 0 13px;
  outline: none;
}

.form-grid input:focus,
.admin-textarea:focus {
  border-color: #9fc0ff;
  background: #fff;
}

.full-span {
  grid-column: 1 / -1;
}

.admin-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eef5ff;
  color: #1d4ed8;
  font-size: 13px;
  line-height: 1.55;
}

.admin-note.subtle {
  background: #f8fafc;
  color: #64748b;
}

.admin-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  padding: 13px 15px;
  line-height: 1.6;
  background: #f8fafc;
}

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

.prompt-card {
  padding: 16px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.prompt-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.prompt-textarea {
  min-height: 132px;
  margin-bottom: 8px;
}

.floating-help {
  position: fixed;
  right: 24px;
  top: 75%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--blue);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
  border: 1px solid #dce7ff;
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .28);
  font-size: 14px;
}

.hidden { display: none !important; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 230px 1fr; }
  .agent-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .search-box { width: min(100%, 360px); }
  .uc-layout { grid-template-columns: 220px 1fr; }
  .copy-search-row,
  .ip-search-row { grid-template-columns: 1fr; }
  .tool-panel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; padding-bottom: 14px; }
  .side-nav { flex-direction: row; overflow-x: auto; padding: 12px 12px 0; }
  .nav-item { min-width: 118px; justify-content: center; border-radius: 12px; padding: 0 12px; }
  .side-spacer { display: none; }
  .side-card { margin-top: 14px; }
  .main { padding: 22px 14px; }
  .agent-grid { max-width: none; grid-template-columns: 1fr; }
  .notice-bar { flex-direction: column; align-items: flex-start; }
  .chat-view { height: auto; min-height: 0; grid-template-columns: 1fr; }
  .conversation-panel { max-height: 220px; }
  .chat-panel { height: 72vh; min-height: 520px; }
  .tool-hero { align-items: flex-start; flex-direction: column; }
  .tool-form-grid,
  .tool-summary,
  .profile-strip, .tier-grid, .form-grid { grid-template-columns: 1fr; }
  .section-head,
  .prompt-card-head,
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .user-center-page { padding: 0; }
  .user-center-card { min-height: 100vh; border-radius: 0; }
  .uc-header { height: auto; padding: 18px; flex-direction: column; align-items: stretch; }
  .uc-layout { display: block; }
  .uc-sidebar { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid #e7eaf0; }
  .uc-nav-item { min-width: 120px; text-align: center; }
  .uc-main,
  .credit-detail-page { padding: 18px 14px; }
  .copy-card-head,
  .ip-card-head,
  .uc-pagination { flex-direction: column; align-items: stretch; }
  .card-actions { flex-wrap: wrap; }
  .account-row { grid-template-columns: 100px 1fr; font-size: 15px; }
  .credit-record h4 { margin-right: 0; }
  .credit-time { position: static; display: block; margin-bottom: 8px; }
  .ip-profile-form textarea { min-height: 280px; }
}
