/**
 * 邻动平台 - 全局样式文件
 * 功能：实现绿紫渐变主题和全局样式定义
 * 作者：BugadiVL
 */

/* 导入字体 */
@import url('https://fonts.loli.net/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* 全局样式 */
:root {
  --primary-green: #4CAF50;
  --primary-purple: #9C27B0;
  --gradient-primary: linear-gradient(to right, var(--primary-green), var(--primary-purple));
  --gradient-hover: linear-gradient(to right, #43A047, #8E24AA);
  --text-dark: #333333;
  --text-light: #666666;
  --text-lighter: #999999;
  --bg-light: #F5F7FA;
  --bg-white: #FFFFFF;
  --border-color: #E5E7EB;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --transition-base: all 0.3s ease;
}

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--bg-light);
  overflow-x: hidden;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--primary-green), var(--primary-purple));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #43A047, #8E24AA);
}

/* 渐变按钮 */
.btn-gradient {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
  text-align: center;
  display: inline-block;
  text-decoration: none;
}

.btn-gradient:hover {
  background: var(--gradient-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-gradient:active {
  transform: translateY(0);
}

/* 渐变边框 */
.border-gradient {
  position: relative;
  border-radius: var(--radius-md);
  padding: 1px;
  background: var(--gradient-primary);
}

.border-gradient-content {
  background: var(--bg-white);
  border-radius: calc(var(--radius-md) - 1px);
  padding: 1.5rem;
}

/* 渐变文本 */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

/* 渐变背景 */
.bg-gradient {
  background: var(--gradient-primary);
}

/* 卡片样式 */
.card {
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.card-header {
  background: var(--gradient-primary);
  color: white;
  padding: 1.25rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.02);
}

/* 表单样式 */
.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-dark);
  background-color: var(--bg-white);
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}

.form-control:focus {
  border-color: var(--primary-purple);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(156, 39, 176, 0.25);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: var(--transition-base);
}

.navbar-transparent {
  background-color: transparent;
}

.navbar-solid {
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
}

/* 页脚样式 */
.footer {
  background-color: #2D3748;
  color: white;
  padding: 3rem 0;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition-base);
}

.footer a:hover {
  color: white;
}

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 90%;
  width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* 徽章样式 */
.badge {
  display: inline-block;
  padding: 0.25em 0.6em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 10rem;
}

.badge-gradient {
  background: var(--gradient-primary);
  color: white;
}

/* 提示框样式 */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 1rem;
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  max-width: 350px;
}

.toast-success {
  border-left: 4px solid var(--primary-green);
}

.toast-error {
  border-left: 4px solid #f44336;
}

.toast-warning {
  border-left: 4px solid #ff9800;
}

.toast-info {
  border-left: 4px solid #2196f3;
}

/* 加载动画 */
.spinner {
  width: 40px;
  height: 40px;
  margin: 100px auto;
  background-color: var(--primary-purple);
  border-radius: 100%;
  animation: sk-scaleout 1.0s infinite ease-in-out;
}

@keyframes sk-scaleout {
  0% { 
    transform: scale(0);
  } 
  100% {
    transform: scale(1.0);
    opacity: 0;
  }
}

/* 响应式工具类 */
@media (max-width: 640px) {
  .hide-sm {
    display: none !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hide-md {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .hide-lg {
    display: none !important;
  }
}

/* 辅助工具类 */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

.text-left {
  text-align: left !important;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.5rem; }
.mt-6 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.5rem; }
.mb-6 { margin-bottom: 2rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.ml-5 { margin-left: 1.5rem; }
.ml-6 { margin-left: 2rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.mr-5 { margin-right: 1.5rem; }
.mr-6 { margin-right: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.5rem; }
.p-6 { padding: 2rem; }

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.fade-out {
  animation: fadeOut 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 特定页面样式 */
/* 首页 */
.hero-section {
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.9), rgba(156, 39, 176, 0.9)), url('https://picsum.photos/1920/1080') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 2rem;
}

.feature-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 停车位管理页 */
.parking-spot {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-base);
}

.parking-spot-available {
  border-left: 4px solid var(--primary-green);
}

.parking-spot-occupied {
  border-left: 4px solid #f44336;
}

.parking-spot-maintenance {
  border-left: 4px solid #ff9800;
}

/* 投票页 */
.vote-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-base);
}

.vote-progress {
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.vote-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
}

/* 后台管理页 */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 250px;
  background-color: #2D3748;
  color: white;
  padding: 1rem;
  overflow-y: auto;
  transition: var(--transition-base);
  z-index: 900;
}

.admin-content {
  margin-left: 250px;
  padding: 2rem;
  transition: var(--transition-base);
}

.admin-card {
  border-radius: var(--radius-md);
  padding: 1.5rem;
  background-color: var(--bg-white);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  
  .admin-sidebar.show {
    transform: translateX(0);
  }
  
  .admin-content {
    margin-left: 0;
  }
}

/* 微信小程序码样式 */
.qrcode-container {
  display: inline-block;
  padding: 1rem;
  background-color: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.qrcode-image {
  width: 150px;
  height: 150px;
}

.qrcode-text {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
}