/* Base styles */
:root {
  --primary-color: #4667f5;
  --primary-light: #e0e7ff;
  --primary-dark: #3b4fd7;
  --secondary-color: #6366f1;
  --success-color: #52c41a;
  --warning-color: #fa8c16;
  --danger-color: #f5222d;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --border-radius: 12px;
  --card-border-radius: 12px;
  --transition-speed: 0.3s;
  --box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-color);
  background-color: #f5f7fa;
  -webkit-tap-highlight-color: transparent;
  max-width: 100vw;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Hide scrollbar but keep functionality */
::-webkit-scrollbar {
  display: none;
}

* {
  -ms-overflow-style: none;
  scrollbar-width: none;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Smooth animations */
.page-transition {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes slideInUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.animate-fadeIn { animation: fadeIn 0.5s ease-out forwards; }
.animate-slideInRight { animation: slideInRight 0.3s ease-out; }
.animate-slideInLeft { animation: slideInLeft 0.3s ease-out; }
.animate-slideInUp { animation: slideInUp 0.4s ease-out forwards; }
.animate-pulse { animation: pulse 2s infinite; }

.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.delay-5 { animation-delay: 0.5s; opacity: 0; }
.delay-6 { animation-delay: 0.6s; opacity: 0; }

/* Card components */
.card {
  background: white;
  border-radius: var(--card-border-radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Button styles */
.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all var(--transition-speed);
  text-align: center;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

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

.btn-primary:active {
  background: var(--primary-dark);
  transform: scale(0.98);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:active {
  background: var(--primary-light);
}

/* List items */
.list-item {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition-speed);
  position: relative;
}

.list-item::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-top: 2px solid #d9d9d9;
  border-right: 2px solid #d9d9d9;
  transform: translateY(-50%) rotate(45deg);
}

.list-item:active {
  background: var(--secondary-color);
}

/* Form elements */
.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  transition: all var(--transition-speed);
  font-size: 16px;
}

.input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(70, 103, 245, 0.1);
  outline: none;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 32px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e4e4e4;
  transition: .4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Navigation tabs */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: white;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #f0f0f0;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  color: var(--text-tertiary);
  transition: color var(--transition-speed);
  position: relative;
  flex: 1;
}

.tab-item.active {
  color: var(--primary-color);
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

.tab-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.tab-label {
  font-size: 12px;
}

/* Loading animations */
.loading {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(70, 103, 245, 0.1);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Grid layout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding: 16px;
}

/* Image styles */
.img-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

/* Status badges */
.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #f6ffed;
  color: var(--success-color);
}

.badge-warning {
  background: #fff7e6;
  color: var(--warning-color);
}

.badge-info {
  background: #e6f7ff;
  color: var(--primary-color);
}

/* Header styles */
.header {
  position: sticky;
  top: 0;
  background: white;
  padding: 16px;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Section dividers */
.section-divider {
  margin: 20px 0;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #f0f0f0;
}

.section-divider::before {
  margin-right: 10px;
}

.section-divider::after {
  margin-left: 10px;
}

/* Avatar styles */
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 24px;
}

/* Bottom safe area for modern phones */
.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Phone frame for preview */
.phone-frame {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 40px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  background: white;
}

.phone-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 30px;
  background: #000;
  border-radius: 0 0 16px 16px;
  z-index: 10;
}

.phone-frame::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 5px;
  background: #000;
  border-radius: 3px;
  z-index: 10;
}

/* 状态栏样式 */
.status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  background-color: transparent;
  color: #333;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 40px);
  padding-right: env(safe-area-inset-right, 40px);
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
}

.status-bar-light {
  color: #333;
}

.status-bar-dark {
  color: white;
}

.status-bar-time {
  font-weight: 600;
}

.status-bar-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 页面内容区域 */
.page-content {
  padding-top: 44px;
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  overflow: hidden;
}

/* 返回按钮 */
.back-button {
  position: absolute;
  left: 16px;
  top: 50px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.back-button i {
  color: white;
  font-size: 18px;
}

/* Responsive font sizes */
@media (max-width: 320px) {
  html {
    font-size: 14px;
  }
}

@media (min-width: 321px) and (max-width: 375px) {
  html {
    font-size: 15px;
  }
}

@media (min-width: 376px) {
  html {
    font-size: 16px;
  }
} 