/* ===== 全局重置 & 变量 ===== */
:root {
  --male-primary: #6C5CE7;
  --male-secondary: #A29BFE;
  --male-accent: #FD79A8;
  --female-primary: #E84393;
  --female-secondary: #FD79A8;
  --female-accent: #6C5CE7;
  --bg-dark: #0a0a1a;
  --bg-card: #131328;
  --bg-card-hover: #1a1a38;
  --text: #e8e8f0;
  --text-dim: #8888aa;
  --border: #2a2a4a;
  --gold: #ffd700;
  --success: #00b894;
  --exp-color: #00cec9;
}

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

body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 登录页 ===== */
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0a1a2e 100%);
}

.landing-container {
  text-align: center;
  max-width: 600px;
  padding: 2rem;
}

.logo-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.landing-container h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--male-secondary), var(--female-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.role-cards {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.role-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  width: 240px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  cursor: pointer;
}

.role-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(108,92,231,0.3);
}

.male-card:hover { border-color: var(--male-primary); box-shadow: 0 8px 30px rgba(108,92,231,0.3); }
.female-card:hover { border-color: var(--female-primary); box-shadow: 0 8px 30px rgba(232,67,147,0.3); }

.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.role-card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.role-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.tag {
  display: inline-block;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer-note {
  color: var(--text-dim);
  font-size: 0.85rem;
  opacity: 0.5;
}

/* ===== 登录表单 ===== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.back-link {
  text-align: left;
  margin-bottom: 1rem;
}

.back-link a { color: var(--text-dim); text-decoration: none; font-size: 0.9rem; }
.back-link a:hover { color: var(--text); }

.role-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.male-badge {
  background: rgba(108,92,231,0.2);
  color: var(--male-secondary);
  border: 1px solid var(--male-primary);
}

.female-badge {
  background: rgba(232,67,147,0.2);
  color: var(--female-secondary);
  border: 1px solid var(--female-primary);
}

.login-box h2 { margin-bottom: 0.5rem; }
.login-hint { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1.5rem; }

.input-group {
  margin-bottom: 1.2rem;
}

.input-group input {
  width: 100%;
  padding: 0.9rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

.input-group input:focus {
  border-color: var(--male-secondary);
}

.btn-primary {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--male-primary), var(--female-primary));
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(108,92,231,0.4);
}

.error-msg {
  color: #ff6b6b;
  font-size: 0.85rem;
  margin-top: 0.8rem;
  min-height: 1.2rem;
}

/* ===== HUD ===== */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  background: rgba(19,19,40,0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.hud-left { display: flex; align-items: center; gap: 0.8rem; }
.hud-title { font-size: 1rem; font-weight: 700; color: var(--male-secondary); }
.female-hud .hud-title { color: var(--female-secondary); }

.hud-level {
  background: var(--male-primary);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.female-hud .hud-level { background: var(--female-primary); }

.hud-right { display: flex; align-items: center; gap: 0.8rem; }
.hud-user { color: var(--text-dim); font-size: 0.9rem; }

.btn-icon {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-icon:hover { color: var(--text); background: rgba(255,255,255,0.1); }

/* ===== 主面板 ===== */
.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .panel-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  transition: all 0.3s;
}

.card:hover { border-color: rgba(255,255,255,0.1); }

.card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ===== 属性面板 ===== */
.stat-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  min-width: 3rem;
}

.stat-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.charm-fill { background: linear-gradient(90deg, #6C5CE7, #A29BFE); }
.social-fill { background: linear-gradient(90deg, #00b894, #55efc4); }
.date-fill { background: linear-gradient(90deg, #fd79a8, #e84393); }
.influence-fill { background: linear-gradient(90deg, #e84393, #fd79a8); }

.stat-num {
  min-width: 2rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.9rem;
}

.stat-big {
  font-weight: 700;
  font-size: 1rem;
}

.coin { color: var(--gold); }

.exp-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.exp-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
}

.exp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--exp-color), #81ecec);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.next-level, .level-title {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* ===== 任务列表 ===== */
.task-list { list-style: none; }

.task-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.task-item:hover { padding-left: 0.3rem; }

.task-check {
  font-size: 1.1rem;
  color: var(--text-dim);
}

.task-item.done .task-check { color: var(--success); content: "☑"; }
.task-item.done .task-text { color: var(--text-dim); text-decoration: line-through; opacity: 0.6; }

.task-text { font-size: 0.9rem; }

/* ===== AI导师 ===== */
.mentor-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
}

.mentor-input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.7rem;
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
  font-family: inherit;
}

.mentor-input:focus { border-color: var(--male-secondary); }

.btn-small {
  padding: 0.5rem 1rem;
  background: var(--male-primary);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 0.6rem;
  transition: all 0.3s;
}

.female-task .btn-small, .female-btn { background: var(--female-primary); }

.btn-small:hover { transform: translateY(-1px); box-shadow: 0 3px 12px rgba(108,92,231,0.3); }

.mentor-result {
  margin-top: 0.8rem;
  padding: 0.8rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  font-size: 0.85rem;
  min-height: 2rem;
  line-height: 1.6;
}

/* ===== 约会顾问 ===== */
.date-params {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.date-params select {
  flex: 1;
  padding: 0.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8rem;
  outline: none;
}

/* ===== 地图 ===== */
.map-placeholder {
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  padding: 1.5rem;
}

.map-dot {
  position: absolute;
  font-size: 1.2rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.map-note { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.5rem; }

/* ===== 女版专属 ===== */
.post-card { grid-column: span 1; }

.post-actions { margin-top: 0.5rem; }

.post-feed {
  margin-top: 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.feed-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.post-item {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.6rem;
}

.post-item .post-time { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.3rem; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: all 0.3s;
}

.activity-item:hover { background: rgba(255,255,255,0.06); }

.activity-icon { font-size: 1.5rem; }
.activity-info h4 { font-size: 0.9rem; }
.activity-info p { font-size: 0.75rem; color: var(--text-dim); }

.gift-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.gift-item {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.gift-item:hover { background: rgba(255,255,255,0.06); }
.gift-item.lock { opacity: 0.4; cursor: default; }

.gift-icon { font-size: 1.5rem; display: block; margin-bottom: 0.3rem; }
.gift-name { font-size: 0.8rem; display: block; }
.gift-points { font-size: 0.7rem; color: var(--gold); display: block; margin-top: 0.2rem; }

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  max-width: 340px;
  animation: modalIn 0.3s ease;
}

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

.modal-icon { font-size: 3rem; margin-bottom: 1rem; }
.modal-box h2 { margin-bottom: 0.5rem; }
.modal-box p { color: var(--text-dim); margin-bottom: 1.5rem; }

/* ===== 个人资料 ===== */
.profile-page {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
}

.profile-avatar {
  text-align: center;
  margin-bottom: 2rem;
}

.avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--male-primary), var(--female-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto;
}

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

.info-row span:first-child { color: var(--text-dim); }

.btn-danger {
  width: 100%;
  padding: 0.7rem;
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.3);
  border-radius: 8px;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 2rem;
}

.btn-danger:hover { background: rgba(255,107,107,0.2); }

/* ===== 粒子特效 ===== */
.particles {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  animation: particleFloat 8s linear infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===== 响应式 ===== */
@media (max-width: 500px) {
  .landing-container h1 { font-size: 1.6rem; }
  .role-card { width: 100%; max-width: 280px; }
  .hud { padding: 0.6rem 1rem; }
  .panel-grid { padding: 0.6rem; gap: 0.8rem; }
  .card { padding: 1rem; }
}