/* 适配 iPhone 15 (2556×1179, 460ppi) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 主色调 - 优化后的珊瑚红 */
  --primary-color: #FF5A5F;
  --primary-hover: #FF454A;
  --primary-light: #FFF0F0;
  --primary-gradient: linear-gradient(135deg, #FF5A5F 0%, #FF8E53 100%);

  /* 辅助色 - 清新的薄荷绿 */
  --secondary-color: #00B894;
  --secondary-light: #E6FFF8;

  /* 文字颜色 - 提升对比度和可读性 */
  --text-primary: #1A1A1A;
  --text-secondary: #858585;
  --text-tertiary: #B0B0B0;

  /* 背景色 - 更加柔和 */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F7F8FA;
  --bg-tertiary: #EEF0F3;

  /* 边框色 */
  --border-color: #E8E8E8;
  --border-light: #F0F0F0;

  /* 功能色 */
  --success-color: #00C853;
  --success-light: #E8F5E9;
  --warning-color: #FF9800;
  --warning-light: #FFF3E0;
  --danger-color: #FF5252;
  --danger-hover: #E53935;
  --danger-light: #FFEBEE;

  /* 阴影 - 增强层次感 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-xl: 0 8px 32px rgba(0,0,0,0.14);

  /* 圆角 */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;
  --border-radius: 12px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* 标题字体优化 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.app-container {
  max-width: 430px; /* iPhone 15 Pro Max width */
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--bg-primary);
  padding-bottom: 80px; /* bottom nav height */
}

/* 顶部导航 */
.header {
  position: sticky;
  top: 0;
  background-color: var(--bg-primary);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
}

.back-btn svg {
  width: 24px;
  height: 24px;
}

.header-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.header-btn.primary {
  background-color: var(--primary-color);
  color: white;
}

.header-btn.primary:active {
  opacity: 0.8;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-primary);
  transition: background-color 0.2s;
}

.icon-btn:active {
  background-color: var(--bg-secondary);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-item.active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-item svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active svg {
  transform: scale(1.1);
}

.nav-item span {
  font-size: 11px;
  font-weight: 500;
}

/* 按钮 */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(255, 90, 95, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(255, 90, 95, 0.4);
}

.btn-add {
  width: 100%;
  padding: 12px;
  background-color: var(--bg-secondary);
  color: var(--primary-color);
  border: 2px dashed var(--primary-color);
  border-radius: var(--border-radius);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add:active {
  background-color: var(--primary-color);
  color: white;
}

.btn-remove {
  padding: 6px 12px;
  background-color: var(--danger-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

/* 表单 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-label .required {
  color: var(--danger-color);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-color);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-primary);
  border-radius: 20px;
  width: 100%;
  max-width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%;
}

.modal-close:active {
  background-color: var(--bg-secondary);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* 浮动添加按钮 */
.fab-add {
  position: fixed;
  bottom: 100px;
  right: calc(50% - 195px);
  width: 56px;
  height: 56px;
  background-color: var(--primary-color);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 50;
}

.fab-add:active {
  transform: scale(0.9);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}
