/* 苹果风格UI设计 - FriendshipQuiz */

/* 基础样式变量 */
:root {
  --apple-primary: #007AFF;
  --apple-secondary: #5AC8FA;
  --apple-accent: #FF3B30;
  --apple-success: #34C759;
  --apple-warning: #FF9500;
  --apple-gray-1: #F2F2F7;
  --apple-gray-2: #E5E5EA;
  --apple-gray-3: #D1D1D6;
  --apple-gray-4: #C7C7CC;
  --apple-gray-5: #8E8E93;
  --apple-gray-6: #636366;
  --apple-text-primary: #000000;
  --apple-text-secondary: #3C3C43;
  --apple-text-tertiary: #3C3C4399;
  --apple-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --apple-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 全局样式 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--apple-text-primary);
  line-height: 1.47059;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 苹果风格按钮 */
.apple-btn {
  background: var(--apple-primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--apple-shadow);
}

.apple-btn:hover {
  background: #0051D5;
  transform: translateY(-1px);
  box-shadow: var(--apple-shadow-hover);
}

.apple-btn:active {
  transform: translateY(0);
  box-shadow: var(--apple-shadow);
}

/* 苹果风格卡片 */
.apple-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--apple-shadow);
  transition: all 0.3s ease;
}

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

/* 苹果风格输入框 */
.apple-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--apple-gray-3);
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s ease;
  background: white;
}

.apple-input:focus {
  outline: none;
  border-color: var(--apple-primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* 苹果风格单选按钮 */
.apple-radio {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 12px;
}

.apple-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.apple-radio .checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: white;
  border: 2px solid var(--apple-gray-3);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.apple-radio:hover .checkmark {
  border-color: var(--apple-primary);
}

.apple-radio input[type="radio"]:checked ~ .checkmark {
  background-color: var(--apple-primary);
  border-color: var(--apple-primary);
}

.apple-radio .checkmark:after {
  content: "";
  position: absolute;
  display: none;
  top: 6px;
  left: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.apple-radio input[type="radio"]:checked ~ .checkmark:after {
  display: block;
}

/* 苹果风格进度条 */
.apple-progress {
  width: 100%;
  height: 4px;
  background-color: var(--apple-gray-2);
  border-radius: 2px;
  overflow: hidden;
}

.apple-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--apple-primary), var(--apple-secondary));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* 苹果风格导航栏 */
.apple-nav {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--apple-gray-2);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* 苹果风格渐变背景 */
.apple-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 苹果风格阴影效果 */
.apple-shadow-sm {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.apple-shadow-md {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.apple-shadow-lg {
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* 苹果风格动画 */
.apple-fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.apple-slide-up {
  animation: slideUp 0.6s ease-out;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
  .apple-card {
    padding: 16px;
    border-radius: 8px;
  }
  
  .apple-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .apple-input {
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --apple-gray-1: #1C1C1E;
    --apple-gray-2: #2C2C2E;
    --apple-gray-3: #38383A;
    --apple-gray-4: #48484A;
    --apple-gray-5: #636366;
    --apple-gray-6: #8E8E93;
    --apple-text-primary: #FFFFFF;
    --apple-text-secondary: #EBEBF5;
    --apple-text-tertiary: #EBEBF599;
    --apple-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --apple-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
  }
  
  body {
    background: #000000;
    color: var(--apple-text-primary);
  }
  
  .apple-card {
    background: var(--apple-gray-1);
    border: 1px solid var(--apple-gray-3);
  }
  
  .apple-input {
    background: var(--apple-gray-2);
    border-color: var(--apple-gray-4);
    color: var(--apple-text-primary);
  }
  
  .apple-nav {
    background: rgba(28, 28, 30, 0.8);
    border-bottom-color: var(--apple-gray-3);
  }
}

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

::-webkit-scrollbar-track {
  background: var(--apple-gray-1);
}

::-webkit-scrollbar-thumb {
  background: var(--apple-gray-4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--apple-gray-5);
}

/* 选择文本样式 */
::selection {
  background: var(--apple-primary);
  color: white;
}

/* 焦点样式 */
:focus {
  outline: 2px solid var(--apple-primary);
  outline-offset: 2px;
}

/* 禁用文本选择 */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 链接样式 */
a {
  color: var(--apple-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #0051D5;
  text-decoration: underline;
}

/* 按钮组 */
.apple-button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.apple-button-group .apple-btn {
  flex: 1;
  min-width: 120px;
}

/* 标签样式 */
.apple-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--apple-gray-1);
  border: 1px solid var(--apple-gray-3);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--apple-text-secondary);
}

/* 徽章样式 */
.apple-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--apple-accent);
  color: white;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* 分隔线 */
.apple-divider {
  height: 1px;
  background: var(--apple-gray-2);
  margin: 24px 0;
}

/* 工具提示 */
.apple-tooltip {
  position: relative;
  display: inline-block;
}

.apple-tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: var(--apple-gray-6);
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
}

.apple-tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* 加载动画 */
.apple-loader {
  border: 3px solid var(--apple-gray-2);
  border-top: 3px solid var(--apple-primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

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