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

:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --dark: #1f2937;
  --light: #f9fafb;
  --border: #e5e7eb;
  --text: #374151;
  --text-light: #6b7280;
}

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

/* 登录页面布局 */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
}

.login-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
}

.login-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  opacity: 0.9;
}

.login-body {
  padding: 30px;
}

/* 标签页 */
.tab-content {
  display: none;
}

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

/* 用户中心布局 */
.user-layout {
  display: flex;
  min-height: 100vh;
}

.user-sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  z-index: 1000;
}

.sidebar-header {
  padding: 30px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 5px;
}

.sidebar-subtitle {
  font-size: 13px;
  opacity: 0.8;
}

.sidebar-user {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

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

.user-email {
  font-size: 12px;
  opacity: 0.8;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  border-left-color: white;
}

.nav-icon {
  font-size: 20px;
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  background: var(--light);
}

.topbar {
  background: white;
  padding: 20px 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.content-area {
  padding: 30px;
}

/* 卡片 */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.card-body {
  padding: 24px;
}

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

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.primary { background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); }

.stat-content {
  flex: 1;
}

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

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

/* 信息网格 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.info-item {
  padding: 15px;
  background: var(--light);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.info-item label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item div {
  font-size: 14px;
  font-weight: 500;
  color: var(--dark);
}

/* 表单 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

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

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

.form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 5px;
}

/* 按钮 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

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

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

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

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

/* 订阅盒子 */
.subscription-box {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border: 2px dashed var(--primary);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.subscription-url {
  background: white;
  padding: 15px;
  border-radius: 8px;
  word-break: break-all;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--dark);
  margin: 15px 0;
  border: 1px solid var(--border);
}

/* 套餐卡片 */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.plan-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.plan-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.plan-card.featured {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  position: relative;
}

.plan-badge {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
}

.plan-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
}

.plan-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin: 15px 0;
}

.plan-price small {
  font-size: 14px;
  color: var(--text-light);
}

.plan-features {
  list-style: none;
  margin: 20px 0;
  text-align: left;
}

.plan-features li {
  padding: 8px 0;
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features li:before {
  content: "✓";
  color: var(--primary);
  font-weight: bold;
  font-size: 16px;
}

/* 提示消息 */
#message {
  position: sticky;
  top: 20px;
  z-index: 1000;
  margin: 20px 0;
}

.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
}

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

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success);
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid var(--info);
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--warning);
}

/* 教程盒子 */
.tutorial {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.tutorial h3 {
  color: #856404;
  margin-bottom: 15px;
  font-size: 16px;
}

.tutorial ol {
  margin-left: 20px;
  color: #856404;
}

.tutorial li {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.6;
}

.tutorial p {
  margin-top: 15px;
  font-size: 13px;
  line-height: 1.6;
}

/* 工具类 */
.hidden {
  display: none !important;
}

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

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

.text-muted {
  color: var(--text-light);
}

/* 响应式 */
@media (max-width: 768px) {
  .user-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .sidebar-footer {
    position: relative;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .plans-grid {
    grid-template-columns: 1fr;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
}
