/* ==================== Gemini 风格设计系统 ==================== */

:root {
  /* 色彩系统 - 资源夜市清爽风格 */
  --primary: #5ac8fa;
  --primary-light: #8ed8ff;
  --primary-dark: #3ab4e8;
  --success: #2563EB;
  --warning: #FF9500;
  --danger: #FF3B30;
  --gold: #D6B26E;
  --gold-light: #E6C37A;

  /* 渐变背景 */
  --gradient-bg: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
  --gradient-hero: linear-gradient(180deg, #f5f7fa 0%, #ffffff 100%);
  --gradient-gold: linear-gradient(135deg, #D6B26E 0%, #E6C37A 100%);
  --gradient-blue: linear-gradient(135deg, #5ac8fa 0%, #8ed8ff 100%);

  /* 玻璃拟态 */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-dark: rgba(0, 0, 0, 0.05);
  --glass-border: rgba(0, 0, 0, 0.08);
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);

  /* 文字 */
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;

  /* 间距 */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  /* 过渡 */
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 基础重置 ==================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #FFFFFF;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== 顶部导航栏 ==================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 12px 16px;
}

.navbar-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-blue);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.slogan-bar {
  background: rgba(0, 113, 227, 0.05);
  border: 1px solid rgba(0, 113, 227, 0.1);
  border-radius: 30px;
  padding: 8px 16px;
  font-size: 0.75rem;
  color: var(--primary);
  margin-left: 20px;
  white-space: nowrap;
}

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

/* ==================== 按钮 ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-blue);
  color: white;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.4);
}

.btn-gold {
  background: var(--gradient-gold);
  color: #1d1d1f;
  box-shadow: 0 4px 14px rgba(214, 178, 110, 0.3);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(214, 178, 110, 0.4);
}

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

.btn-ghost:hover {
  background: rgba(0, 113, 227, 0.05);
}

.btn:active {
  transform: scale(0.98);
}

/* ==================== 顶部滑动标签 ==================== */

.scroll-tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 14px 0;
  background: white;
  border-bottom: 1px solid var(--glass-border);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-tabs::-webkit-scrollbar {
  display: none;
}

.tab-item {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding-bottom: 8px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

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

/* ==================== 主内容区 ==================== */

.main-container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 140px;
  min-height: 100vh;
}

/* ==================== 左侧分类栏 ==================== */

.left-category {
  width: 80px;
  min-width: 80px;
  background: #f9f9fb;
  border-right: 1px solid var(--glass-border);
  padding: 16px 0;
  height: calc(100vh - 140px);
  position: sticky;
  top: 140px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.left-category::-webkit-scrollbar {
  display: none;
}

.category-item {
  padding: 14px 4px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  line-height: 1.3;
}

.category-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.category-item.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}

/* ==================== 右侧卡片区 ==================== */

.content-area {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

/* ==================== 卡片网格 ==================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

/* ==================== 资源卡片 ==================== */

.resource-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

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

.qr-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(145deg, #e8e8ed, #d4d4d8);
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88%;
  height: 80%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-md);
  padding: 8px;
  font-size: 0.6rem;
  color: var(--text-primary);
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.qr-overlay span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--primary);
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3);
  z-index: 2;
}

.card-tag.senior {
  background: var(--primary-dark);
}

.card-tag.normal {
  background: var(--text-muted);
}

.card-tag.vip {
  background: linear-gradient(135deg, #D6B26E, #E6C37A);
  color: #1d1d1f;
}

.card-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* ==================== 底部导航 ==================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 8px 0;
  display: flex;
  justify-content: space-around;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
  cursor: pointer;
  min-width: 60px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item:hover {
  background: rgba(90, 200, 250, 0.1);
}

.nav-item-icon {
  font-size: 22px;
}

.nav-item-text {
  font-size: 0.65rem;
  font-weight: 500;
}

/* ==================== 浮动操作按钮 ==================== */

.fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-blue);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.4);
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 90;
  border: none;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(0, 113, 227, 0.5);
}

/* ==================== 登录页样式 ==================== */

.login-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: #0b0b0b;
}

.login-frame {
  width: 100%;
  max-width: 375px;
  background: #0b0b0b;
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid #3a2e1c;
}

.login-header {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #3a2e1a;
}

.back-btn {
  font-size: 1.5rem;
  color: #b4a582;
  cursor: pointer;
  width: 32px;
}

.login-title {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #cfb87c;
}

.login-content {
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo {
  margin-bottom: 40px;
  text-align: center;
}

.login-logo-icon {
  width: 80px;
  height: 80px;
  background: #1a170f;
  border: 2px solid #cfb87c;
  border-radius: 50%;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #cfb87c;
}

.login-logo h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #cfb87c;
  letter-spacing: 1px;
}

.login-logo p {
  font-size: 0.8rem;
  color: #b4a582;
  margin-top: 5px;
}

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

.form-label {
  display: block;
  font-size: 0.8rem;
  color: #b4a582;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.input-wrapper {
  width: 100%;
  background: #1a170f;
  border: 1px solid #5f512f;
  border-radius: 30px;
  padding: 14px 20px;
  transition: var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: #cfb87c;
}

.input-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #f0e2c5;
  font-size: 1rem;
}

.input-wrapper input::placeholder {
  color: #5f543b;
  font-size: 0.9rem;
}

.login-btn-full {
  width: 100%;
  background: var(--gradient-gold);
  border: none;
  border-radius: 40px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #121212;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-top: 20px;
  margin-bottom: 30px;
}

.login-btn-full:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.login-extra {
  text-align: center;
  color: #b4a582;
  font-size: 0.9rem;
}

.login-extra a {
  color: #cfb87c;
  text-decoration: none;
  font-weight: 500;
}

.divider {
  width: 100%;
  text-align: center;
  margin: 30px 0 15px;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #3a2e1a;
  z-index: 1;
}

.divider span {
  background: #0b0b0b;
  padding: 0 15px;
  color: #5f543b;
  font-size: 0.8rem;
  position: relative;
  z-index: 2;
}

/* ==================== 详情页样式 ==================== */

.detail-page {
  padding: 16px;
  padding-bottom: 100px;
}

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

.back-icon {
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
}

.page-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.detail-meta {
  display: flex;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.section-card {
  background: #f9f9fb;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--glass-border);
}

.section-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-item {
  background: #e8e8ed;
  color: var(--text-primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
}

.rule-item {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.rule-item::before {
  content: "•";
  color: var(--primary);
  flex-shrink: 0;
}

.qr-section {
  background: #f9f9fb;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--glass-border);
  text-align: center;
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.qr-image-large {
  width: 180px;
  height: 180px;
  background: #e6e6ea;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 14px;
  margin-bottom: 8px;
  border: 1px solid #ddd;
}

.qr-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.refer-btn {
  width: 100%;
  background: var(--gradient-blue);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin: 16px 0;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.3);
}

.stats-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 12px 0;
  border-top: 1px solid var(--glass-border);
}

/* ==================== Toast 提示 ==================== */

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 14px 28px;
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 300;
  opacity: 0;
  transition: var(--transition-smooth);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error {
  background: linear-gradient(135deg, #FF3B30 0%, #FF453A 100%);
}

.toast.success {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
}

/* ==================== 空状态 ==================== */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

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

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 0.9rem;
}

/* ==================== 动画 ==================== */

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

.animate-in {
  animation: fadeInUp 0.4s ease-out forwards;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.05) 25%,
    rgba(255,255,255,0.1) 50%,
    rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ==================== 响应式 ==================== */

@media (max-width: 768px) {
  .left-category {
    display: none;
  }

  .main-container {
    padding-top: 120px;
  }

  .slogan-bar {
    display: none;
  }

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

@media (min-width: 769px) {
  .bottom-nav {
    display: none;
  }

  .fab {
    bottom: 30px;
  }
}
