/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.btn-success {
  background: var(--color-success);
  color: white;
}

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

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

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* ============ Cards ============ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-elevated);
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

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

/* ============ Search Box ============ */
.search-box {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 16px 24px 16px 56px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-size: 16px;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--shadow-lg);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 24px;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-lg);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.search-btn:hover {
  filter: brightness(1.1);
}

/* ============ Quick Links ============ */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.quick-link:hover {
  background: var(--bg-elevated);
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.quick-link-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--bg-elevated);
}

.quick-link-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.quick-link-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ============ Stats Cards ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.primary { background: rgba(99, 102, 241, 0.15); color: var(--color-primary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============ Table ============ */
.table-container {
  overflow-x: auto;
}

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

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

.table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 520px;
  max-height: min(90vh, calc(100vh - 48px));
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 180px);
  flex: 1;
  min-height: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-elevated);
}

/* ============ Toast ============ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success { border-left: 4px solid var(--color-success); }
.toast.error { border-left: 4px solid var(--color-danger); }
.toast.warning { border-left: 4px solid var(--color-warning); }
.toast.info { border-left: 4px solid var(--color-info); }

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 14px;
}

.toast-close {
  color: var(--text-muted);
  padding: 4px;
}

/* ============ Badges ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-full);
}

.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--color-primary); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }

/* ============ Empty State ============ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-desc {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ============ Loading ============ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ Profile Card ============ */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-fast);
}

.profile-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.profile-status.running {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.profile-status.stopped {
  background: rgba(113, 113, 122, 0.15);
  color: var(--text-muted);
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.profile-detail {
  font-size: 13px;
}

.profile-detail-label {
  color: var(--text-muted);
  margin-bottom: 2px;
}

.profile-detail-value {
  font-weight: 500;
}

.profile-actions {
  display: flex;
  gap: 8px;
}

.profile-actions .btn {
  flex: 1;
}

/* ============ Extension Card ============ */
.extension-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.extension-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.extension-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.extension-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.extension-icon img {
  width: 32px;
  height: 32px;
}

.extension-info {
  flex: 1;
}

.extension-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

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

.extension-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.extension-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.extension-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============ Course Card ============ */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.course-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.course-cover {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-elevated);
}

.course-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: var(--gradient-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.course-body {
  padding: 20px;
}

.course-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.course-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.course-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============ Tabs ============ */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

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

.tab.active {
  background: var(--gradient-primary);
  color: white;
}

/* ============ Auth Modal ============ */
.auth-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 420px;
  padding: 32px;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .auth-modal {
  transform: scale(1) translateY(0);
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.auth-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.auth-modal-close svg {
  width: 18px;
  height: 18px;
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo svg {
  width: 32px;
  height: 32px;
  color: white;
}

.auth-modal-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-align: center;
}

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

.auth-tab.active {
  background: var(--gradient-primary);
  color: white;
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.auth-optional {
  font-weight: 400;
  color: var(--text-muted);
}

.auth-required {
  color: var(--color-danger);
  font-weight: 500;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.auth-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.auth-input::placeholder {
  color: var(--text-muted);
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  padding: 4px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.auth-password-toggle:hover {
  color: var(--text-primary);
}

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
}

/* SMS 验证码样式 */
.auth-sms-wrapper {
  display: flex;
  gap: 8px;
}

.auth-sms-input {
  flex: 1;
  padding-right: 14px !important;
}

.auth-sms-btn {
  flex-shrink: 0;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast);
  min-width: 100px;
}

.auth-sms-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--color-primary);
}

.auth-sms-btn:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
}

.auth-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.auth-forgot {
  color: var(--color-primary);
  transition: opacity var(--transition-fast);
}

.auth-forgot:hover {
  opacity: 0.8;
}

.auth-error {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: var(--color-danger);
  font-size: 13px;
}

.auth-submit {
  width: 100%;
  padding: 14px 24px;
  background: var(--gradient-primary);
  color: white;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.auth-submit:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-submit-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-submit-loading .spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--color-primary);
  font-weight: 500;
  margin-left: 4px;
}

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

/* ============ User Dropdown ============ */
.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  transition: border-color var(--transition-fast);
}

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

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 100;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

.user-dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
}

.user-dropdown-info {
  flex: 1;
  min-width: 0;
}

.user-dropdown-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
}

.user-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.user-dropdown-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

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

.user-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}
/* ============ 公共浏览器安装选项 ============ */
.public-browser-option {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  transition: all var(--transition-fast);
}

.public-browser-option:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.public-browser-option.installed {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
  border-color: rgba(34, 197, 94, 0.3);
}

.public-browser-option.installed:hover {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.public-browser-header {
  margin-bottom: 8px;
}

.public-browser-checkbox {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

.public-browser-checkbox:hover {
  background: transparent !important;
}

.public-browser-checkbox .profile-checkbox-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.public-browser-icon {
  font-size: 20px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.public-browser-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
}

[data-theme="dark"] .public-browser-hint {
  background: rgba(0, 0, 0, 0.2);
}

.public-browser-hint .hint-icon {
  flex-shrink: 0;
  font-size: 14px;
}

.public-browser-hint .hint-text {
  line-height: 1.4;
}

/* 状态徽章 */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
}

.status-badge.not-installed {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-muted);
}

.status-badge.installed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

/* ============ 算术验证码弹窗 ============ */
.captcha-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
}

.captcha-modal {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 320px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.2s ease-out;
}

.captcha-header {
  text-align: center;
  margin-bottom: 20px;
}

.captcha-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.captcha-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.captcha-question {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.captcha-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 18px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.captcha-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.captcha-error {
  text-align: center;
  color: var(--color-danger);
  font-size: 13px;
  margin-top: 8px;
}

.captcha-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.captcha-btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.captcha-btn-cancel {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.captcha-btn-cancel:hover {
  background: var(--bg-hover);
}

.captcha-btn-confirm {
  background: var(--gradient-primary);
  color: white;
}

.captcha-btn-confirm:hover {
  filter: brightness(1.1);
}

/* ============ Registration Modal ============ */
.registration-modal {
  max-width: 420px;
  width: 90%;
}

.registration-content {
  text-align: center;
}

.registration-content .extension-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(99, 102, 241, 0.1));
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.registration-content .extension-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: contain;
  background: white;
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.registration-content .extension-details {
  text-align: left;
}

.registration-content .extension-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.registration-content .extension-version {
  font-size: 13px;
  color: var(--text-secondary);
}

.registration-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  text-align: left;
}

.registration-message i {
  color: var(--color-primary);
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

.registration-message span {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============ 公共浏览器选项 ============ */
.public-browser-option {
  margin-bottom: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(34, 197, 94, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
}

.public-browser-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.public-browser-checkbox input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.public-browser-checkbox .checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.public-browser-checkbox .profile-name {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.public-browser-checkbox .profile-name svg {
  color: var(--color-primary);
}

.public-browser-checkbox .public-browser-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 安装选项区域 */
.ext-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.ext-options .ext-confirm-checkbox {
  margin: 0;
}

.auto-restart-option {
  padding: 8px 12px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
}

.auto-restart-option span {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ============ Payment Dialog ============ */
.payment-dialog {
  padding: 0;
}

.payment-product {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.payment-product-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.payment-product-icon svg {
  width: 28px;
  height: 28px;
}

.payment-product-info {
  flex: 1;
  min-width: 0;
}

.payment-product-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payment-product-type {
  font-size: 13px;
  color: var(--text-muted);
}

.payment-product-price {
  font-size: 24px;
  font-weight: 700;
  color: #6366f1;
  flex-shrink: 0;
}

.payment-methods {
  margin-bottom: 24px;
}

.payment-method-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.payment-method-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-method-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-elevated);
}

.payment-method-item:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.05);
}

.payment-method-item.active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

.payment-method-item input {
  display: none;
}

.payment-method-item img {
  height: 24px;
  flex-shrink: 0;
}

.payment-method-item span {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

.payment-method-check {
  color: #6366f1;
  display: none;
  flex-shrink: 0;
}

.payment-method-check svg {
  width: 20px;
  height: 20px;
}

.payment-method-item.active .payment-method-check {
  display: flex;
}

.payment-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.payment-summary > span:first-child {
  font-size: 15px;
  color: var(--text-secondary);
}

.payment-total {
  font-size: 28px;
  font-weight: 700;
  color: #ef4444;
}

.payment-agreement {
  font-size: 13px;
  color: var(--text-muted);
}

.payment-agreement label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.payment-agreement input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
  cursor: pointer;
}

.payment-agreement a {
  color: #6366f1;
  text-decoration: none;
}

.payment-agreement a:hover {
  text-decoration: underline;
}