/**
 * fluentx 个人中心样式
 * 左侧菜单 + 右侧内容区布局
 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   整体容器布局
   ============================================ */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   左侧边栏
   ============================================ */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.sidebar-title {
  font-size: 24px;
  font-weight: 700;
  color: white;
}

/* ============================================
   导航菜单
   ============================================ */
.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

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

.nav-item.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-text {
  font-size: 14px;
}

/* ============================================
   侧边栏用户卡片
   ============================================ */
.sidebar-user-card {
  padding: 16px;
  margin: 0 12px 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
}

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

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

.sidebar-user-email {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   侧边栏底部
   ============================================ */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
}

.sidebar-footer-link:hover {
  color: white;
}

.footer-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ============================================
   主内容区域
   ============================================ */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  max-width: 1200px;
}

.page-content {
  display: none;
}

.page-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.page-description {
  font-size: 16px;
  color: #6b7280;
  line-height: 1.6;
}

/* ============================================
   卡片样式
   ============================================ */
.settings-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.card-description {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ============================================
   语言网格
   ============================================ */
.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* ============================================
   功能开关样式
   ============================================ */
.feature-toggle {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 16px;
  transition: background 0.2s;
}

.feature-toggle:hover {
  background: #f3f4f6;
}

.feature-toggle-info {
  flex: 1;
  margin-right: 16px;
}

.feature-toggle-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.feature-toggle-description {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

/* 开关样式 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #667eea;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.language-card {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.language-card:hover {
  border-color: #667eea;
  background: #f5f7ff;
  transform: translateY(-2px);
}

.language-card.selected {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.language-flag {
  font-size: 32px;
}

.language-name {
  font-size: 13px;
  font-weight: 500;
}

/* ============================================
   登录区域
   ============================================ */
.login-section {
  text-align: center;
  padding: 32px;
  background: #f9fafb;
  border-radius: 12px;
}

.login-prompt {
  font-size: 15px;
  color: #4b5563;
  margin-bottom: 20px;
}

.google-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.google-login-btn:hover {
  border-color: #667eea;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.google-login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.google-icon {
  width: 20px;
  height: 20px;
}

.error-message {
  color: #dc2626;
  font-size: 14px;
  margin-top: 12px;
  padding: 12px;
  background: #fef2f2;
  border-radius: 8px;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f4f6;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ============================================
   用户信息区域
   ============================================ */
.user-info-section {
  padding: 24px;
  background: #f9fafb;
  border-radius: 12px;
}

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

.user-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #667eea;
  object-fit: cover;
}

.user-details {
  flex: 1;
}

.user-name-large {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.user-email-large {
  font-size: 14px;
  color: #6b7280;
}

.logout-btn {
  padding: 10px 24px;
  background: transparent;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

/* ============================================
   提示卡片
   ============================================ */
.prompt-card {
  background: white;
  border-radius: 16px;
  padding: 48px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.prompt-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.prompt-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 12px;
}

.prompt-description {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 24px;
  line-height: 1.6;
}

.primary-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

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

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

/* ============================================
   订阅状态卡片
   ============================================ */
.subscription-status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.status-content {
  flex: 1;
  text-align: center;
  width: 100%;
}

.subscription-status-card.status-inactive {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.subscription-status-card.status-trial {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.subscription-status-card.status-active {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.subscription-status-card.status-expired {
  background: linear-gradient(135deg, #fee 0%, #fecaca 100%);
}

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

.status-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.status-description {
  font-size: 16px;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 20px;
}

.website-link-container {
  margin-top: 20px;
  text-align: center;
}

.website-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  color: #1f2937;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.website-link:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.website-link-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* ============================================
   信息框
   ============================================ */
.info-box {
  background: #f9fafb;
  border-left: 4px solid #667eea;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.info-box-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
}

.info-list {
  list-style: none;
  counter-reset: step-counter;
  padding-left: 0;
}

.info-list li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 36px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
}

.info-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.info-list a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.info-list a:hover {
  text-decoration: underline;
}

/* ============================================
   激活码输入
   ============================================ */
/* 激活码获取说明 */
.activation-help {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-left: 4px solid #667eea;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.help-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 12px 0;
}

.help-list {
  margin: 0;
  padding-left: 24px;
  color: #4b5563;
  line-height: 1.8;
}

.help-list li {
  margin-bottom: 8px;
  font-size: 14px;
}

.help-list a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.help-list a:hover {
  color: #764ba2;
  text-decoration: underline;
}

.help-list strong {
  color: #667eea;
  font-weight: 600;
  background: rgba(102, 126, 234, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.activation-input-section {
  max-width: 600px;
  margin: 0 auto;
}

/* 二维码盒子 */
.qrcode-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  padding: 20px;
  min-width: 180px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.qrcode-img {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 12px;
  display: block;
  background: white;
  padding: 8px;
}

.qrcode-text {
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
  margin: 0;
  text-align: center;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.input-with-button {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.activation-input {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 16px;
  font-family: monospace;
  text-transform: uppercase;
  transition: all 0.2s;
}

.activation-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.message-box {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.message-box.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.message-box.error {
  background: #fee;
  color: #dc2626;
  border: 1px solid #ef4444;
}

/* ============================================
   全局消息提示
   ============================================ */
.toast-message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

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

.toast-message.success {
  border-left: 4px solid #10b981;
  color: #065f46;
}

.toast-message.error {
  border-left: 4px solid #ef4444;
  color: #dc2626;
}

.toast-message.info {
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }

  .main-content {
    margin-left: 220px;
    padding: 24px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 70px;
  }

  .sidebar-title,
  .nav-text,
  .sidebar-user-card,
  .sidebar-footer-link span {
    display: none;
  }

  .sidebar-header {
    justify-content: center;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
  }

  .main-content {
    margin-left: 70px;
    padding: 20px;
  }

  .language-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .input-with-button {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .page-title {
    font-size: 24px;
  }

  .settings-card {
    padding: 20px;
  }

  .language-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
