/* ===================== 变量 ===================== */
:root {
  --primary: #2d8cf0;
  --primary-dark: #1a6dd1;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #e74c3c;
  --bg: #f5f7fa;
  --card-bg: #fff;
  --text: #333;
  --text-light: #999;
  --border: #e8e8e8;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ===================== 基础 ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

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

/* ===================== 容器 ===================== */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px;
  min-height: 100vh;
}

.container.wide {
  max-width: 960px;
}

/* ===================== 标题 ===================== */
.page-title {
  font-size: 26px;
  font-weight: bold;
  color: var(--primary);
  text-align: center;
  margin-bottom: 8px;
}

.page-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 28px;
}

/* ===================== 表单 ===================== */
.form-group {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.form-label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--danger);
  margin-right: 2px;
}

.form-input,
.form-select {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--primary);
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3e%3cpath fill='%23999' d='M6 8L1 3h10z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-textarea {
  width: 100%;
  min-height: 88px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.form-textarea:focus {
  border-color: var(--primary);
}

.radio-group {
  display: flex;
  gap: 24px;
  padding: 6px 0;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  cursor: pointer;
}

.radio-group input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ===================== 按钮 ===================== */
.btn-primary {
  display: block;
  width: 100%;
  height: 48px;
  line-height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 24px;
  text-align: center;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  opacity: 0.8;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-block;
  padding: 8px 18px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-success {
  display: inline-block;
  padding: 8px 18px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

/* ===================== 用户卡片 ===================== */
.user-card {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(45,140,240,0.25);
}

.user-avatar {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 18px;
  flex-shrink: 0;
  font-size: 26px;
  color: #fff;
  font-weight: bold;
}

.user-details {
  color: #fff;
}

.user-name {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 4px;
}

.user-meta {
  font-size: 13px;
  opacity: 0.8;
}

/* ===================== 成功页 ===================== */
.success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.success-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 44px;
  line-height: 88px;
  text-align: center;
  margin-bottom: 24px;
}

.success-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 12px;
}

.success-desc {
  font-size: 16px;
  color: #666;
  margin-bottom: 6px;
}

.success-hint {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 8px;
}

/* ===================== 管理后台 ===================== */
.stats-row {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  flex: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(45,140,240,0.2);
  color: #fff;
}

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: bold;
}

.stat-label {
  display: block;
  font-size: 13px;
  opacity: 0.8;
  margin-top: 4px;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.action-bar .btn-secondary {
  font-size: 13px;
  padding: 6px 14px;
}

.filter-hint {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}

/* 记录卡片 */
.record-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.record-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  gap: 10px;
}

.record-seq {
  font-size: 14px;
  font-weight: bold;
  color: var(--primary);
}

.record-date {
  flex: 1;
  font-size: 13px;
  color: var(--text-light);
}

.record-type {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 20px;
  color: #fff;
}

.tag-理疗 { background: var(--primary); }
.tag-访谈 { background: var(--warning); }
.tag-养生解读 { background: var(--success); }

.record-body {
  padding: 12px 16px;
}

.record-row {
  display: flex;
  padding: 7px 0;
  border-bottom: 1px solid #f8f8f8;
  align-items: flex-start;
}

.record-row:last-child {
  border-bottom: none;
}

.record-field {
  width: 80px;
  font-size: 13px;
  color: var(--text-light);
  flex-shrink: 0;
}

.record-value {
  flex: 1;
  font-size: 14px;
}

.record-row.editable {
  background: #fafbff;
  border-radius: 6px;
  padding: 7px 10px;
  margin: 3px 0;
  cursor: pointer;
  transition: background 0.2s;
}

.record-row.editable:hover {
  background: #f0f5ff;
}

.record-row.editable .record-value {
  color: var(--primary);
}

/* ===================== 其他 ===================== */
.form-footer {
  text-align: center;
  margin-top: 20px;
  padding-bottom: 40px;
}

.footer-text {
  font-size: 12px;
  color: #ccc;
}

.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--text-light);
  font-size: 15px;
}

.empty {
  text-align: center;
  padding: 80px 0;
  color: #ccc;
  font-size: 16px;
}

.hidden {
  display: none !important;
}

/* ===================== 手机适配 ===================== */
@media (max-width: 500px) {
  .container {
    padding: 16px 14px;
  }

  .page-title {
    font-size: 22px;
  }
}

/* 简单的 toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 15px;
  z-index: 1000;
  pointer-events: none;
  animation: toastFade 2s ease forwards;
}

@keyframes toastFade {
  0% { opacity: 0; }
  15% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}
