/* ============================================================
   德斯合伙人前端 - 统一样式 (Dark Gold Theme)
   ============================================================ */

:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #151515;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --bg-input: #1e1e1e;
  --bg-header: #111;
  --gold: #c9a96e;
  --gold-light: #d4b87a;
  --gold-dark: #a88a4f;
  --gold-dim: #8b7355;
  --text-primary: #e8e8e8;
  --text-secondary: #aaa;
  --text-dim: #777;
  --text-gold: #c9a96e;
  --border: #2a2a2a;
  --border-light: #333;
  --danger: #e05555;
  --danger-bg: rgba(224, 85, 85, 0.12);
  --success: #4caf50;
  --success-bg: rgba(76, 175, 80, 0.12);
  --warning: #e6a817;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.5);
  --transition: 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
}

/* ---- Header ---- */
.page-header {
  background: var(--bg-header);
  padding: 0 16px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.page-header .back-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 20px;
  border-radius: 50%;
  transition: var(--transition);
}
.page-header .back-btn:hover { background: var(--bg-card); color: var(--gold); }
.page-header .title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}
.page-header .right-slot { width: 36px; }

/* ---- Navigation Tabs (Bottom) ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 56px;
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 11px;
  transition: var(--transition);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.bottom-nav .nav-item .nav-icon { font-size: 20px; }
.bottom-nav .nav-item.active { color: var(--gold); }
.bottom-nav .nav-item:hover { color: var(--gold-light); }

/* ---- Main Content ---- */
.page-content {
  padding: 16px;
  padding-bottom: 80px;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.card-title {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
}

/* ---- Gold Button ---- */
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #111;
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.5px;
}
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-light), var(--gold)); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,169,110,0.25); }
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-gold.block { display: block; width: 100%; }
.btn-gold.sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }

/* ---- Secondary Button ---- */
.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-secondary.block { display: block; width: 100%; }

/* ---- Outline Button ---- */
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover { border-color: var(--gold); background: rgba(201,169,110,0.08); }
.btn-outline.block { display: block; width: 100%; }

/* ---- Form Inputs ---- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,169,110,0.15); }
.form-input::placeholder { color: var(--text-dim); }

.form-input-row {
  display: flex; gap: 10px;
}
.form-input-row .form-input { flex: 1; }

/* ---- Checkbox ---- */
.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  accent-color: var(--gold);
  width: 16px; height: 16px;
}

/* ---- Data Highlight ---- */
.data-highlight {
  text-align: center;
  padding: 20px 0;
}
.data-highlight .label {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 4px;
}
.data-highlight .value {
  font-size: 32px; font-weight: 700; color: var(--gold);
  letter-spacing: 1px;
}
.data-highlight .unit {
  font-size: 16px; color: var(--gold);
  font-weight: 400;
}

/* ---- Data Cards (Horizontal) ---- */
.data-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.data-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}
.data-card-item .dc-label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.data-card-item .dc-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.data-card-item .dc-trend { font-size: 11px; margin-top: 4px; }
.dc-trend.up { color: var(--success); }
.dc-trend.down { color: var(--danger); }

/* ---- Table ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--bg-header);
  color: var(--text-dim);
  padding: 10px 8px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.data-table tr:hover td { background: var(--bg-card-hover); }
.data-table .amount { color: var(--gold); font-weight: 500; }

/* ---- List Items ---- */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item .li-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: rgba(201,169,110,0.1);
  color: var(--gold);
}
.list-item .li-info { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 15px; color: var(--text-primary); font-weight: 500; }
.list-item .li-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.list-item .li-arrow { color: var(--text-dim); font-size: 16px; }

/* ---- Tabs ---- */
.tabs {
  display: flex; gap: 0;
  margin-bottom: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 4px;
}
.tab-item {
  flex: 1; text-align: center;
  padding: 10px 0;
  font-size: 14px; color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.tab-item.active {
  background: var(--gold);
  color: #111;
  font-weight: 600;
}
.tab-item:hover:not(.active) { color: var(--text-secondary); }

/* ---- Status Badge ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: rgba(230,168,23,0.12); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

/* ---- Toast ---- */
.toast {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 999;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}
.toast.success { border-color: var(--gold); }
.toast.error { border-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---- Loading ---- */
.loading-spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 14px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Empty State ---- */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state .empty-text { font-size: 14px; }

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex; gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.filter-bar .form-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
}

/* ---- Avatar ---- */
.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--gold);
  overflow: hidden;
}
.avatar.sm { width: 40px; height: 40px; font-size: 18px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- QR Code Area ---- */
.qr-container {
  text-align: center; padding: 24px;
}
.qr-code {
  width: 180px; height: 180px;
  background: #fff;
  border-radius: var(--radius);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  color: #333;
  font-size: 13px;
}

/* ---- VIP Card ---- */
.vip-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.vip-card::before {
  content: ''; position: absolute;
  top: -50%; right: -50%;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(201,169,110,0.08) 0%, transparent 70%);
}
.vip-card .vc-title { font-size: 17px; font-weight: 700; color: var(--gold); position: relative; }
.vip-card .vc-sub { font-size: 13px; color: var(--text-secondary); margin-top: 6px; position: relative; }
.vip-card .vc-remaining { font-size: 13px; color: var(--text-dim); margin-top: 8px; position: relative; }
.vip-card .vc-actions { display: flex; gap: 10px; margin-top: 14px; position: relative; }
.vip-card .vc-actions .btn-gold,
.vip-card .vc-actions .btn-outline { flex: 1; }

/* ---- Video Card ---- */
.video-card {
  display: flex; gap: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.video-card:hover { border-color: var(--gold-dim); }
.video-card .vc-thumb {
  width: 100px; height: 64px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  color: var(--gold-dim);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.video-card .vc-thumb .play-icon {
  position: absolute;
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.video-card .vc-info { flex: 1; min-width: 0; }
.video-card .vc-info .vc-name { font-size: 14px; color: var(--text-primary); font-weight: 500; margin-bottom: 4px; }
.video-card .vc-info .vc-meta { font-size: 12px; color: var(--text-dim); }
.video-card .vc-progress { width: 100%; height: 3px; background: var(--border); border-radius: 2px; margin-top: 8px; }
.video-card .vc-progress .bar { height: 100%; background: var(--gold); border-radius: 2px; }

/* ---- Material Card ---- */
.material-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.material-card .mc-image {
  width: 100%; height: 160px;
  background: var(--bg-input);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
}
.material-card .mc-body { padding: 12px 14px; }
.material-card .mc-body .mc-text { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; }
.material-card .mc-body .btn-outline.sm { font-size: 12px; padding: 6px 14px; }

/* ---- Sent Record ---- */
.sent-record {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.sent-record .sr-time { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.sent-record .sr-content { flex: 1; font-size: 13px; color: var(--text-secondary); }
.sent-record .sr-status { font-size: 12px; }

/* ---- Center Section ---- */
.center-section {
  display: flex; flex-direction: column; align-items: center;
  padding: 30px 0;
}
.center-section .avatar { margin-bottom: 12px; }

/* ---- Auth Link ---- */
.auth-link {
  color: var(--gold);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }

/* ---- Scrollable ---- */
.scroll-area {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll-area::-webkit-scrollbar { width: 4px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ---- Grid Layouts ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- Misc ---- */
.text-gold { color: var(--gold); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---- Responsive ---- */
@media (max-width: 360px) {
  .data-cards { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .data-card-item { padding: 10px 6px; }
  .data-card-item .dc-value { font-size: 16px; }
  .data-highlight .value { font-size: 26px; }
}
