/**
 * style.css - 全局样式
 * 主色调：深蓝#1a3a5c + 金色#c9a23e
 * 手机端优先，响应式设计
 */

/* ========== 基础重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --gold: #c9a23e;
  --gold-light: #e0be6a;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #e0e0e0;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(26, 58, 92, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 70px; /* 为底部footer留空间 */
}

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

/* ========== 顶部导航栏 ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar .brand {
  font-size: 18px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 6px;
}

.navbar .brand .gold {
  color: var(--gold);
}

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

.navbar .nav-actions a,
.navbar .nav-actions button {
  color: white;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}

.navbar .nav-actions a:hover,
.navbar .nav-actions button:hover {
  color: var(--gold-light);
}

/* ========== 底部品牌Footer ========== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--primary);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 10px 16px;
  font-size: 12px;
  z-index: 100;
}

.footer .brand-name {
  color: var(--gold);
  font-weight: 600;
}

/* ========== 搜索和筛选区 ========== */
.search-bar {
  background: white;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.search-input-wrap {
  position: relative;
  margin-bottom: 10px;
}

.search-input-wrap input {
  width: 100%;
  padding: 10px 40px 10px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input-wrap input:focus {
  border-color: var(--primary);
}

.search-input-wrap .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  background: white;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-btn.free-btn {
  color: #c9a23e;
  border-color: rgba(201,162,62,0.5);
  background: rgba(201,162,62,0.08);
}
.filter-btn.free-btn.active,
.filter-btn.free-btn:hover {
  background: linear-gradient(135deg, #c9a23e, #e0be6a);
  color: #1a2a3a;
  border-color: #c9a23e;
  font-weight: 600;
}

/* ========== 卡片网格 ========== */
.card-grid {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========== 专业卡片 ========== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid var(--primary);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(26, 58, 92, 0.15);
}

.card.differentiated {
  border-left-color: var(--gold);
}

.card .card-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.card .card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: rgba(26, 58, 92, 0.08);
  color: var(--primary);
}

.card .tag.gold {
  background: rgba(201, 162, 62, 0.15);
  color: #8b6914;
}

.card .tag.blurred {
  color: transparent;
  background: rgba(0, 0, 0, 0.06);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.card .lock-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 16px;
  color: var(--text-muted);
}

/* ========== 卡片详情页 ========== */
.detail-page {
  padding: 16px;
}

.detail-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.detail-header h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.detail-header .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  opacity: 0.9;
}

.detail-header .meta-row span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-section {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.detail-section h3 {
  font-size: 16px;
  color: var(--primary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-section .content {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
}

.detail-section .content .highlight {
  color: var(--gold);
  font-weight: 600;
}

/* 锁定提示 */
.lock-notice {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin: 16px;
}

.lock-notice .lock-icon-large {
  font-size: 40px;
  margin-bottom: 10px;
}

.lock-notice h3 {
  color: var(--primary);
  margin-bottom: 8px;
}

.lock-notice p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ========== 登录/注册页 ========== */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
}

.auth-card {
  background: white;
  border-radius: var(--radius);
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.auth-card .auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-card .auth-logo h2 {
  color: var(--primary);
  font-size: 22px;
}

.auth-card .auth-logo p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

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

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
}

.btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: white;
}

.btn-gold:hover {
  opacity: 0.9;
}

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

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

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  width: auto;
  display: inline-block;
}

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

.btn-danger:hover {
  opacity: 0.9;
}

.auth-links {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-light);
}

.auth-links a {
  color: var(--primary);
  font-weight: 600;
}

/* ========== 个人中心 ========== */
.profile-page {
  padding: 16px;
}

.profile-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: 16px;
}

.profile-card .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
}

.profile-card .phone {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
}

.profile-card .status {
  margin-top: 8px;
  font-size: 14px;
}

.profile-card .status.active {
  color: var(--success);
}

.profile-card .status.inactive {
  color: var(--danger);
}

.profile-info {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.profile-info .info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.profile-info .info-row:last-child {
  border-bottom: none;
}

.profile-info .info-label {
  color: var(--text-muted);
}

.profile-info .info-value {
  color: var(--text);
  font-weight: 500;
}

/* ========== 管理端通用 ========== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  background: var(--primary);
  color: white;
  padding: 20px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.admin-sidebar .sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.admin-sidebar .sidebar-brand h3 {
  font-size: 16px;
  color: var(--gold);
}

.admin-sidebar .sidebar-brand p {
  font-size: 12px;
  opacity: 0.6;
}

.admin-sidebar .nav-item {
  display: block;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  transition: all 0.2s;
}

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

.admin-sidebar .nav-item.active {
  border-left: 3px solid var(--gold);
}

.admin-main {
  margin-left: 220px;
  flex: 1;
  padding: 24px;
  min-height: 100vh;
  background: var(--bg);
}

.admin-main h2 {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 20px;
}

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

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

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

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-card.gold .stat-value {
  color: var(--gold);
}

/* 管理端表格 */
.data-table-wrap {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.data-table th {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
  background: rgba(26, 58, 92, 0.03);
}

.data-table .actions {
  display: flex;
  gap: 6px;
}

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.active {
  background: #e8f5e9;
  color: var(--success);
}

.status-badge.inactive {
  background: #fce4ec;
  color: var(--danger);
}

.status-badge.admin {
  background: #e3f2fd;
  color: var(--primary);
}

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

.modal-overlay.show {
  display: flex;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h3 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 16px;
}

/* Toast提示 */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  transition: all 0.3s;
  opacity: 0;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

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

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

.toast.warning {
  background: var(--warning);
  color: white;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 16px;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 13px;
}

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

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 加载中 */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

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

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* 手机端管理端适配 */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 100%;
    position: relative;
    display: flex;
    overflow-x: auto;
    padding: 10px;
  }

  .admin-sidebar .sidebar-brand {
    display: none;
  }

  .admin-sidebar .nav-item {
    padding: 8px 14px;
    white-space: nowrap;
    font-size: 13px;
  }

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

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

  .data-table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 8px;
  }
}

/* 返回按钮 */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  background: none;
  border: none;
}

.back-btn:hover {
  color: var(--primary-light);
}

/* 卡片详情中的标签 */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.detail-tags .tag {
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  background: rgba(26, 58, 92, 0.08);
  color: var(--primary);
}

.detail-tags .tag.gold {
  background: rgba(201, 162, 62, 0.15);
  color: #8b6914;
}

/* 组合标签 */
.combo-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  background: #e3f2fd;
  color: var(--primary);
  margin: 2px;
}

/* 搜索结果计数 */
.result-count {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* 响应式微调 */
@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
