/* ==================== CSS Variables ==================== */
:root {
  /* Warm orange primary */
  --primary: #F0815A;
  --primary-light: #F5A080;
  --primary-dark: #D46A45;
  --primary-alpha: rgba(240, 129, 90, 0.1);

  /* Mint green secondary */
  --secondary: #4ECDC4;
  --secondary-alpha: rgba(78, 205, 196, 0.1);

  /* Accent */
  --accent: #FFD93D;
  --pink-purple: #D4A5C9;

  /* Backgrounds */
  --bg-warm: #FFF8F0;
  --bg-card: #FFFFFF;
  --bg-dark: #1A1A2E;

  /* Text */
  --text-main: #2D2D2D;
  --text-secondary: #666666;
  --text-muted: #999999;

  /* Core */
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ==================== Global Reset ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'PingFang SC', 'Helvetica Neue', 'Noto Sans SC', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-warm);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  padding-bottom: 70px;
}

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

/* ==================== Page Container ==================== */
.page-container {
  padding: 0 16px 24px;
  min-height: 100vh;
}

/* ==================== Header ==================== */
.page-header {
  display: flex;
  align-items: center;
  padding: 12px 0;
  position: sticky;
  top: 0;
  background: var(--bg-warm);
  z-index: 50;
}

.page-header .back-btn {
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.page-header h1 {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-right: 32px;
}

/* ==================== Cards ==================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card-gradient-warm {
  background: linear-gradient(135deg, #FFF0E8, #FFE4F0);
}

.card-gradient-cool {
  background: linear-gradient(135deg, #E8F8FF, #E0F4FF);
}

.card-gradient-mint {
  background: linear-gradient(135deg, #F0FFF4, #E8FFE8);
}

.card-gradient-purple {
  background: linear-gradient(135deg, #F5F0FF, #EDE8FF);
}

.card-gradient-pink {
  background: linear-gradient(135deg, #FFE4F0, #FFD6E5);
}

/* ==================== Talent Cards ==================== */
.talent-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.talent-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  margin-bottom: 10px;
}

.talent-card-body {
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  white-space: pre-wrap;
}

/* 卡片左边框颜色 */
.card-border-blue   { border-left: 4px solid #4A90D9; }
.card-border-green  { border-left: 4px solid #52C41A; }
.card-border-orange { border-left: 4px solid #FA8C16; }
.card-border-purple { border-left: 4px solid #722ED1; }
.card-border-cyan   { border-left: 4px solid #13C2C2; }
.card-border-yellow { border-left: 4px solid #FADB14; }

/* 月度行动计划卡片 */
.monthly-card {
  flex: 1;
  min-width: 160px;
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-size: 13px;
  line-height: 1.7;
}


/* ==================== Buttons ==================== */
.btn {
  display: block;
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

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

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

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

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

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

.btn-gray {
  background: #f0f0f0;
  color: var(--text-muted);
}

/* ==================== Tags ==================== */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  margin: 2px;
  cursor: pointer;
  border: 1px solid #eee;
  background: #fff;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.tag.active {
  background: var(--primary-alpha);
  color: var(--primary);
  border-color: var(--primary);
}

/* ==================== Login Tabs ==================== */
.login-tab {
  flex: 1;
  text-align: center;
  padding: 12px 4px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.login-tab + .login-tab {
  border-left: 1px solid #f0f0f0;
}
.login-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ==================== Stats Row ==================== */
.stat-row {
  display: flex;
  justify-content: space-around;
  padding: 16px 0;
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==================== Badges ==================== */
.badge {
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 8px;
  font-weight: 500;
  display: inline-block;
}

.badge-green {
  background: rgba(78, 205, 196, 0.12);
  color: var(--secondary);
}

.badge-gray {
  background: rgba(153, 153, 153, 0.1);
  color: var(--text-muted);
}

.badge-orange {
  background: rgba(240, 129, 90, 0.12);
  color: var(--primary);
}

.badge-red {
  background: rgba(255, 71, 87, 0.12);
  color: #FF4757;
}

/* ==================== Progress Bar ==================== */
.progress-bar {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ==================== Record Card ==================== */
.record-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

.record-card:active {
  transform: scale(0.98);
}

.record-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.record-body {
  flex: 1;
  min-width: 0;
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.record-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.record-summary {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.record-time {
  font-size: 11px;
  color: #bbb;
}

/* ==================== Menu List ==================== */
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item .menu-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.menu-item .menu-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-main);
}

.menu-item .menu-arrow {
  color: #ccc;
  font-size: 14px;
}

.menu-item .menu-tag {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==================== Inputs ==================== */
.input-field {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #eee;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  font-family: inherit;
}

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

textarea.input-field {
  resize: none;
}

/* ==================== Code Input ==================== */
.code-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.code-box {
  width: 44px;
  height: 52px;
  border: 2px solid #ddd;
  border-radius: 10px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}

.code-box:focus {
  border-color: var(--primary);
}

/* ==================== Skeleton Loading ==================== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  height: 14px;
  margin-bottom: 8px;
}

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

/* ==================== Emotion Meter ==================== */
.emotion-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.emotion-label {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.emotion-bar {
  flex: 1;
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
}

.emotion-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

.emotion-low {
  background: linear-gradient(90deg, #4ECDC4, #FFD93D);
}

.emotion-mid {
  background: linear-gradient(90deg, #FFD93D, #F39C12);
}

.emotion-high {
  background: linear-gradient(90deg, #F39C12, #F0815A);
}

/* ==================== Identity Tag Selector ==================== */
.identity-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==================== Golden Quote ==================== */
.golden-quote {
  text-align: center;
  background: linear-gradient(135deg, #E8F8FF, #E0F4FF);
  padding: 16px;
  border-radius: var(--radius);
  cursor: pointer;
}

.golden-quote .quote-mark {
  font-size: 28px;
  color: var(--secondary);
  opacity: 0.3;
  line-height: 1;
}

.golden-quote p {
  font-size: 15px;
  color: var(--text-main);
  font-weight: 500;
  margin: 4px 0;
}

.golden-quote .quote-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==================== Fade Blur Lock ==================== */
.blur-lock {
  position: relative;
}

.blur-lock::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backdrop-filter: blur(3px);
  background: linear-gradient(to bottom, transparent 30%, rgba(255, 248, 240, 0.95) 80%);
  pointer-events: none;
}

/* ==================== Section Title ==================== */
.section-title {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
  margin-bottom: 4px;
}

/* ==================== Calendar ==================== */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-wday {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 0;
}

.cal-day {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  margin: 0 auto;
  color: var(--text-secondary);
}

.cal-day.checked {
  background: var(--primary);
  color: #fff;
}

.cal-day.today {
  border: 2px solid var(--primary);
  font-weight: 600;
}

.cal-day.checked.today {
  background: var(--primary);
  color: #fff;
  border: none;
}

.cal-day.blank {
  visibility: hidden;
}

.cal-day.today-not-checked {
  border: 2px solid #ffa726;
  color: #ffa726;
  font-weight: 600;
  background: #fff8e1;
}

.cal-day.past-missed {
  color: #ccc;
  background: #f5f5f5;
  text-decoration: line-through;
}


/* ==================== FontAwesome Missing Fallback ==================== */
.fa-icon-placeholder {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  font-style: normal;
}

/* ==================== Vant Overrides ==================== */
.van-button--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  border: none !important;
}

.van-tabbar {
  --van-tabbar-height: 50px;
}

.van-tabbar-item__icon {
  font-size: 22px !important;
}

/* ==================== Animation ==================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.25s ease;
}

/* ==================== Utility ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }

/* van-password-input centering */
.van-password-input {
  justify-content: center;
  margin: 0 auto;
}
.van-password-input__security {
  margin: 0 auto;
}
.van-number-keyboard {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}
