/* 用户端样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 亮色主题 */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --header-bg: rgba(255, 255, 255, 0.95);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.light-mode {
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --header-bg: rgba(255, 255, 255, 0.95);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.dark-mode {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --header-bg: rgba(30, 41, 59, 0.95);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* 一屏式布局 */
.one-screen {
  min-height: calc(100vh - 70px - 60px);
  display: flex;
  flex-direction: column;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* 顶部导航 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.logo img {
  height: 36px;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: var(--primary);
  background: rgba(79, 70, 229, 0.1);
}

/* 下拉菜单 */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 1000;
  margin-top: 8px;
  padding: 8px 0;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-item {
  display: block;
  padding: 10px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.nav-dropdown-item:hover {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.user-info strong {
  color: var(--primary);
}

.user-info-with-recharge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-recharge-small {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.btn-recharge-small:hover {
  opacity: 0.9;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--card-bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  border: 1px solid var(--border);
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

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

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

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(79, 70, 229, 0.1);
}

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

.btn-block {
  width: 100%;
}

.input-with-btn {
  display: flex;
  gap: 10px;
}

.input-with-btn input {
  flex: 1;
}

.btn-sms {
  padding: 12px 16px;
  font-size: 14px;
  white-space: nowrap;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sms:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-sms:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.login-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

.login-tab.active {
  background: var(--bg);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Hero区域 */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  /* 无背景图时使用纯黑色 */
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--text);
  min-height: 400px;
  position: relative;
}

/* 有背景图片时文字变白 */
.hero.hero-with-bg {
  color: white;
}

/* 黑色蒙版 - 让文字更清晰 */
.hero.hero-with-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

/* 确保内容在蒙版上面 */
.hero > * {
  position: relative;
  z-index: 1;
}

.hero-content {
  text-align: center;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-content[style*="text-align: left"] {
  text-align: left;
  align-items: flex-start;
}

.hero-content[style*="text-align: right"] {
  text-align: right;
  align-items: flex-end;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero p {
  font-size: 20px;
  opacity: 0.9;
  margin-bottom: 40px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

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

.hero .btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
}

.hero .btn-outline {
  border-color: white;
  color: white;
}

.hero .btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 平台展示 */
.platforms {
  padding: 60px 0;
  background: transparent;
}

.platforms h2 {
  text-align: center;
  font-size: 32px;
  margin-bottom: 40px;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.platform-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.platform-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.platform-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.platform-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.platform-card p {
  color: var(--text-muted);
  font-size: 14px;
}

.platform-card code {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* 功能特点 */
.features {
  padding: 60px 0;
  background: transparent;
}

.features h2 {
  text-align: center;
  font-size: 32px;
  margin-bottom: 40px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
}

/* 底部 */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 14px;
}

.footer .icp {
  margin-top: 8px;
  font-size: 12px;
}

.footer.simple {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}

/* 认证页面 */
.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

.auth-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

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

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
}

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

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 14px;
}

.success-message {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 14px;
}

/* 用户控制台 */
.dashboard-page {
  flex: 1;
  padding: 40px 0;
}

.dashboard-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.user-header h1 {
  font-size: 28px;
}

.user-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-item {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.create-key-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.create-key-section h2 {
  font-size: 18px;
  margin-bottom: 20px;
}

.create-key-form .form-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.create-key-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

.create-key-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}

.create-key-form select,
.create-key-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

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

.keys-section h2 {
  font-size: 18px;
  margin-bottom: 20px;
}

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

.key-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.key-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.key-header h3 {
  font-size: 16px;
}

.platform-badge {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.key-value {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.key-value code {
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  word-break: break-all;
  flex: 1;
}

.btn-copy {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

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

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

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

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

.btn-warning {
  background: var(--warning) !important;
  color: white !important;
}

.empty-keys {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
  color: var(--text-muted);
}

/* API调用说明 */
.api-guide-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.api-guide-section h2 {
  font-size: 18px;
  margin-bottom: 20px;
}

.api-guide-section h3 {
  font-size: 16px;
  margin: 20px 0 12px;
  color: var(--text-muted);
}

.guide-content p {
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.guide-content pre {
  background: var(--bg);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.guide-content code {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 13px;
  line-height: 1.5;
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
}

.modal-content h3 {
  margin-bottom: 20px;
  font-size: 18px;
}

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

/* 充值页面 */
.recharge-page {
  flex: 1;
  padding: 20px 0 40px 0;
}

.recharge-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.recharge-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.recharge-card h1 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 28px;
}

.current-points {
  text-align: center;
  margin-bottom: 30px;
  font-size: 18px;
  color: var(--text-muted);
}

.current-points strong {
  color: var(--primary);
  font-size: 28px;
  margin-left: 8px;
}

.packages-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 0;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.package-card {
  flex: 0 0 260px;
  max-width: 260px;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.package-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.package-card:hover {
  transform: translateY(-8px);
  border-color: transparent;
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
}

.package-card:hover::before {
  opacity: 1;
}

.package-badge {
  position: absolute;
  top: 12px;
  right: -30px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 35px;
  transform: rotate(45deg);
}

.package-price {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  line-height: 1.2;
}

.package-price small {
  font-size: 14px;
  font-weight: 500;
  -webkit-text-fill-color: var(--text-muted);
}

.package-points {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 12px 0;
}

.package-points span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

.package-ratio {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}

.btn-recharge-package {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.btn-recharge-package:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
}

.modal-recharge {
  max-width: 420px;
  text-align: center;
}

.modal-recharge h3 {
  margin-bottom: 24px;
  font-size: 22px;
}

.recharge-summary {
  background: rgba(79, 70, 229, 0.1);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.recharge-summary p {
  margin: 10px 0;
  font-size: 16px;
}

.recharge-summary strong {
  color: var(--primary);
  font-size: 24px;
}

.qrcode-section {
  margin-top: 20px;
}

.qrcode-section .qrcode-wrapper {
  background: white;
  border-radius: 12px;
  padding: 15px;
  display: inline-block;
}

.qrcode-section .qrcode-wrapper img {
  width: 180px;
  height: 180px;
  display: block;
}

.qrcode-section .qrcode-hint {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.package-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.package-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.recharge-tips {
  background: var(--bg);
  border-radius: 12px;
  padding: 24px;
}

.recharge-tips h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.recharge-tips ul {
  list-style: none;
  padding: 0;
}

.recharge-tips li {
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 14px;
  padding-left: 20px;
  position: relative;
}

.recharge-tips li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
}

.empty-packages {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* API密钥卡片网格 */
.api-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.api-card {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.api-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.api-card-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: white;
}

.api-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.api-card-title h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.8);
  color: white;
}

.platform-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 13px;
}

.api-card-body {
  padding: 20px;
}

.api-key-display {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.api-key-display code {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 8px;
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy {
  padding: 10px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.api-card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.api-card-footer form {
  flex: 1;
  min-width: 60px;
}

.api-card-footer .btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
}

.empty-keys {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  color: var(--text-muted);
  opacity: 0.5;
  margin-bottom: 20px;
}

.empty-keys p {
  color: var(--text-muted);
  font-size: 15px;
}

.empty-keys p:first-of-type {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

/* 响应式 */
@media (max-width: 1024px) {
  .api-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .api-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .header-content {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 24px;
  }
  
  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 12px;
  }
  
  .hero h1 {
    font-size: 32px;
  }
  
  .hero p {
    font-size: 16px;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .create-key-form .form-row {
    flex-direction: column;
  }
  
  .key-card {
    flex-direction: column;
  }
  
  .user-header {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
}

/* API选择提示 */
.api-info-tip {
  margin-top: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
}

.api-info-tip strong {
  color: var(--primary);
}

/* API元信息 */
.api-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.api-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.api-meta span::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
}

/* ==================== 弹窗样式 ==================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 400px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--border);
  color: var(--text);
  font-size: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--danger);
  color: white;
}

.modal-content h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 24px;
  color: var(--text);
}

.modal-content .form-group {
  margin-bottom: 20px;
}

.modal-content .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.modal-content .form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  transition: all 0.2s;
}

.modal-content .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.modal-content .form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  transition: all 0.2s;
}

.modal-content .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 弹窗表单样式 - 确保高优先级 */
#loginModal input[type="tel"],
#loginModal input[type="password"],
#loginModal input[type="text"],
#registerModal input[type="tel"],
#registerModal input[type="password"],
#registerModal input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg) !important;
  color: var(--text) !important;
  font-size: 15px;
  transition: all 0.2s;
  box-sizing: border-box;
}

#loginModal .form-group,
#registerModal .form-group {
  margin-bottom: 16px;
}

#loginModal .form-group label,
#registerModal .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

.code-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.code-input-group input {
  flex: 1;
  background: var(--card-bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
}

.btn-code {
  padding: 14px 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #9333ea 100%);
  color: white;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  min-width: 110px;
  text-align: center;
}

.btn-code:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.btn-code:active:not(:disabled) {
  transform: translateY(0);
}

.btn-code:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.modal-content .btn-block {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  letter-spacing: 2px;
}

.modal-content .btn-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.modal-content .btn-block:active {
  transform: translateY(0);
}

.modal-content .btn-block:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.modal-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.modal-footer a {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
}

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

/* 表格样式 */
.table-responsive {
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.keys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 800px;
}

.keys-table th,
.keys-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

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

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

.keys-table td {
  color: var(--text);
}

.key-code {
  font-family: 'Courier New', monospace;
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--primary);
  word-break: keep-all;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 8px;
}

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

.actions {
  white-space: nowrap;
}

.inline-form {
  display: inline-block;
  margin: 0 2px;
}

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

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* 暗色模式表格适配 */
.dark-mode .keys-table th {
  background: #1a2332;
}

.dark-mode .keys-table tbody tr:hover {
  background: #1a2332;
}

.dark-mode .key-code {
  background: #1a2332;
}

/* 积分记录页面 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 600;
}

.current-points {
  background: var(--card-bg);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
}

.points-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--primary-color);
  margin-left: 8px;
}

.records-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 12px 32px;
  border: none;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

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

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

.records-section {
  display: none;
}

.records-section.active {
  display: block;
}

.records-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.records-table th {
  background: var(--header-bg);
  padding: 16px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.records-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

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

.points-add {
  color: #22c55e;
  font-weight: 600;
}

.points-minus {
  color: #ef4444;
  font-weight: 600;
}

.empty-row {
  text-align: center;
  color: var(--muted-color);
  padding: 40px !important;
}

/* 暗色模式适配 */
.dark-mode .records-table th {
  background: #1a2332;
}

.dark-mode .records-table tbody tr:hover {
  background: #1a2332;
}

/* 用户中心页面 */
.user-center-page {
  min-height: calc(100vh - 70px);
  padding: 30px 20px;
  background: var(--body-bg);
}

.user-center-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 30px;
}

/* 左侧导航 */
.user-center-sidebar {
  width: 280px;
  flex-shrink: 0;
}

.sidebar-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.sidebar-card:hover {
  border-color: var(--primary-color);
  transform: translateX(5px);
}

.sidebar-card.active {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
}

.sidebar-icon {
  width: 48px;
  height: 48px;
  background: var(--hover-bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary-color);
}

.sidebar-card.active .sidebar-icon {
  background: rgba(255,255,255,0.2);
}

.sidebar-card.active .sidebar-icon svg {
  color: white;
}

.sidebar-text {
  flex: 1;
}

.sidebar-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.sidebar-desc {
  display: block;
  font-size: 13px;
  color: var(--muted-color);
}

.sidebar-card.active .sidebar-desc {
  color: rgba(255,255,255,0.8);
}

/* 用户信息卡片 */
.user-info-card {
  background: linear-gradient(135deg, var(--primary-color), #6366f1);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
}

.user-avatar {
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
}

.user-details {
  flex: 1;
}

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

.user-points {
  display: block;
  font-size: 13px;
  opacity: 0.9;
}

/* 右侧内容区 */
.user-center-content {
  flex: 1;
  min-width: 0;
}

.content-section {
  display: none;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.content-section.active {
  display: block;
}

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

.section-header h2 {
  font-size: 22px;
  font-weight: 600;
}

/* 密钥表格 */
.table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  background: var(--hover-bg);
}

.keys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.keys-table th {
  background: var(--header-bg);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.keys-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

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

.api-key {
  background: var(--hover-bg);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}

.btn-action {
  display: inline-block;
  padding: 6px 12px;
  background: var(--hover-bg);
  color: var(--text-color);
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  margin-right: 6px;
  transition: all 0.3s;
}

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

.btn-delete {
  color: #ef4444;
}

.btn-delete:hover {
  background: #ef4444;
  color: white;
}

.empty-cell {
  text-align: center;
  color: var(--muted-color);
  padding: 40px !important;
}

/* API文档 */
.api-doc-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

.api-doc-section h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.doc-item h4 {
  font-size: 15px;
  margin: 20px 0 10px 0;
  color: var(--text-color);
}

.code-block {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}

/* 记录表格 */
.records-table-wrapper {
  border-radius: 10px;
  background: var(--hover-bg);
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.records-table th {
  background: var(--header-bg);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.records-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

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

.points-add {
  color: #22c55e;
  font-weight: 600;
}

.points-minus {
  color: #ef4444;
  font-weight: 600;
}

/* 暗色模式适配 */
.dark-mode .sidebar-card {
  background: #1e293b;
}

.dark-mode .sidebar-card:hover {
  background: #334155;
}

.dark-mode .keys-table th,
.dark-mode .records-table th {
  background: #0f172a;
}

.dark-mode .keys-table tbody tr:hover,
.dark-mode .records-table tbody tr:hover {
  background: #1e293b;
}

/* 响应式 */
@media (max-width: 900px) {
  .user-center-container {
    flex-direction: column;
  }
  
  .user-center-sidebar {
    width: 100%;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
  }
  
  .sidebar-card {
    min-width: 150px;
    margin-bottom: 0;
  }
  
  .user-info-card {
    display: none;
  }
}
