/* ================================================
   能源科技充电桩小程序 - 样式
   ================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 430px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  position: relative;
}

/* ================================================
   登录页
   ================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-logo {
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.login-logo svg {
  width: 50px;
  height: 50px;
}

.login-title {
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin-bottom: 48px;
}

.login-form {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.login-form h3 {
  font-size: 18px;
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

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

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #0077b6;
  box-shadow: 0 0 0 3px rgba(0,119,182,0.1);
}

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.btn-primary {
  background: #0077b6;
  color: #fff;
}

.btn-primary:hover {
  background: #005f92;
}

.btn-secondary {
  background: #f5f5f5;
  color: #333;
}

.btn-block {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1px solid #0077b6;
  border-radius: 10px;
  background: transparent;
  color: #0077b6;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.login-tip {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: #999;
}

.login-tip a {
  color: #0077b6;
  text-decoration: none;
}

/* ================================================
   首页
   ================================================ */
.page-header {
  background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
  color: #fff;
  padding: 20px 16px 60px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  opacity: 0.9;
}

.header-user {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-search {
  background: #fff;
  border-radius: 24px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input {
  flex: 1;
  border: none;
  font-size: 14px;
  outline: none;
}

.header-search svg {
  color: #999;
}

.user-balance {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

.balance-card {
  flex: 1;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.balance-value {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.balance-label {
  font-size: 12px;
  opacity: 0.8;
}

/* 内容区 */
.page-content {
  padding: 0 16px;
  margin-top: -40px;
}

.section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
}

.section-more {
  font-size: 13px;
  color: #999;
  text-decoration: none;
}

/* 快捷功能 */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 20px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  margin-bottom: 24px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.quick-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.quick-icon.scan { background: #e0f2fe; }
.quick-icon.order { background: #dcfce7; }
.quick-icon.wallet { background: #fef3c7; }
.quick-icon.invoice { background: #f3e8ff; }

.quick-action span {
  font-size: 12px;
  color: #666;
}

/* 附近站点 */
.station-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.station-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.station-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.station-distance {
  font-size: 12px;
  color: #999;
}

.station-address {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

.station-info {
  display: flex;
  gap: 16px;
}

.station-stat {
  font-size: 12px;
  color: #666;
}

.station-stat strong {
  color: #0077b6;
}

.station-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.station-available {
  font-size: 12px;
  color: #666;
}

.station-available strong {
  color: #16a34a;
}

.btn-charge {
  padding: 8px 20px;
  background: #0077b6;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* 底部导航 */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #fff;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 100;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: #999;
  font-size: 11px;
  padding: 4px 16px;
}

.tab-item.active {
  color: #0077b6;
}

.tab-item svg {
  width: 24px;
  height: 24px;
}

/* ================================================
   充电页面
   ================================================ */
.charge-page {
  min-height: 100vh;
  background: #f5f5f5;
}

.charge-header {
  background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
  color: #fff;
  padding: 20px 16px;
  text-align: center;
}

.charge-device {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.charge-station {
  font-size: 13px;
  opacity: 0.8;
}

.charge-content {
  padding: 16px;
}

.charge-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.charge-status {
  text-align: center;
  margin-bottom: 24px;
}

.charge-progress-ring {
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
  position: relative;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: #e5e5e5;
  stroke-width: 12;
}

.progress-ring-fill {
  fill: none;
  stroke: #0077b6;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 502;
  stroke-dashoffset: 502;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.progress-percent {
  font-size: 36px;
  font-weight: 700;
  color: #333;
}

.progress-label {
  font-size: 13px;
  color: #999;
}

.charge-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.charge-info-item {
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
}

.charge-info-value {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.charge-info-label {
  font-size: 12px;
  color: #999;
}

.charge-tips {
  padding: 16px;
  background: #fff;
  border-radius: 12px;
}

.charge-tips h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: #333;
}

.charge-tips ul {
  list-style: none;
  font-size: 13px;
  color: #666;
}

.charge-tips li {
  margin-bottom: 8px;
  padding-left: 16px;
  position: relative;
}

.charge-tips li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 4px;
  height: 4px;
  background: #0077b6;
  border-radius: 50%;
}

/* ================================================
   订单页面
   ================================================ */
.order-page {
  min-height: 100vh;
  background: #f5f5f5;
}

.order-header {
  background: #fff;
  padding: 16px;
}

.order-tabs {
  display: flex;
  gap: 8px;
}

.order-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  color: #666;
  background: #f5f5f5;
  border-radius: 20px;
  cursor: pointer;
  border: none;
}

.order-tab.active {
  background: #0077b6;
  color: #fff;
}

.order-list {
  padding: 16px;
}

.order-item {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.order-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.order-id {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.order-status {
  font-size: 13px;
  font-weight: 500;
}

.order-status.completed { color: #16a34a; }
.order-status.charging { color: #0077b6; }
.order-status.cancelled { color: #999; }
.order-status.error { color: #dc2626; }

.order-item-body {
  margin-bottom: 12px;
}

.order-detail {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

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

.order-amount {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.order-actions {
  display: flex;
  gap: 8px;
}

.btn-small {
  padding: 6px 16px;
  font-size: 13px;
  border-radius: 16px;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #666;
}

.btn-small.primary {
  background: #0077b6;
  color: #fff;
  border-color: #0077b6;
}

/* ================================================
   通用
   ================================================ */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.status-dot.success { background: #16a34a; }
.status-dot.warning { background: #d97706; }
.status-dot.danger { background: #dc2626; }
.status-dot.info { background: #0077b6; }

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

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

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 340px;
  overflow: hidden;
}

.modal-header {
  padding: 20px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid #f0f0f0;
}

.modal-body {
  padding: 24px 20px;
  font-size: 14px;
  color: #666;
}

.modal-footer {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
}

.modal-footer button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}

.modal-footer .btn-cancel {
  background: #f5f5f5;
  color: #666;
}

.modal-footer .btn-confirm {
  background: #0077b6;
  color: #fff;
}
