/* Cheese Word Style - Global CSS */

:root {
  --bg-color: #fffbe8; /* 暖米色背景 */
  --card-bg: #ffffff;
  --text-primary: #5d4037; /* 深棕色文字 */
  --text-secondary: #8d6e63; /* 浅棕色文字 */
  --primary-color: #ffc107; /* 奶酪黄 */
  --primary-dark: #ffb300;
  --primary-btn-text: #5d4037;
  --accent-green: #aed581; /* 柔和绿 */
  --accent-blue: #81d4fa; /* 柔和蓝 */
  --accent-pink: #ffab91; /* 柔和粉 */
  --border-radius: 20px;
  --shadow: 0 4px 12px rgba(93, 64, 55, 0.08);
  --border-color: #f0e6d2;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  font-family: 'Nunito', 'Quicksand', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* 布局容器 */
.app-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* 顶部导航 */
.nav-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: transparent;
  position: relative;
  z-index: 10;
}

.nav-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.back-btn {
  font-size: 20px;
  cursor: pointer;
  background: #fff;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  transition: transform 0.2s;
}

.back-btn:active {
  transform: scale(0.9);
}

/* 卡片 */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 2px solid var(--border-color);
  transition: transform 0.2s;
}

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

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  letter-spacing: 0.5px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--primary-btn-text);
  box-shadow: 0 4px 0 var(--primary-dark); /* 3D 按钮效果 */
  margin-bottom: 4px; /* 抵消 shadow */
  transform: translateY(0);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: none;
  margin-bottom: 0;
}

.btn-primary:disabled {
  background-color: #e0e0e0;
  color: #9e9e9e;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  margin-bottom: 4px;
}

/* 输入框 */
.input-group {
  margin-bottom: 15px;
}

.form-control {
  width: 100%;
  padding: 15px;
  border-radius: 16px;
  border: 2px solid var(--border-color);
  background: #fff;
  font-size: 16px;
  color: var(--text-primary);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.3s;
  font-family: inherit;
}

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

textarea.form-control {
  resize: vertical;
  min-height: 150px;
}

/* 下拉选择器模拟 */
.select-wrapper {
  position: relative;
}
.select-wrapper select {
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238D6E63' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  font-weight: bold;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}
.tag-new {
  background: #ffe082;
  color: #5d4037;
}

/* Tab 切换 */
.tabs {
  display: flex;
  background: #fff;
  padding: 6px;
  border-radius: 50px;
  margin-bottom: 20px;
  border: 2px solid var(--border-color);
}
.tab-item {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 40px;
  cursor: pointer;
  font-weight: 800;
  color: var(--text-secondary);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab-item.active {
  background: var(--primary-color);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

/* 底部导航栏 - 固定在底部 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 600px; /* 保持与 app-container 一致 */
  background: #fff;
  padding: 12px 20px 20px 20px; /* 增加底部 padding 适配全面屏 */
  display: flex;
  justify-content: space-around;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  z-index: 100;
  border-top: 1px solid var(--border-color);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #c2bdb0;
  font-size: 12px;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
  width: 60px;
}
.nav-item.active {
  color: var(--text-primary);
  font-weight: 800;
}
.nav-item.active .nav-icon svg {
  fill: var(--primary-color);
  stroke: var(--text-primary);
  stroke-width: 1.5;
  transform: translateY(-2px);
}
.nav-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
  transition: transform 0.2s;
}
.nav-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #c2bdb0;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.2s;
}

/* Loading 遮罩 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 251, 232, 0.95);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.loading-content {
  text-align: center;
}
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #fff;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.loading-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 通用 Icon 容器 */
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
}
