:root {
  color-scheme: dark;
  --bg: #111214;
  --panel: rgba(23, 25, 29, 0.88);
  --panel-solid: #191b20;
  --line: rgba(255, 255, 255, 0.14);
  --text: #f6f1e8;
  --muted: #b9b2a6;
  --gold: #d7b56d;
  --cyan: #78d8e8;
  --rose: #e889a8;
  --green: #8ed19b;
  --danger: #f08372;
  font-family: "Noto Sans SC", "Inter", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 12%, rgba(216, 181, 109, 0.18), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(120, 216, 232, 0.12), transparent 32%),
    var(--bg);
  color: var(--text);
  overflow-y: auto;
}

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

button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}

button:hover,
button.active {
  border-color: rgba(215, 181, 109, 0.75);
  background: rgba(215, 181, 109, 0.16);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.login-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  align-items: center;
  grid-template-columns: minmax(360px, 0.98fr) minmax(440px, 1.02fr);
  padding: 56px;
  isolation: isolate;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 10, 14, 0.92) 0%, rgba(10, 12, 16, 0.68) 30%, rgba(10, 12, 16, 0.18) 62%, rgba(8, 10, 14, 0.32) 100%),
    linear-gradient(0deg, rgba(7, 8, 10, 0.88) 0%, transparent 34%),
    url("../assets/login/login_hero_four_agents.png");
  background-size: cover;
  background-position: center;
  z-index: -3;
  transform: scale(1.01);
}

.login-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 11px, 64px 100%;
  opacity: 0.22;
  mix-blend-mode: screen;
}

.login-sheen {
  position: absolute;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 72%, rgba(215, 181, 109, 0.18), transparent 26%),
    radial-gradient(circle at 52% 38%, rgba(120, 216, 232, 0.14), transparent 24%),
    linear-gradient(112deg, transparent 0%, transparent 39%, rgba(255, 255, 255, 0.1) 45%, transparent 52%, transparent 100%);
  animation: loginSweep 9s linear infinite;
  will-change: transform;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.55) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(120,216,232,0.42) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(215,181,109,0.45) 0 1px, transparent 2px);
  background-size: 96px 96px, 140px 140px, 180px 180px;
  background-position: 0 0, 40px 60px, 120px 20px;
  opacity: 0.24;
  animation: particleDrift 18s linear infinite;
  pointer-events: none;
}

.login-copy {
  align-self: center;
  max-width: 760px;
  padding-bottom: 32px;
}

.login-copy h1 {
  margin: 0;
  max-width: 720px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: clamp(46px, 6.2vw, 96px);
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
}

.login-copy p {
  margin: 18px 0 0;
  color: rgba(246, 241, 232, 0.82);
  font-size: clamp(17px, 1.6vw, 24px);
  line-height: 1.6;
}

.login-panel {
  justify-self: center;
  align-self: center;
  width: min(540px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(12, 14, 18, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  padding: 26px;
  display: grid;
  gap: 14px;
}

.launch-activity {
  margin-top: 26px;
  width: min(480px, 100%);
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(215, 181, 109, 0.36);
  border-radius: 8px;
  background: rgba(10, 12, 16, 0.48);
  box-shadow: 0 14px 40px rgba(0,0,0,0.24);
}
.launch-activity strong { color: var(--gold); font-size: 15px; }
.launch-activity span { color: rgba(246,241,232,0.88); font-size: 14px; }
.launch-activity em { color: var(--cyan); font-style: normal; font-size: 13px; }

.login-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.login-panel-head strong {
  font-size: 20px;
}

.login-panel-head span,
.login-note,
.login-disabled span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.code-row input {
  min-width: 0;
}

.send-code-btn {
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 13px;
  background: rgba(120, 216, 232, 0.15);
  border: 1px solid rgba(120, 216, 232, 0.3);
  color: var(--fg);
  border-radius: 6px;
  cursor: pointer;
}

.send-code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.code-hint {
  font-size: 12px;
  color: var(--muted);
  margin: -4px 0 0;
  min-height: 16px;
}

.login-footer-row {
  text-align: center;
  margin-top: 4px;
}

.login-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.login-link:hover {
  color: var(--fg);
}

.login-modes button {
  padding: 8px 6px;
  white-space: nowrap;
}

.required {
  color: var(--danger);
  font-size: 11px;
  font-weight: normal;
  margin-left: 2px;
}

.optional {
  color: var(--muted);
  font-size: 11px;
  font-weight: normal;
  margin-left: 2px;
}

.pwd-strength {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
}

.pwd-strength-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.pwd-strength-bar span {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

.pwd-bar-1 { width: 33%; background: #f08372; }
.pwd-bar-2 { width: 66%; background: #d7b56d; }
.pwd-bar-3 { width: 100%; background: #8ed19b; }

#reg-pwd-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

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

.login-disabled {
  border: 1px solid rgba(120, 216, 232, 0.24);
  border-radius: 8px;
  background: rgba(120, 216, 232, 0.08);
  padding: 13px;
  display: grid;
  gap: 6px;
}

.login-disabled.pulse {
  animation: loginPulse 520ms ease;
}

.login-submit {
  color: #14110a;
  background: linear-gradient(135deg, #e7cc88, #78d8e8);
  border: 0;
  font-weight: 700;
  padding: 12px 14px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

/* 工作区锁屏：禁止整页滚动，舞台和侧栏各自内部滚动 */
body.in-workspace {
  overflow: hidden;
}

body.in-workspace .shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto 1fr;
}

body.in-workspace .workspace {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

body.in-workspace .stage {
  min-height: 0;
  overflow: hidden;
}

/* 侧边栏用 flexbox 列布局：顶部按钮固定，中间聊天滚动，底部发送栏固定 */
body.in-workspace .side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

body.in-workspace .side-head {
  flex-shrink: 0;
}

body.in-workspace .panel {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
}

body.in-workspace .composer {
  flex-shrink: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 13, 15, 0.72);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .tabs {
  position: relative;
  z-index: 12;
  pointer-events: auto;
}

.topbar .tabs button {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  color: #14110a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
  background: #d7b56d;
}

.user-avatar-btn:hover {
  border-color: rgba(215, 181, 109, 0.8);
  background: inherit;
}

.user-dropdown {
  position: fixed;
  min-width: 200px;
  background: #1e2027;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  padding: 6px;
  animation: dropIn 0.15s ease;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px;
}

.user-dropdown-header strong {
  display: block;
  font-size: 14px;
}

.user-dropdown-header span {
  font-size: 12px;
  color: var(--muted);
}

.user-dropdown-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
  color: #14110a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.user-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
}

.user-dropdown-item.danger {
  color: var(--danger);
}

.user-dropdown-item.danger:hover {
  background: rgba(240, 131, 114, 0.12);
}

/* 注册页头像选择 */
:root {
  --avatar-preset-1: #d7b56d;
  --avatar-preset-2: #78d8e8;
  --avatar-preset-3: #e889a8;
  --avatar-preset-4: #8ed19b;
  --avatar-preset-5: #a08ce0;
  --avatar-preset-6: #f08372;
}

.avatar-select-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avatar-select-label {
  font-size: 13px;
  color: var(--muted);
}

.avatar-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.avatar-opt {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: border-color 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.avatar-opt:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.4);
  background: inherit;
}

.avatar-opt.selected {
  border-color: #fff;
  transform: scale(1.08);
  background: inherit;
}

.avatar-upload-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 2px dashed rgba(255, 255, 255, 0.25);
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.coming-soon-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #2a2d35;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
}

.coming-soon-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── 用户中心 ─────────────────────────────────────────────── */
.uc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.uc-panel {
  background: #1a1c22;
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.uc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.uc-head strong {
  font-size: 16px;
}

.uc-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.uc-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

.uc-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 22px 0;
  flex-shrink: 0;
}

.uc-tab {
  padding: 7px 16px;
  border-radius: 8px 8px 0 0;
  font-size: 14px;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--muted);
  background: none;
}

.uc-tab.active {
  background: rgba(215, 181, 109, 0.12);
  border-color: rgba(215, 181, 109, 0.3);
  color: var(--gold);
}

.uc-content {
  overflow-y: auto;
  padding: 20px 22px 24px;
  flex: 1;
}

.uc-loading {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

.uc-section {
  margin-bottom: 24px;
}

.uc-section:last-child {
  margin-bottom: 0;
}

.uc-section-title {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
  font-weight: 500;
}

.uc-agent-row {
  display: grid;
  grid-template-columns: 52px 1fr 80px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.uc-agent-name {
  font-size: 13px;
  font-weight: 600;
}

.uc-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.uc-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.uc-token-num {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.uc-day-total {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.uc-quota-bar {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.uc-quota-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.uc-quota-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.uc-quota-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

.uc-avatar-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.uc-avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 700;
  color: #14110a;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
}

.uc-inline-form {
  display: flex;
  gap: 8px;
}

.uc-inline-form input {
  flex: 1;
  padding: 9px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
}

.uc-inline-form button {
  padding: 9px 16px;
  white-space: nowrap;
}

.uc-toggle-btn {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.uc-change-block {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.uc-change-block.open {
  display: flex;
}

.uc-change-block input {
  padding: 9px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  width: 100%;
}

.uc-muted {
  color: var(--muted);
  font-size: 13px;
  font-weight: normal;
  margin-left: 6px;
}

.uc-weekly-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(215, 181, 109, 0.08);
  border: 1px solid rgba(215, 181, 109, 0.25);
  border-radius: 10px;
  padding: 14px 16px;
  gap: 12px;
}

.uc-weekly-info strong {
  display: block;
  font-size: 15px;
  color: var(--gold);
}

.uc-weekly-info span {
  font-size: 12px;
  color: var(--muted);
}

.uc-weekly-btn {
  padding: 8px 18px;
  background: var(--gold);
  color: #14110a;
  font-weight: 700;
  border: none;
  border-radius: 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.uc-weekly-btn.disabled, .uc-weekly-btn:disabled {
  background: rgba(215, 181, 109, 0.3);
  color: var(--muted);
  cursor: not-allowed;
}

.uc-apply-btn {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  background: rgba(120, 216, 232, 0.12);
  border: 1px solid rgba(120, 216, 232, 0.3);
  color: var(--cyan);
  border-radius: 8px;
  font-size: 14px;
}

.uc-apply-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.uc-invite-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.uc-invite-input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.uc-invite-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.uc-invite-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
}

/* 管理员 Token 表格 */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th, .admin-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: var(--muted);
  font-weight: 500;
}

.admin-action-btn {
  padding: 5px 12px;
  font-size: 12px;
  margin-right: 4px;
  border-radius: 5px;
}

.admin-action-btn.danger {
  background: rgba(240, 131, 114, 0.15);
  border-color: rgba(240, 131, 114, 0.4);
  color: var(--danger);
}

.admin-inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-inline-form input {
  padding: 9px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-width: 0;
}

.brand strong {
  font-size: 20px;
  letter-spacing: 0;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.home {
  padding: 10px 28px 28px;
  display: grid;
  gap: 12px;
  min-height: calc(100vh + 140px);
  align-content: start;
}

.home-header {
  max-width: 920px;
}

.home-header h1 {
  margin: 0 0 6px;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.05;
}

.home-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.home-manifesto {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.home-manifesto article {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(215, 181, 109, 0.1), rgba(120, 216, 232, 0.08)),
    rgba(255, 255, 255, 0.05);
}

.home-manifesto span {
  display: block;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.home-manifesto strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.home-manifesto p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.agent-strip {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 10, 14, 0.86) 0%, rgba(8, 10, 14, 0.36) 42%, rgba(8, 10, 14, 0.14) 100%),
    url("../assets/login/agent_strip_four_agents.png");
  background-size: cover;
  background-position: center 42%;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.agent-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 76%, rgba(215, 181, 109, 0.2), transparent 18%),
    radial-gradient(circle at 72% 30%, rgba(120, 216, 232, 0.22), transparent 24%),
    linear-gradient(120deg, transparent 0%, transparent 38%, rgba(255, 255, 255, 0.16) 46%, transparent 54%, transparent 100%);
  animation: sweep 8s linear infinite;
  mix-blend-mode: screen;
  will-change: transform;
}

.agent-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.42) 0 1px, transparent 2px);
  background-size: 100% 10px, 88px 64px;
  opacity: 0.2;
  mix-blend-mode: screen;
}

.agent-strip-copy {
  position: absolute;
  left: 22px;
  bottom: 18px;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.agent-strip-copy strong {
  font-size: 28px;
  line-height: 1;
}

.agent-strip-copy span {
  color: rgba(246, 241, 232, 0.76);
}

.agent-card {
  min-height: 548px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.card-visual {
  position: relative;
  min-height: 388px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.68)),
    var(--agent-scene),
    var(--agent-bg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.card-visual::before,
.stage-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.11), transparent);
  transform: translateX(-100%);
  animation: sweep 7s linear infinite;
  will-change: transform;
}

.card-visual::after,
.stage-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 100% 9px;
  opacity: 0.22;
  mix-blend-mode: screen;
}

.card-visual img {
  position: absolute;
  right: 4%;
  bottom: -3%;
  max-width: 82%;
  max-height: 112%;
  object-fit: contain;
  filter: drop-shadow(0 24px 24px rgba(0, 0, 0, 0.45));
}

.agent-card--yanfei .card-visual img {
  max-height: 96%;
  bottom: -1%;
}

.agent-card--yanni .card-visual img {
  max-height: 96%;
  bottom: -1%;
}

.agent-card--placeholder {
  background: #08090b;
  border: 1px solid rgba(255,255,255,0.07);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.agent-card--placeholder:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(255,255,255,0.07);
}

.card-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.35;
}

.placeholder-icon {
  font-size: 28px;
  color: rgba(255,255,255,0.5);
  line-height: 1;
}

.placeholder-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  background: rgba(255,255,255,0.08);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
}

.card-placeholder-inner p {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin: 0;
  letter-spacing: 0.04em;
}

.card-body {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.card-title {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 8px;
}

.card-title h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
}

.provider {
  color: #17130b;
  background: var(--gold);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
  white-space: normal;
}

.card-body p,
.note,
.log-line,
.memory-item {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.card-body p {
  color: rgba(246, 241, 232, 0.86);
  font-size: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.workspace {
  min-height: calc(100vh - 58px);
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(480px, 640px);
}

.stage {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 58px);
}

.stage-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.18) 48%, rgba(0, 0, 0, 0.72) 100%),
    var(--agent-scene),
    var(--agent-bg);
  background-size: cover;
  background-position: center;
}

.stage-character {
  position: absolute;
  right: 5%;
  bottom: 4%;
  max-width: min(54vw, 620px);
  max-height: 96%;
  object-fit: contain;
  filter: drop-shadow(0 28px 30px rgba(0, 0, 0, 0.52));
  z-index: 2;
  transition: opacity 520ms ease, filter 520ms ease;
}

.stage-character.video-active {
  opacity: 0;
  filter: blur(1px) drop-shadow(0 28px 30px rgba(0, 0, 0, 0.35));
}

.stage-clocks {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  gap: 24px;
  z-index: 5;
  pointer-events: none;
}

.sc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sc-svg {
  /* drop-shadow removed — causes GPU repaint every clock tick */
}

.sc-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 1.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

.sc-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.stage-info {
  position: relative;
  z-index: 4;
  padding: 28px;
  max-width: 560px;
}

.stage-info h1 {
  margin: 0 0 8px;
  font-size: clamp(38px, 7vw, 86px);
  line-height: 0.96;
}

.stage-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.stage-info .stage-role {
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
}

.stage-duties {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  max-width: 520px;
}

.stage-duties span {
  color: rgba(246, 241, 232, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(10, 12, 15, 0.44);
  padding: 7px 10px;
  font-size: 13px;
}

.status-badge {
  position: absolute;
  left: 28px;
  bottom: 28px;
  width: min(420px, calc(100% - 56px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 12, 15, 0.68);
  backdrop-filter: blur(12px);
  padding: 14px;
  z-index: 5;
}

.status-badge strong {
  display: inline-block;
  color: #101215;
  background: var(--cyan);
  border-radius: 999px;
  padding: 4px 9px;
  margin-right: 8px;
  font-size: 12px;
}

.status-badge span {
  color: var(--muted);
  line-height: 1.5;
}

.status-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.status-title strong {
  font-size: 16px;
}

.status-chip {
  color: #101215;
  background: var(--cyan);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
}

.status-screen {
  height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.18), transparent 18%),
    linear-gradient(135deg, rgba(216, 181, 109, 0.18), rgba(120, 216, 232, 0.12));
}

.stage-video {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  background: transparent;
  opacity: 0;
  transition: opacity 520ms ease;
  pointer-events: none;
}

.stage-video.visible {
  opacity: 1;
}

.character-video {
  position: absolute;
  right: 5%;
  bottom: -6%;
  z-index: 3;
  max-width: none;
  max-height: none;
  width: auto;
  height: 102%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 520ms ease;
  pointer-events: none;
  filter: brightness(1.28) contrast(1.1) saturate(1.08);
}

.character-video.visible {
  opacity: 1;
}

.status-screen::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.22), transparent, rgba(255, 255, 255, 0.12), transparent);
  animation: rotate 8s linear infinite;
  will-change: transform;
}

.status-screen::after {
  content: attr(data-state-text);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 700;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
}

.side {
  border-left: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.92);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: calc(100vh - 58px);
}

.tabs,
.status-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar .tabs button {
  padding: 10px 14px;
  min-height: 40px;
  font-size: 14px;
}

.side-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.panel {
  padding: 14px;
  overflow: auto;
  font-size: 14px;
}

.chat {
  display: grid;
  gap: 10px;
}

.history-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.history-bar span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  flex: 1;
}

.history-bar button {
  padding: 6px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.msg {
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  line-height: 1.55;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.msg.user {
  justify-self: end;
  background: rgba(120, 216, 232, 0.11);
}

.msg.agent {
  justify-self: start;
  background: rgba(255, 255, 255, 0.07);
}

.thinking-bubble {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  min-width: 60px;
}

.thinking-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  animation: thinking-bounce 1.2s ease-in-out infinite;
}
.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

.image-gen-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-left: 4px;
  letter-spacing: 0.02em;
  animation: thinking-bounce 1.6s ease-in-out infinite;
  animation-delay: 0.6s;
}

/* 夏瞳推送条 */
.xt-push-bar { display:flex; align-items:center; gap:8px; padding:6px 14px; background:rgba(14,165,233,0.07); border-top:1px solid rgba(14,165,233,0.15); }
.xt-push-label { font-size:12px; color:rgba(14,165,233,0.85); flex:1; }
.xt-push-toggle { font-size:11px; font-weight:600; padding:3px 10px; border-radius:20px; border:none; cursor:pointer; transition:all 0.2s; }
.xt-push-toggle.on  { background:rgba(14,165,233,0.2); color:#38bdf8; border:1px solid rgba(14,165,233,0.4); }
.xt-push-toggle.off { background:rgba(107,114,128,0.12); color:#6b7280; border:1px solid rgba(107,114,128,0.3); }
.xt-note-book { font-size:11px; font-weight:700; padding:4px 10px; border-radius:20px; border:1px solid rgba(142,209,155,0.42); color:#8ed19b; background:rgba(142,209,155,0.12); cursor:pointer; }
.xt-note-book:hover { background:rgba(142,209,155,0.2); box-shadow:0 0 18px rgba(142,209,155,0.16); }
.xt-badge { display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; border-radius:9px; background:#ef4444; color:#fff; font-size:10px; font-weight:700; padding:0 4px; }
.xt-push-msg { border-left:2px solid rgba(14,165,233,0.5) !important; background:rgba(14,165,233,0.05) !important; }

.xt-notebook { display:grid; gap:14px; }
.xt-book-cover { min-height:160px; border-radius:8px; display:flex; align-items:flex-end; padding:20px; background:linear-gradient(135deg, rgba(8,12,18,0.2), rgba(8,12,18,0.74)), url("../assets/scenes_anime/03_夏瞳_地下数据观测站_日漫风.png") center/cover; border:1px solid rgba(142,209,155,0.25); position:relative; overflow:hidden; }
.xt-book-cover::after { content:""; position:absolute; inset:0; background-image:radial-gradient(circle, rgba(142,209,155,0.5) 0 1px, transparent 2px); background-size:42px 42px; opacity:.28; }
.xt-book-cover div { position:relative; z-index:1; display:grid; gap:6px; }
.xt-book-cover strong { font-size:28px; color:#f4f7f1; }
.xt-book-cover span { color:rgba(244,247,241,.78); }
.xt-note-day { border:1px solid rgba(255,255,255,.1); border-radius:8px; background:rgba(255,255,255,.04); overflow:hidden; }
.xt-note-day summary { cursor:pointer; padding:10px 12px; color:#d8f5dd; font-weight:700; }
.xt-note-entry { width:100%; display:flex; justify-content:space-between; gap:12px; text-align:left; padding:10px 12px; border:0; border-top:1px solid rgba(255,255,255,.08); background:rgba(0,0,0,.12); color:var(--text); cursor:pointer; }
.xt-note-entry:hover { background:rgba(142,209,155,.1); }
.notification-item { width:100%; text-align:left; cursor:pointer; }
.notification-item.read { opacity:.62; }
.notification-detail { line-height:1.7; color:var(--text); }
.uc-activity-mini { margin-top:8px; padding:8px 10px; border:1px solid rgba(215,181,109,.22); border-radius:8px; color:var(--gold); background:rgba(215,181,109,.08); font-size:12px; }
.api-status-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; }
.api-status-card { border:1px solid rgba(255,255,255,.1); border-radius:8px; background:rgba(255,255,255,.04); padding:14px; display:grid; gap:6px; }
.api-status-card div { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.api-status-card span { color:var(--muted); font-size:12px; }
.api-status-card p { margin:0; color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.api-status-card code { color:var(--muted); font-size:11px; }
.status-ok { color:var(--green) !important; }
.status-bad { color:var(--danger) !important; }

@keyframes thinking-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%            { transform: scale(1.1); opacity: 1;   }
}

.msg h2,
.msg h3,
.msg h4 {
  margin: 12px 0 8px;
  line-height: 1.25;
}

.msg h2:first-child,
.msg h3:first-child,
.msg h4:first-child,
.msg p:first-child {
  margin-top: 0;
}

.msg p {
  margin: 8px 0;
}

.msg ul {
  margin: 8px 0;
  padding-left: 20px;
}

.msg li {
  margin: 4px 0;
}

.msg a {
  color: var(--cyan);
  text-decoration: none;
}

.msg a:hover {
  text-decoration: underline;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.msg table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}

.msg th,
.msg td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  vertical-align: top;
}

.msg th {
  color: var(--text);
  background: rgba(215, 181, 109, 0.12);
}

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

.backend-console {
  padding: 24px 28px 36px;
  display: grid;
  gap: 18px;
}

.backend-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.backend-hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.backend-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.backend-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(16, 17, 20, 0.9);
  min-height: 220px;
}

.backend-card h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.backend-row {
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.backend-row:first-of-type {
  border-top: 0;
}

.backend-row span,
.backend-row small {
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 12px 12px 20px;
  display: grid;
  gap: 10px;
}

.upload-row,
.send-row,
.form-grid {
  display: grid;
  gap: 10px;
}

.upload-row {
  grid-template-columns: 1fr 1fr;
}

.upload-thumb-strip {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 4px 0 2px;
}

.upload-thumb-wrap {
  position: relative;
  flex-shrink: 0;
}

.upload-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: block;
  background: rgba(0, 0, 0, 0.3);
}

.upload-thumb-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.88);
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  line-height: 15px;
  text-align: center;
  padding: 0;
  transition: background 0.15s;
}

.upload-thumb-del:hover {
  background: rgba(200, 60, 60, 0.85);
}

.send-row {
  grid-template-columns: 1fr auto;
}

textarea,
input,
select {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 10px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.hidden {
  display: none;
}

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

.list {
  display: grid;
  gap: 10px;
}

.memory-item,
.log-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
}

@keyframes sweep {
  to {
    transform: translateX(100%);
  }
}

@keyframes rotate {
  to {
    transform: rotate(1turn);
  }
}

@keyframes loginSweep {
  from {
    transform: translateX(-12%);
  }
  to {
    transform: translateX(12%);
  }
}

@keyframes particleDrift {
  from {
    background-position: 0 0, 40px 60px, 120px 20px;
  }
  to {
    background-position: 96px 96px, 180px 200px, 300px 200px;
  }
}

@keyframes loginPulse {
  0%,
  100% {
    border-color: rgba(120, 216, 232, 0.24);
  }
  45% {
    border-color: rgba(120, 216, 232, 0.86);
    box-shadow: 0 0 0 4px rgba(120, 216, 232, 0.1);
  }
}

@media (max-width: 1020px) {
  .login-screen {
    grid-template-columns: 1fr;
    align-content: end;
    gap: 24px;
    padding: 28px;
  }

  .login-copy {
    padding-bottom: 0;
  }

  .login-panel {
    justify-self: start;
  }

  .agent-grid,
  .home-manifesto,
  .backend-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .side {
    border-left: 0;
    border-top: 1px solid var(--line);
    min-height: 720px;
  }

  .stage {
    min-height: 740px;
  }
}

@media (max-width: 640px) {
  .login-screen {
    padding: 18px;
  }

  .login-bg {
    background-position: 62% center;
  }

  .login-copy h1 {
    font-size: 42px;
  }

  .login-modes {
    grid-template-columns: 1fr;
  }

  .topbar,
  .home {
    padding-left: 14px;
    padding-right: 14px;
  }

  .agent-strip {
    min-height: 160px;
    background-position: center 42%;
  }

  .agent-strip-copy strong {
    font-size: 22px;
  }

  .brand span {
    display: none;
  }

  .stage-info {
    padding: 18px;
  }

  .stage-character {
    right: -20%;
    max-width: 95vw;
  }

  .character-video {
    right: -20%;
    max-width: none;
    height: 96%;
  }

  .status-player {
    left: 14px;
    bottom: 14px;
    width: calc(100% - 28px);
  }

  .upload-row,
  .send-row,
  .split {
    grid-template-columns: 1fr;
  }
}

/* ======================== */
/* 管理控制台样式            */
/* ======================== */

.admin-login-screen {
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: center;
  padding: 28px;
}

.admin-login-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  padding: 28px;
  display: grid;
  gap: 16px;
}

.admin-login-card h2 {
  margin: 0;
  font-size: 24px;
}

.admin-login-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-login-error {
  border: 1px solid rgba(240, 131, 114, 0.4);
  background: rgba(240, 131, 114, 0.1);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.admin-login-form {
  display: grid;
  gap: 12px;
}

.admin-login-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.admin-login-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.admin-login-btn {
  background: linear-gradient(135deg, #e7cc88, #78d8e8);
  color: #14110a;
  border: 0;
  font-weight: 700;
  padding: 12px 18px;
  flex: 1;
}

.admin-cancel-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 12px 18px;
}

.admin-panel {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 58px);
}

.admin-sidebar {
  border-right: 1px solid var(--line);
  background: rgba(12, 13, 15, 0.72);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-sidebar button {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  font-size: 14px;
  color: var(--muted);
}

.admin-sidebar button:hover,
.admin-sidebar button.active {
  background: rgba(215, 181, 109, 0.12);
  border-color: rgba(215, 181, 109, 0.35);
  color: var(--text);
}

.admin-content {
  padding: 24px 28px 36px;
  overflow: auto;
}

.admin-section {
  display: grid;
  gap: 18px;
}

.admin-section h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.admin-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-actions-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.admin-primary-btn {
  background: linear-gradient(135deg, #e7cc88, #78d8e8);
  color: #14110a;
  border: 0;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.admin-text-btn {
  background: transparent;
  border: 0;
  color: var(--danger);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
}

.admin-agent-config,
.admin-agent-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-agent-config h4,
.admin-agent-block h4 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--gold);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.admin-save-msg {
  font-size: 13px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.skill-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  display: grid;
  gap: 6px;
}

.skill-card:hover {
  border-color: rgba(215, 181, 109, 0.5);
  transform: translateY(-2px);
}

.skill-card strong {
  font-size: 14px;
}

.skill-stars {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 1px;
}

.skill-tools {
  color: var(--muted);
  font-size: 12px;
}

.memory-list {
  display: grid;
  gap: 8px;
}

.memory-list .memory-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  line-height: 1.6;
}

.logs-list {
  display: grid;
  gap: 10px;
}

.log-entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s;
}

.log-entry:hover {
  border-color: rgba(120, 216, 232, 0.4);
}

.log-entry-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.log-category {
  background: rgba(215, 181, 109, 0.18);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.log-time {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

.log-author {
  color: var(--muted);
  font-size: 12px;
}

.log-entry-preview {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px;
}

.pagination span {
  color: var(--muted);
  font-size: 13px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-card {
  width: min(560px, 92vw);
  max-height: 86vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-solid);
  padding: 24px;
  display: grid;
  gap: 14px;
}

.modal-large {
  width: min(720px, 92vw);
}

.modal-card h3 {
  margin: 0;
  font-size: 20px;
}

.modal-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.modal-tools {
  margin: 0;
  color: var(--cyan);
  font-size: 13px;
}

.modal-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.modal-body h4 {
  margin: 14px 0 8px;
  font-size: 14px;
  color: var(--gold);
}

.modal-body p {
  margin: 0;
  line-height: 1.7;
  font-size: 14px;
}

.code-block {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.modal-form {
  display: grid;
  gap: 12px;
}

.modal-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

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

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.monitor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 8px;
}

.monitor-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--gold);
}

.monitor-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.tasks-list,
.announcements-list {
  display: grid;
  gap: 12px;
}

.task-card,
.announcement-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.task-header,
.announcement-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.task-status {
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
}

.task-desc,
.announcement-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.task-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.session-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
}

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

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

.session-summary {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.session-summary p {
  margin: 0;
  font-size: 14px;
}

.admin-error {
  color: var(--danger);
  padding: 14px;
  border: 1px solid rgba(240, 131, 114, 0.3);
  border-radius: 8px;
  background: rgba(240, 131, 114, 0.08);
}

.announcement-priority {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.announcement-time {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

@media (max-width: 1020px) {
  .admin-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .admin-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .skills-grid,
  .monitor-grid,
  .sessions-grid {
    grid-template-columns: 1fr;
  }
}


/* ===================== 管理控制台数据表格 ===================== */

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.admin-data-table thead th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

.admin-data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}

.admin-data-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
}

.admin-small-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-small-btn:hover {
  background: rgba(255,255,255,0.12);
}

.admin-success-btn {
  border-color: var(--green);
  color: var(--green);
}

.role-select-inline {
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1a202c;
  font-size: 12px;
  cursor: pointer;
}

.admin-panel select, .admin-select {
  background: #1a1f2e;
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.15);
}

/* ── 角色徽章 ── */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.5;
}

.role-badge--super {
  background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(245,158,11,0.1));
  border: 1px solid rgba(251,191,36,0.5);
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251,191,36,0.4);
}

.role-badge--admin {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.35);
  color: #f59e0b;
}

.role-badge--beta {
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.35);
  color: #c084fc;
}

.role-badge--premium {
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.35);
  color: #22d3ee;
}

.role-badge--user {
  background: rgba(107,114,128,0.1);
  border: 1px solid rgba(107,114,128,0.3);
  color: #9ca3af;
}

.role-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.admin-success-btn:hover {
  background: rgba(132,204,154,0.12);
}

.admin-danger-btn {
  border-color: var(--danger);
  color: var(--danger);
}

.admin-danger-btn:hover {
  background: rgba(240,131,114,0.12);
}

/* ===================== 状态标识 ===================== */

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 6px rgba(132,204,154,0.5);
}

.status-dot.offline {
  background: var(--muted);
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.status-pending {
  background: rgba(215,181,109,0.15);
  color: var(--gold);
}

.status-badge.status-approved {
  background: rgba(132,204,154,0.15);
  color: var(--green);
}

.status-badge.status-rejected {
  background: rgba(240,131,114,0.15);
  color: var(--danger);
}

/* ===================== 通知角标 ===================== */

.notif-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 5px;
  position: relative;
  top: -1px;
}

/* ===================== 用户详情 breakdown ===================== */

.user-detail p {
  margin: 6px 0;
  font-size: 13px;
}

.agent-breakdown {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.breakdown-name {
  color: var(--fg);
  font-weight: 500;
}

.breakdown-bar-bg {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.breakdown-stat {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ===================== 表单卡片 ===================== */

.admin-form-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 18px;
}

.admin-form-card .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.admin-form-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.admin-form-card input,
.admin-form-card select,
.admin-form-card textarea {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
  color: var(--fg);
  font-size: 13px;
}

.admin-form-card textarea {
  width: 100%;
  resize: vertical;
  margin-top: 10px;
}

/* ===================== 响应式 ===================== */

@media (max-width: 1020px) {
  .breakdown-row {
    grid-template-columns: 80px 1fr auto;
  }
}
