/* ===== 死了么 Alive Check CSS ===== */
:root {
  --red: #d32f2f;
  --red-light: #ffebee;
  --red-dark: #b71c1c;
  --green: #4caf50;
  --green-light: #e8f5e9;
  --bg: #fafafa;
  --card: #fff;
  --text: #333;
  --text-dim: #999;
  --border: #eee;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* { 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);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ===== 注册/登录页 ===== */
.auth-page {
  min-height: 100vh;
  padding: 60px 24px 40px;
  background: linear-gradient(180deg, #fff 0%, var(--red-light) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 8px; }
.logo-icon { font-size: 48px; }
.logo-text { font-size: 32px; font-weight: 800; color: var(--red); letter-spacing: -1px; }
.auth-subtitle { margin-top: 4px; color: var(--text-dim); font-size: 14px; }
.auth-sub-desc { margin-top: 4px; color: var(--text-dim); font-size: 12px; }

/* 标签切换 */
.auth-tabs {
  display: flex; width: 100%; max-width: 360px;
  background: #e8e8e8; border-radius: 8px; padding: 3px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 10px; border: none; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--text-dim);
  border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.auth-tab.active { background: #fff; color: var(--red); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

/* 表单 */
.auth-form { display: none; width: 100%; max-width: 360px; }
.auth-form.active { display: block; }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 13px; color: #666; margin-bottom: 5px; font-weight: 500;
}
.form-group input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid #ddd; border-radius: 8px; font-size: 15px;
  outline: none; transition: border 0.2s; background: #fff;
}
.form-group input:focus { border-color: var(--red); }

.btn-auth {
  width: 100%; padding: 13px; border: none; border-radius: 8px;
  font-size: 16px; font-weight: 600; color: #fff;
  background: var(--red); cursor: pointer; transition: all 0.2s; margin-top: 6px;
}
.btn-auth:hover { background: var(--red-dark); }
.btn-auth:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-register { background: linear-gradient(135deg, #ff6b6b, var(--red)); }
.btn-register:hover { background: linear-gradient(135deg, var(--red), #b71c1c); }

.reg-note { text-align: center; font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.auth-err { text-align: center; color: var(--red); font-size: 13px; margin-top: 8px; min-height: 20px; }

/* ===== 支付弹窗 ===== */
.pay-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.pay-modal {
  background: #fff; border-radius: 16px; padding: 28px 20px;
  width: 90%; max-width: 340px; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.pay-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; line-height: 1.5; }
.pay-qr-area {
  width: 200px; height: 200px; margin: 0 auto 12px;
  background: #f5f5f5; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pay-qr-area iframe { width: 200px; height: 200px; border: none; border-radius: 12px; }
.pay-loading { color: var(--text-dim); font-size: 13px; }
.pay-hint { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.pay-id { font-size: 11px; color: #bbb; margin-bottom: 14px; word-break: break-all; }
.btn-pay-close {
  padding: 9px 28px; border: 1px solid #ddd; border-radius: 8px;
  background: #fff; color: var(--text-dim); font-size: 14px; cursor: pointer;
}
.btn-pay-close:hover { background: #f5f5f5; }

/* ===== 主界面 ===== */
.main-page { min-height: 100vh; padding-bottom: 80px; }

/* 顶部 */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--red); color: #fff;
  position: sticky; top: 0; z-index: 100;
}
.top-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.top-icon { font-size: 20px; }
.top-user { font-size: 13px; background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 14px; }

/* ===== 状态卡片 ===== */
.status-card {
  margin: 16px; padding: 24px 20px;
  background: var(--card); border-radius: 16px;
  box-shadow: var(--shadow); text-align: center;
}
.status-icon { font-size: 56px; margin-bottom: 8px; }
.status-title { font-size: 22px; font-weight: 700; color: var(--green); }
.status-time { font-size: 13px; color: var(--text-dim); margin: 4px 0 12px; }

/* 进度条 */
.status-bar-wrap {
  height: 8px; background: #eee; border-radius: 4px;
  margin: 8px 0; overflow: hidden;
}
.status-bar {
  height: 100%; background: linear-gradient(90deg, var(--green), #ff9800, var(--red));
  border-radius: 4px; transition: width 1s ease;
}
.status-hours { font-size: 12px; color: var(--text-dim); }

/* 打卡按钮 */
.btn-checkin {
  display: block; width: calc(100% - 32px); margin: 0 16px 16px;
  padding: 18px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff; font-size: 20px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 16px rgba(76,175,80,0.3);
}
.btn-checkin:active { transform: scale(0.97); }
.btn-checkin:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-checkin-icon { font-size: 28px; display: block; margin-bottom: 4px; }

/* 打卡历史 */
.checkin-history {
  padding: 0 16px; font-size: 13px; color: var(--text-dim);
  text-align: center; margin-bottom: 8px;
}

/* ===== 紧急联系人 ===== */
.section-title {
  font-size: 16px; font-weight: 700; padding: 12px 16px 8px;
  display: flex; align-items: center; gap: 6px;
}
.contacts-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.contact-card {
  background: var(--card); border-radius: 12px; padding: 14px;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between;
}
.contact-info { flex: 1; }
.contact-name { font-size: 15px; font-weight: 600; }
.contact-detail { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.contact-actions { display: flex; gap: 6px; }
.contact-btn {
  padding: 5px 12px; border: none; border-radius: 6px;
  font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.contact-btn.edit { background: #e3f2fd; color: #1565c0; }
.contact-btn.del { background: var(--red-light); color: var(--red); }
.contact-btn:active { opacity: 0.7; }

.btn-add-contact {
  display: block; width: calc(100% - 32px); margin: 12px 16px;
  padding: 12px; border: 2px dashed #ddd; border-radius: 12px;
  background: transparent; font-size: 15px; color: var(--text-dim);
  cursor: pointer; transition: all 0.2s;
}
.btn-add-contact:hover { border-color: var(--red); color: var(--red); }

/* 底部信息 */
.footer-info {
  text-align: center; padding: 16px; color: var(--text-dim); font-size: 12px; line-height: 1.8;
}
.footer-logout {
  display: inline-block; margin-top: 8px; color: var(--red);
  cursor: pointer; font-weight: 600; font-size: 13px;
}

/* 危险状态 */
.status-card.danger { border: 2px solid var(--red); }
.status-card.danger .status-icon { font-size: 64px; }
.status-card.danger .status-title { color: var(--red); }
.status-card.danger .status-bar { background: var(--red); }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8); color: #fff;
  padding: 14px 28px; border-radius: 10px;
  font-size: 14px; z-index: 2000;
  transition: opacity 0.3s; text-align: center; max-width: 80%;
}
