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

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
}

/* 登录/注册页展示时锁定 body，避免整页滚动条 */
body:has(#login-page:not(.hidden)) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#app > .page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page-legal {
  text-align: center;
  padding: 20px 24px 28px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.page-legal a {
  color: var(--text-secondary);
  text-decoration: none;
}

.page-legal a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.page-legal-sep {
  margin: 0 10px;
  color: #cbd5e1;
}

.page-legal-login {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
  color: rgba(200, 220, 255, 0.65);
  padding: 4px 16px 16px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.page-legal-login a {
  color: rgba(200, 220, 255, 0.8);
}

.page-legal-login a:hover {
  color: #00d4ff;
}

.page-legal-login .page-legal-sep {
  color: rgba(0, 212, 255, 0.35);
}

#main-page {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

#main-page .header,
#main-page .nav-tabs {
  flex-shrink: 0;
  z-index: 100;
}

#main-page .nav-tabs {
  z-index: 99;
  overflow-x: auto;
}

#main-page .main-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  width: 100%;
  max-width: none;
  margin: 0;
}

#main-page .main-content > .panel {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

#main-page .main-content:has(.doc-assistant-panel:not(.hidden)) {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#main-page .main-content:has(.doc-assistant-panel:not(.hidden)) > .panel {
  max-width: none;
  margin: 0;
  flex: 1;
  min-height: 0;
}

#main-page .page-legal {
  flex-shrink: 0;
}

body:has(#main-page:not(.hidden)) {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.auth-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Login - Tech style */
#login-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  background: #0a0e1a;
  position: relative;
  /* 固定视口高度，裁剪背景动画，避免整页出现多余滚动条 */
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
}

.login-center-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 24px 16px 12px;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  /* 仅注册表单过高时在卡片区域滚动，不出现整页滚动条 */
  overflow-x: hidden;
  overflow-y: auto;
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  /* 用 background-position 动画，避免 transform 撑出滚动区域 */
  animation: gridMove 20s linear infinite;
}

.login-bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 180, 255, 0.15) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

@keyframes gridMove {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 40px 40px, 40px 40px; }
}

.tech-card {
  position: relative;
  z-index: 1;
  background: rgba(10, 20, 40, 0.85);
  border: 1px solid rgba(0, 212, 255, 0.35);
  padding: 40px;
  border-radius: 4px;
  box-shadow:
    0 0 30px rgba(0, 180, 255, 0.15),
    inset 0 0 60px rgba(0, 100, 200, 0.05);
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(10px);
}

.tech-card::before,
.tech-card::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #00d4ff;
  border-style: solid;
}

.tech-card::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.tech-card::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.tech-logo {
  position: relative;
  width: 80px;
  height: 88px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tech-logo-img {
  width: 72px;
  height: 80px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.35));
}

.login-header h1 {
  font-size: 22px;
  margin-bottom: 8px;
  color: #e8f4ff;
  letter-spacing: 2px;
}

.tech-subtitle {
  color: rgba(0, 212, 255, 0.7);
  font-size: 11px;
  letter-spacing: 3px;
}

#login-page .form-group label {
  color: rgba(0, 212, 255, 0.9);
  font-size: 13px;
  letter-spacing: 1px;
}

.tech-input {
  background: rgba(0, 30, 60, 0.6) !important;
  border: 1px solid rgba(0, 212, 255, 0.3) !important;
  color: #e8f4ff !important;
  width: 100%;
  box-sizing: border-box;
  border-radius: 6px !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.tech-input:focus {
  border-color: #00d4ff !important;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.25) !important;
}

.tech-input::placeholder {
  color: rgba(150, 200, 255, 0.4);
}

.btn-tech {
  background: linear-gradient(135deg, #0066aa 0%, #00a8e8 100%);
  border: 1px solid rgba(0, 212, 255, 0.5);
  color: #fff;
  letter-spacing: 4px;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-tech:hover {
  box-shadow: 0 0 20px rgba(0, 180, 255, 0.5);
  transform: translateY(-1px);
}

.login-footer-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  font-size: 10px;
  color: rgba(0, 212, 255, 0.4);
  letter-spacing: 2px;
}

.login-footer-deco span:first-child,
.login-footer-deco span:last-child {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
}

.auth-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
}

.auth-switch a {
  color: #38bdf8;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.code-row .tech-input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.code-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

#login-page .login-card {
  max-height: none;
  overflow: visible;
  margin: 0 auto;
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 420px;
  flex-shrink: 0;
}

#login-page .login-header {
  margin-bottom: 20px;
}

#login-page .form-group {
  margin-bottom: 12px;
}

#login-page .error-msg {
  color: #ff6b8a;
}

/* 原型访问口令验证页（紫蓝渐变 + 白卡片） */
body.gate-body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.gate-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gate-center-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px;
}

.page-legal-gate {
  color: rgba(255, 255, 255, 0.75);
}

.page-legal-gate a {
  color: rgba(255, 255, 255, 0.85);
}

.page-legal-gate a:hover {
  color: #fff;
  text-decoration: underline;
}

.page-legal-gate .page-legal-sep {
  color: rgba(255, 255, 255, 0.4);
}

.gate-card {
  background: var(--card);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 400px;
}

.gate-header {
  text-align: center;
  margin-bottom: 32px;
}

.gate-header h1 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
}

.gate-header .gate-version {
  color: var(--primary);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 8px;
}

.gate-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.gate-card .form-group label {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.gate-card .form-group input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

.gate-card .form-group input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.gate-card .error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}

/* Header */
.header {
  background: var(--card);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 32px;
  height: 36px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-download-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.header-download-link:hover {
  text-decoration: underline;
}

#user-info {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Nav tabs */
.nav-tabs {
  background: var(--card);
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 12px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

/* Main content */
.main-content {
  padding: 24px 32px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

.panel {
  width: 100%;
  min-width: 0;
}

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

.panel-header h2 {
  font-size: 18px;
}

.panel-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: normal;
}

.design-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.ai-create-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ai-create-examples .ai-example-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 12px;
  padding: 2px 10px;
  cursor: pointer;
}

.ai-create-examples .ai-example-chip:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.ai-create-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-create-options .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.ai-create-image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ai-create-prd-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary, #f8fafc);
  font-size: 13px;
}

.ai-create-prd-preview.hidden {
  display: none;
}

.ai-create-prd-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-create-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}

.ai-create-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-create-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.ai-create-fail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}

#ai-design-form-error a,
#ai-design-llm-banner a {
  color: var(--primary);
}

.prototype-team-filter {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.prototype-team-filter .filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prototype-team-filter .filter-item label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.prototype-team-filter select {
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.prototype-team-members {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.team-members-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 4px;
}

.team-member-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.team-member-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.team-member-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.sub-tab-btn {
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.sub-tab-btn:hover {
  color: var(--primary);
}

.sub-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.panel-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.team-members-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.team-member-selected-count {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.pagination-compact {
  margin-top: 12px;
  padding-top: 0;
}

.team-member-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-member-item {
  padding: 4px 0;
}

.team-member-empty {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 16px 0;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.filter-bar select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  min-width: 180px;
}

.filter-bar select:focus {
  outline: none;
  border-color: var(--primary);
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-bar input[type="text"],
.search-bar input[type="date"],
.search-bar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.access-log-filters .filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.access-log-filters .filter-item label {
  font-size: 12px;
  color: var(--text-secondary);
}

.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range input[type="date"] {
  min-width: 0;
  flex: 1;
}

.date-range-sep {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-group input:disabled,
.form-group input[readonly] {
  background: #f1f5f9;
  color: var(--text-secondary);
  cursor: not-allowed;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 12px 0;
}

.pagination-info {
  font-size: 14px;
  color: var(--text-secondary);
}

.pagination-btns {
  display: flex;
  gap: 8px;
}

.pagination-btns button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Table */
.table-wrapper {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.data-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-secondary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.access-link {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

.access-link:hover {
  text-decoration: underline;
}

.copy-btn {
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  color: var(--text-secondary);
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.empty-state {
  width: 100%;
  min-height: 160px;
  padding: 48px;
  text-align: center;
  color: var(--text-secondary);
  box-sizing: border-box;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
}

.action-btns {
  display: flex;
  gap: 8px;
}

.action-btns a.btn {
  text-decoration: none;
}

.action-btns a.btn:hover,
.action-btns a.btn:focus {
  text-decoration: none;
}

.design-filters {
  align-items: flex-end;
}

.design-filters .btn {
  align-self: flex-end;
  margin-bottom: 0;
}

.prototype-filters {
  align-items: flex-end;
}

.prototype-filters .btn {
  align-self: flex-end;
  margin-bottom: 0;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.required {
  color: var(--danger);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.form-hint-label {
  margin-top: 4px;
  margin-bottom: 8px;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: #dbeafe;
  color: var(--primary);
}

.badge-admin {
  background: #fef3c7;
  color: #d97706;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-sm {
  max-width: 400px;
}

.modal-lg {
  max-width: 640px;
}

.access-code-summary {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.access-code-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.access-code-list-header h4 {
  font-size: 15px;
}

.access-code-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.access-code-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.access-code-item:last-child {
  border-bottom: none;
}

.access-code-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.code-count-badge {
  display: inline-block;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 12px;
  text-align: center;
}

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

.modal-header h3 {
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

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

.confirm-text {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Module permissions */
.permission-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.proto-source-radio-group {
  display: flex;
  gap: 24px;
  margin-top: 4px;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: normal;
}

.radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.badge-yes {
  background: #dcfce7;
  color: #166534;
}

.badge-no {
  background: #f1f5f9;
  color: #64748b;
}

/* Doc AI Assistant */
.doc-assistant-panel {
  padding: 0 !important;
  width: 100%;
  max-width: none !important;
  height: 100%;
  min-height: 0;
}

.ai-chat-layout {
  display: flex;
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ai-chat-sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fafbfc;
}

.ai-chat-sidebar-header {
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.ai-chat-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-chat-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-brand h2 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.ai-chat-session-list {
  flex: 1;
  width: 100%;
  min-height: 120px;
  overflow-y: auto;
  padding: 8px 0;
  box-sizing: border-box;
}

.ai-chat-session-empty {
  width: 100%;
  min-height: 120px;
  padding: 24px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  box-sizing: border-box;
}

.ai-chat-session-group {
  margin-bottom: 8px;
}

.ai-chat-session-group-title {
  padding: 8px 16px 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.ai-chat-session-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}

.ai-chat-session-item.active .ai-chat-session-select {
  background: #e8f0fe;
  color: var(--primary);
}

.ai-chat-session-select {
  flex: 1;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
}

.ai-chat-session-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-chat-session-title:hover {
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.35);
}

.ai-chat-session-title-input {
  width: 100%;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ai-chat-session-select:hover {
  background: #f1f5f9;
}

.ai-chat-session-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.ai-chat-session-item:hover .ai-chat-session-delete {
  opacity: 1;
}

.ai-chat-session-delete:hover {
  background: #fee2e2;
  color: var(--danger);
}

.ai-chat-session-tip {
  padding: 8px 16px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}

.ai-new-session-btn {
  margin: 8px 12px 16px;
  width: calc(100% - 24px);
}

.ai-chat-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  background: #fff;
}

.ai-chat-messages {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 32px;
  box-sizing: border-box;
}

.ai-chat-welcome {
  max-width: 560px;
  margin: 80px auto 0;
  text-align: center;
  color: var(--text-secondary);
}

.ai-chat-welcome-compact {
  margin-top: 40px;
}

.ai-chat-welcome-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-welcome h3 {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 12px;
}

.ai-chat-welcome p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.ai-chat-welcome-hint {
  font-size: 13px;
  color: #94a3b8;
}

.ai-chat-message {
  margin-bottom: 24px;
  max-width: 820px;
}

.ai-chat-message-user {
  margin-left: auto;
  max-width: 70%;
}

.ai-chat-message-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-message-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.ai-chat-message-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  padding-left: 36px;
}

.ai-chat-message-body-user {
  padding: 12px 16px;
  background: #e8f3ff;
  border-radius: 12px;
  border-bottom-right-radius: 4px;
  padding-left: 16px;
}

.ai-chat-loading .ai-chat-message-body {
  color: var(--text-secondary);
  font-style: italic;
}

.ai-chat-message-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-left: 36px;
}

.ai-chat-action-hint {
  width: 100%;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.ai-chat-export-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-chat-export-group .btn {
  min-width: auto;
}

.ai-chat-input-wrap {
  padding: 0 32px 12px;
}

.ai-chat-input-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.ai-chat-input-box textarea {
  width: 100%;
  border: none;
  padding: 16px 16px 8px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 52px;
  max-height: 160px;
  line-height: 1.6;
}

.ai-chat-input-box textarea:focus {
  outline: none;
}

.ai-chat-input-box textarea:disabled {
  background: #f8fafc;
  cursor: not-allowed;
}

.ai-chat-input-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 12px;
}

.ai-chat-send-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ai-chat-send-btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.ai-chat-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.ai-chat-disclaimer {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  padding: 0 32px 16px;
}

.doc-assistant-llm-hint {
  color: #b45309;
  padding-top: 0;
}

.doc-assistant-llm-hint a {
  color: #b45309;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .ai-chat-layout {
    flex-direction: column;
  }

  .ai-chat-sidebar {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: none;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .ai-chat-messages,
  .ai-chat-input-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Assistant config */
.config-form {
  max-width: 720px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.config-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.config-form textarea:focus,
.config-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.config-form-actions {
  margin-top: 8px;
}

.user-info-link {
  cursor: pointer;
  user-select: none;
}

.user-info-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.personal-center-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.personal-section-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.personal-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.personal-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.personal-info-row span {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.personal-info-row strong {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.personal-email-form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.personal-subsection-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.personal-email-form .code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.personal-email-form .code-row input {
  flex: 1;
  min-width: 0;
}

.personal-email-form .code-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.personal-llm-form {
  max-width: none;
}

.personal-password-form {
  max-width: none;
}

.personal-llm-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

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

/* Help center */
.help-admin-info {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.help-admin-info-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.help-admin-info-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.help-admin-info-sep {
  color: var(--border);
}

.extension-download-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.extension-download-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.extension-version-tag {
  font-size: 12px;
  font-weight: 600;
  color: #0e7490;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 999px;
  padding: 2px 8px;
}

.extension-version-tag:empty {
  display: none;
}

.extension-download-desc {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.extension-download-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.extension-download-steps code {
  font-size: 12px;
  padding: 1px 6px;
  background: #f1f5f9;
  border-radius: 4px;
}

.extension-download-btn {
  flex-shrink: 0;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .extension-download-card {
    flex-direction: column;
  }

  .extension-download-btn {
    width: 100%;
  }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-xl {
  max-width: 900px;
}

.help-doc-editor {
  min-height: 280px;
  background: #fff;
}

.help-doc-editor .ql-container {
  min-height: 240px;
  font-size: 14px;
}

/* 留言板 */
.message-composer {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-secondary, #fff);
}

.message-composer-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.message-quill-editor {
  min-height: 160px;
  background: #fff;
  border-radius: 0 0 8px 8px;
}

.message-quill-editor .ql-toolbar {
  border-radius: 8px 8px 0 0;
}

.message-quill-editor .ql-container {
  min-height: 140px;
  font-size: 14px;
}

.message-quill-editor--sm .ql-container {
  min-height: 100px;
}

.message-list-header {
  margin-top: 8px;
  margin-bottom: 8px;
}

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

.message-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary, #fff);
}

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

.message-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.message-card-author {
  font-weight: 600;
  color: var(--text);
}

.message-card-preview {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.message-detail-body {
  padding: 4px 4px 12px;
}

.message-detail-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.message-detail-content.rich-html,
.message-reply-content.rich-html {
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.message-detail-content.rich-html img,
.message-reply-content.rich-html img {
  max-width: 100%;
}

.message-replies-block {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.message-replies-block h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.message-replies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-reply-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-muted, rgba(148, 163, 184, 0.12));
}

.message-reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.message-reply-composer {
  margin-top: 16px;
}

.message-reply-composer label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
}

[data-theme='dark'] .message-quill-editor,
[data-theme='dark'] .help-doc-editor {
  background: #0f172a;
}

.help-doc-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.help-doc-page-header {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.help-doc-page-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 24px;
}

.help-doc-page-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.help-doc-page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.help-doc-page-version {
  display: inline-block;
  padding: 2px 10px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 999px;
  font-size: 13px;
}

.help-doc-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.help-doc-page-meta-sep {
  color: var(--border);
}

.help-doc-page-main {
  flex: 1;
  overflow: auto;
  padding: 24px;
}

.help-doc-page-content {
  max-width: 960px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 40px;
  min-height: calc(100vh - 140px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  line-height: 1.8;
}

.help-doc-page-auth {
  align-items: center;
  justify-content: center;
}

.help-doc-auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
}

.help-doc-auth-card h1 {
  margin: 0 0 12px;
  font-size: 22px;
}

.help-doc-auth-card p {
  margin: 0 0 24px;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .header, .nav-tabs, .main-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 8px;
  }
}

.theme-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.theme-fab:hover {
  transform: translateY(-2px);
  color: var(--primary);
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.theme-fab:active {
  transform: translateY(0);
}

.theme-fab-icon {
  display: none;
}

html:not([data-theme='dark']) .theme-fab-moon,
html[data-theme='light'] .theme-fab-moon {
  display: block;
}

html[data-theme='dark'] .theme-fab-sun {
  display: block;
}

html[data-theme='dark'] .theme-fab:hover {
  background: rgba(59, 130, 246, 0.16);
}

html[data-theme='dark'] {
  color-scheme: dark;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --danger: #f87171;
  --danger-hover: #ef4444;
  --bg: #0b1220;
  --card: #111827;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

html[data-theme='dark'] #main-page {
  background: var(--bg);
}

html[data-theme='dark'] .header,
html[data-theme='dark'] .nav-tabs,
html[data-theme='dark'] .modal-content,
html[data-theme='dark'] .table-wrapper,
html[data-theme='dark'] .data-table,
html[data-theme='dark'] .form-group input,
html[data-theme='dark'] .form-group select,
html[data-theme='dark'] .form-group textarea,
html[data-theme='dark'] .btn-outline {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme='dark'] .data-table th {
  background: #1e293b;
  color: var(--text-secondary);
}

html[data-theme='dark'] .data-table td {
  border-color: var(--border);
  color: var(--text);
}

html[data-theme='dark'] .data-table tr:hover td {
  background: #1e293b;
}

html[data-theme='dark'] .tab-btn {
  color: var(--text-secondary);
}

html[data-theme='dark'] .tab-btn:hover,
html[data-theme='dark'] .tab-btn.active {
  color: var(--primary);
}

html[data-theme='dark'] .empty-state,
html[data-theme='dark'] .panel-hint,
html[data-theme='dark'] #user-info {
  color: var(--text-secondary);
}

html[data-theme='dark'] .btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
}

html[data-theme='dark'] .code-count-badge {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

html[data-theme='dark'] .prototype-team-filter,
html[data-theme='dark'] .pagination button,
html[data-theme='dark'] .modal-overlay .modal {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea {
  background: #0f172a;
  color: var(--text);
  border-color: var(--border);
}

html[data-theme='dark'] .access-link {
  color: #93c5fd;
}

