/* 组件样式优化 */

/* 1. 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.2rem 0.3rem;
  font-size: 0.28rem;
  text-align: center;
  border-radius: 0.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  font-weight: normal;
  line-height: 1.2;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.98);
}

/* 主要按钮 */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(70, 213, 190, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3bc2ab 0%, #45b8ac 100%);
  box-shadow: 0 0.15rem 0.3rem rgba(70, 213, 190, 0.4);
}

.btn-primary:active {
  background: var(--primary-dark);
  box-shadow: 0 0.05rem 0.15rem rgba(70, 213, 190, 0.2);
}

/* 次要按钮 */
.btn-secondary {
  background: #EDF2F7;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #E2E8F0;
  border-color: #CBD5E0;
}

/* 危险按钮 */
.btn-danger {
  background: var(--danger-color);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
  background: var(--danger-dark);
  box-shadow: 0 0.15rem 0.3rem rgba(255, 107, 107, 0.4);
}

/* 警告按钮 */
.btn-warning {
  background: var(--warning-color);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(255, 209, 102, 0.3);
}

.btn-warning:hover {
  background: var(--warning-alt);
  box-shadow: 0 0.15rem 0.3rem rgba(255, 154, 118, 0.4);
}

/* 成功按钮 */
.btn-success {
  background: var(--success-color);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(78, 205, 196, 0.3);
}

.btn-success:hover {
  background: var(--success-dark);
  box-shadow: 0 0.15rem 0.3rem rgba(26, 147, 111, 0.4);
}

/* 强调按钮 */
.btn-accent {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(141, 153, 174, 0.3);
}

.btn-accent:hover {
  background: var(--accent-dark);
  box-shadow: 0 0.15rem 0.3rem rgba(108, 119, 147, 0.4);
}

/* 活力按钮 */
.btn-vibrant {
  background: var(--vibrant-color);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(255, 154, 118, 0.3);
}

.btn-vibrant:hover {
  background: var(--vibrant-dark);
  box-shadow: 0 0.15rem 0.3rem rgba(224, 122, 95, 0.4);
}

/* 冷色按钮 */
.btn-cool {
  background: var(--cool-color);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(78, 205, 196, 0.3);
}

.btn-cool:hover {
  background: var(--cool-dark);
  box-shadow: 0 0.15rem 0.3rem rgba(58, 174, 163, 0.4);
}

/* 紫色按钮 */
.btn-purple {
  background: var(--purple-color);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(155, 93, 229, 0.3);
}

.btn-purple:hover {
  background: var(--purple-dark);
  box-shadow: 0 0.15rem 0.3rem rgba(125, 60, 152, 0.4);
}

/* 粉色按钮 */
.btn-pink {
  background: var(--pink-color);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(241, 91, 181, 0.3);
}

.btn-pink:hover {
  background: var(--pink-dark);
  box-shadow: 0 0.15rem 0.3rem rgba(194, 24, 91, 0.4);
}

/* 橙色按钮 */
.btn-orange {
  background: var(--orange-color);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(249, 87, 56, 0.3);
}

.btn-orange:hover {
  background: var(--orange-dark);
  box-shadow: 0 0.15rem 0.3rem rgba(230, 74, 25, 0.4);
}

/* 青色按钮 */
.btn-teal {
  background: var(--teal-color);
  color: white;
  box-shadow: 0 0.1rem 0.2rem rgba(0, 187, 180, 0.3);
}

.btn-teal:hover {
  background: var(--teal-dark);
  box-shadow: 0 0.15rem 0.3rem rgba(0, 137, 123, 0.4);
}

/* 渐变按钮 */
.btn-gradient {
  background: var(--gradient-primary);
  color: white;
  border: none;
  box-shadow: 0 0.1rem 0.2rem rgba(70, 213, 190, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-gradient:hover {
  box-shadow: 0 0.15rem 0.3rem rgba(70, 213, 190, 0.4);
  transform: translateY(-0.05rem);
}

.btn-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.btn-gradient:hover::before {
  left: 100%;
}

/* 脉冲按钮 */
.btn-pulse {
  background: var(--primary-color);
  color: white;
  border: none;
  box-shadow: 0 0.1rem 0.2rem rgba(70, 213, 190, 0.3);
  animation: pulseBtn 2s infinite;
}

@keyframes pulseBtn {
  0% {
    box-shadow: 0 0 0 0 rgba(70, 213, 190, 0.3);
  }
  70% {
    box-shadow: 0 0 0 0.2rem rgba(70, 213, 190, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(70, 213, 190, 0);
  }
}

/* 波纹效果按钮 */
.btn-ripple {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
  width: 300%;
  height: 300%;
}

/* 浮动按钮 */
.btn-float {
  border-radius: 50%;
  width: 0.8rem;
  height: 0.8rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.btn-float:hover {
  transform: translateY(-0.1rem);
  box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.3);
}

/* 小型按钮 */
.btn-sm {
  padding: 0.1rem 0.2rem;
  font-size: 0.24rem;
}

/* 大型按钮 */
.btn-lg {
  padding: 0.3rem 0.4rem;
  font-size: 0.32rem;
}

/* 块级按钮 */
.btn-block {
  display: block;
  width: 100%;
}

/* 禁用状态 */
.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* 按钮组 */
.btn-group {
  display: flex;
  border-radius: 0.1rem;
  overflow: hidden;
  box-shadow: 0 0.05rem 0.15rem rgba(0, 0, 0, 0.1);
}

.btn-group .btn {
  border-radius: 0;
  margin: 0;
  flex: 1;
  box-shadow: none;
}

.btn-group .btn:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}



/* 2. 表单元素样式 */

/* 输入框 */
.input {
  display: block;
  width: 100%;
  padding: 0.2rem 0.3rem;
  font-size: 0.28rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--card-background);
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: 0.1rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  outline: none;
  position: relative;
}

.input::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0.02rem;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.input:focus::after {
  width: 100%;
}

.input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.05rem rgba(70, 213, 190, 0.25);
}

.input::placeholder {
  color: var(--text-tertiary);
  opacity: 1;
}

/* 文本域 */
.textarea {
  display: block;
  width: 100%;
  padding: 0.2rem 0.3rem;
  font-size: 0.28rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--card-background);
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: 0.1rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  outline: none;
  min-height: 1.2rem;
  resize: vertical;
}

.textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.05rem rgba(70, 213, 190, 0.25);
}

/* 选择框 */
.select {
  display: block;
  width: 100%;
  padding: 0.2rem 0.3rem;
  font-size: 0.28rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--card-background);
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: 0.1rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  outline: none;
  appearance: none;
  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='%23999' stroke-width='2' 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 0.3rem center;
  background-size: 0.3rem;
}

.select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.05rem rgba(70, 213, 190, 0.25);
}

/* 单选框和复选框 */
.checkbox,
.radio {
  position: relative;
  display: inline-block;
  margin-right: 0.2rem;
}

.checkbox input,
.radio input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-label,
.radio-label {
  display: inline-block;
  padding-left: 0.5rem;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.checkbox-label::before,
.radio-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.3rem;
  height: 0.3rem;
  border: 1px solid var(--border-color);
  background-color: var(--card-background);
  transition: all 0.3s ease;
}

.checkbox-label::before {
  border-radius: 0.05rem;
}

.radio-label::before {
  border-radius: 50%;
}

.checkbox input:checked + .checkbox-label::before,
.radio input:checked + .radio-label::before {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox input:checked + .checkbox-label::after {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.1rem;
  height: 0.2rem;
  border: solid white;
  border-width: 0 0.05rem 0.05rem 0;
  transform: translateY(-60%) rotate(45deg);
}

.radio input:checked + .radio-label::after {
  content: "";
  position: absolute;
  left: 0.05rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 50%;
  background-color: white;
}

/* 3. 导航样式 */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem;
  background: var(--card-textured-background);
  box-shadow: 0 0.05rem 0.1rem rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-title {
  font-size: 0.32rem;
  font-weight: bold;
  color: var(--text-primary);
}

/* 4. 页脚样式 */
.footer {
  background: var(--card-textured-background);
  border-top: 1px solid var(--border-color);
  padding: 0.2rem 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.footer-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.footer-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0.1rem 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.2rem;
  transition: all 0.3s ease;
}

.footer-nav-item.active {
  color: var(--primary-color);
}

.footer-nav-icon {
  width: 0.4rem;
  height: 0.4rem;
  margin-bottom: 0.05rem;
}

/* 5. 卡片样式 */
.card-header {
  padding: 0.3rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.32rem;
  font-weight: bold;
  color: var(--text-heading);
  background: var(--card-textured-background);
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0.2rem;
  height: 100%;
  background: var(--gradient-primary);
}

.card-body {
  padding: 0.3rem;
}

.card-footer {
  padding: 0.3rem;
  border-top: 1px solid var(--border-color);
  background: var(--background-alt-color);
}

.card-textured {
  background: var(--card-textured-background);
}

.card-gradient {
  background: var(--gradient-background);
}

.card-pattern {
  background: var(--card-background);
  background-image: radial-gradient(#f0f0f0 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.card-accent {
  border-left: 0.1rem solid var(--accent-color);
  box-shadow: 0 0.05rem 0.15rem rgba(0, 0, 0, 0.05);
}

.card-hover-effect {
  transition: all 0.3s ease;
  position: relative;
}

.card-hover-effect:hover {
  transform: translateY(-0.1rem);
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.1);
}

.card-hover-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-hover-effect:hover::before {
  opacity: 1;
}

.card-textured {
  background: var(--card-textured-background);
}

.card-gradient {
  background: var(--gradient-background);
}

.card-pattern {
  background: var(--card-background);
  background-image: radial-gradient(#f0f0f0 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.card-alt {
  background: var(--card-alt-background);
}

.card-emphasis {
  background: var(--card-emphasis-background);
  border: 1px solid var(--primary-color);
}

/* 6. 列表样式 */
.list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
}

.list-group-item {
  position: relative;
  display: block;
  padding: 0.3rem;
  color: var(--text-primary);
  text-decoration: none;
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-top: 0;
}

.list-group-item:first-child {
  border-top: 1px solid var(--border-color);
  border-top-left-radius: 0.1rem;
  border-top-right-radius: 0.1rem;
}

.list-group-item:last-child {
  border-bottom-right-radius: 0.1rem;
  border-bottom-left-radius: 0.1rem;
}

.list-group-item:hover {
  background-color: var(--card-alt-background);
  transform: translateY(-0.05rem);
  box-shadow: 0 0.1rem 0.2rem rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.list-group-item.active {
  z-index: 2;
  color: white;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.list-group-item-divider {
  border-bottom: 1px solid var(--divider-color);
}