/* 全局样式 */
:root {
  --primary-color: #4a6cf7;
  --primary-hover: #3a5ce5;
  --secondary-color: #6c757d;
  --background-color: #f8f9fa;
  --text-color: #333;
  --light-text: #6c757d;
  --border-color: #dee2e6;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.2;
}

/* 导航栏样式 */
.main-nav {
  background-color: #fff;
  box-shadow: var(--shadow);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.nav-link:hover {
  background-color: rgba(74, 108, 247, 0.1);
  text-decoration: none;
}

.nav-link.active {
  color: var(--primary-color);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* 英雄区域样式 */
.hero {
  background-color: var(--primary-color);
  color: white;
  padding: 60px 0;
  margin-bottom: 40px;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.hero .lead {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
  opacity: 0.9;
}

/* 按钮样式 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

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

.secondary-button {
  background-color: var(--secondary-color);
  color: white;
}

.secondary-button:hover {
  background-color: #5a6268;
}

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

.outline-button:hover {
  background-color: rgba(74, 108, 247, 0.1);
}

/* 卡片样式 */
.card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

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

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

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

/* 统计卡片网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background-color: rgba(74, 108, 247, 0.1);
  color: var(--primary-color);
  border-radius: 50%;
  font-size: 24px;
  margin-bottom: 16px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.stat-label {
  font-size: 1rem;
  color: var(--light-text);
}

/* 应用卡片网格 */
.apps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.search-container {
  position: relative;
  width: 300px;
}

.search-input {
  width: 100%;
  padding: 12px 40px 12px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--light-text);
}

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

.app-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: transform 0.3s ease;
}

.app-card:hover {
  transform: translateY(-5px);
}

.app-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.app-id, .app-key {
  background-color: #f0f2f5;
  padding: 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.875rem;
  margin-bottom: 12px;
  word-break: break-all;
}

.app-detail {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.app-label {
  font-weight: 500;
  color: var(--light-text);
}

.app-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.app-card.loading-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(74, 108, 247, 0.1);
  border-radius: 50%;
  border-top: 4px solid var(--primary-color);
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 600px;
  animation: modalFadeIn 0.3s;
}

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

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

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-modal {
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

/* 页脚样式 */
.footer {
  background-color: white;
  padding: 30px 0;
  margin-top: 60px;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

/* 登录和注册页面样式 */
.auth-container {
  max-width: 500px;
  margin: 80px auto;
  padding: 40px;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.auth-title {
  text-align: center;
  margin-bottom: 30px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
}

/* 首页样式 */
.home-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin: 60px 0;
}

.feature-item {
  text-align: center;
  padding: 30px;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-10px);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background-color: rgba(74, 108, 247, 0.1);
  color: var(--primary-color);
  border-radius: 50%;
  font-size: 32px;
  margin-bottom: 24px;
}

.feature-title {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.home-actions {
  text-align: center;
  margin: 60px 0;
}

/* Dashboard特定样式 */
.app-info-section {
  margin-bottom: 30px;
}

.token-usage-container {
  margin-bottom: 30px;
}

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

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

.users-table th {
  font-weight: 600;
  background-color: #f8f9fa;
}

.users-table tbody tr:hover {
  background-color: #f8f9fa;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
}

.status-inactive {
  background-color: rgba(108, 117, 125, 0.1);
  color: var(--secondary-color);
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.refresh-button:hover {
  transform: rotate(180deg);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .hero {
    padding: 40px 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .apps-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .search-container {
    width: 100%;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
} 