/* ========================================
   数信世界 · 鼎信铭片 - 全局样式
   暗色底 + 金色光效 + 翡翠绿点缀
   ======================================== */

:root {
  --bg-dark: #0a0a0a;
  --bg-card: #1a1a2e;
  --bg-elevated: #16213e;
  --gold: #FFD700;
  --gold-light: #FFED4A;
  --gold-dark: #B8860B;
  --jade: #00C9A7;
  --jade-light: #00E5C3;
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0B0;
  --text-muted: #6B6B80;
  --border-gold: rgba(255, 215, 0, 0.3);
  --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.2);
  --shadow-jade: 0 0 20px rgba(0, 201, 167, 0.2);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 全屏容器 */
.container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-card) 50%, var(--bg-dark) 100%);
}

/* ---- 头部 ---- */
.header {
  text-align: center;
  padding: 20px 16px;
  position: relative;
}

.header-title {
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.header-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- 铭片卡片 ---- */
.card-wrapper {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-body {
  width: 100%;
  background: linear-gradient(145deg, #1a1a2e 0%, #0f3460 100%);
  border-radius: 20px;
  padding: 40px 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-gold);
}

/* 金色边框光效动画 */
.card-body::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 22px;
  background: linear-gradient(45deg, var(--gold), transparent, var(--gold), transparent);
  z-index: -1;
  animation: borderGlow 4s linear infinite;
  opacity: 0.5;
}

@keyframes borderGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 背景装饰 */
.card-body::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 215, 0, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

/* ---- 头像 ---- */
.avatar-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 16px;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  position: relative;
  z-index: 2;
}

/* 头像光圈动效 */
.avatar-glow {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: conic-gradient(var(--gold), transparent, var(--jade), transparent, var(--gold));
  animation: spinGlow 3s linear infinite;
  z-index: 1;
}

@keyframes spinGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 默认头像 */
.avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  border: 3px solid var(--gold);
  position: relative;
  z-index: 2;
}

/* ---- 姓名和编号 ---- */
.card-name {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.card-number {
  font-size: 14px;
  color: var(--gold);
  text-align: center;
  letter-spacing: 3px;
  font-family: 'Courier New', monospace;
  margin-bottom: 8px;
}

.card-title {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
}

/* ---- 段位标识 ---- */
.level-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  margin: 0 auto;
}

.level-青铜 { background: #CD7F32; color: #fff; }
.level-白银 { background: linear-gradient(135deg, #C0C0C0, #E8E8E8); color: #333; }
.level-黄金 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #333; }
.level-铂金 { background: linear-gradient(135deg, #E5E4E2, #BCC6CC); color: #333; }
.level-钻石 { background: linear-gradient(135deg, #B9F2FF, #00CED1); color: #333; }
.level-传奇 { background: linear-gradient(135deg, #FF6B6B, #FF1744); color: #fff; }
.level-创世 { background: linear-gradient(135deg, #FFD700, #FF6B35, #FF1744); color: #fff; box-shadow: 0 0 15px rgba(255, 215, 0, 0.5); }

/* ---- 身价显示 ---- */
.score-section {
  text-align: center;
  margin: 24px 0;
  padding: 16px;
  background: rgba(255, 215, 0, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.15);
}

.score-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 2px;
}

.score-value {
  font-size: 42px;
  font-weight: 800;
  color: var(--gold);
  font-family: 'DIN Alternate', 'Courier New', monospace;
  animation: scoreBreath 2s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

@keyframes scoreBreath {
  0%, 100% { opacity: 1; text-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
  50% { opacity: 0.85; text-shadow: 0 0 40px rgba(255, 215, 0, 0.8); }
}

/* ---- 行业标签 ---- */
.tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 12px 0;
}

.tag {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  background: rgba(0, 201, 167, 0.15);
  color: var(--jade);
  border: 1px solid rgba(0, 201, 167, 0.3);
}

.tag-auth {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold);
  border-color: var(--border-gold);
}

/* ---- 底部操作栏 ---- */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, var(--bg-dark) 30%);
  display: flex;
  gap: 12px;
  z-index: 100;
}

.btn {
  flex: 1;
  padding: 14px 0;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a1a2e;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-jade {
  background: linear-gradient(135deg, var(--jade), #00896B);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 201, 167, 0.3);
}

/* ---- 排行榜样式 ---- */
.rank-list {
  padding: 0 16px 80px;
}

.rank-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  overflow: hidden;
}

.rank-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
}

.rank-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(255, 215, 0, 0.05);
}

.rank-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s;
}

.rank-item:hover {
  background: rgba(255, 215, 0, 0.05);
  border-color: var(--border-gold);
}

.rank-number {
  width: 32px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  margin-right: 12px;
}

.rank-number.top1 { color: #FFD700; }
.rank-number.top2 { color: #C0C0C0; }
.rank-number.top3 { color: #CD7F32; }

.rank-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.rank-info {
  flex: 1;
}

.rank-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.rank-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.rank-score {
  text-align: right;
}

.rank-score-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.rank-score-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- 创建页样式 ---- */
.form-wrapper {
  padding: 20px;
}

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

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

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 16px;
  transition: all 0.3s;
  outline: none;
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* ---- 通用动画 ---- */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

.slide-up {
  animation: slideUp 0.5s ease-out;
}

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

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

.loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin: 0 4px;
  animation: dotPulse 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---- Toast提示 ---- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  animation: toastIn 0.3s ease;
  backdrop-filter: blur(10px);
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---- 响应式 ---- */
@media (max-width: 375px) {
  .card-body {
    padding: 30px 18px;
  }
  .card-name {
    font-size: 24px;
  }
  .score-value {
    font-size: 36px;
  }
}

/* 页面底部占位（给fixed bottom让位） */
.bottom-spacer {
  height: 80px;
}
