/* 
 * UDID 获取工具 - 样式表
 * 现代化 UI 设计
 */

/* ========== 基础变量 ========== */
:root {
  --primary: #007AFF;
  --primary-hover: #0056CC;
  --primary-light: rgba(0, 122, 255, 0.1);
  --success: #34C759;
  --success-light: rgba(52, 199, 89, 0.1);
  --error: #FF3B30;
  --error-light: rgba(255, 59, 48, 0.1);
  --warning: #FF9500;
  --warning-light: rgba(255, 149, 0, 0.1);
  
  --bg-primary: #F2F2F7;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #E5E5EA;
  
  --text-primary: #1C1C1E;
  --text-secondary: #8E8E93;
  --text-tertiary: #C7C7CC;
  
  --border-color: #E5E5EA;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --text-tertiary: #48484A;
    
    --border-color: #38383A;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
}

/* ========== 重置样式 ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* ========== 布局 ========== */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== 头部 ========== */
.header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 600;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

/* ========== 主要内容 ========== */
.main {
  flex: 1;
  padding: 24px 0;
}

/* ========== 提示区域 ========== */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--warning-light);
  border-radius: var(--radius-md);
  color: var(--warning);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.notice-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ========== 二维码区域 ========== */
.qrcode-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.qrcode-container {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.qrcode {
  width: 180px;
  height: 180px;
}

.qrcode canvas {
  width: 100% !important;
  height: 100% !important;
}

.qrcode-tip {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ========== 操作区域 ========== */
.action-section {
  text-align: center;
  margin-bottom: 32px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--primary), #5856D6);
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.5);
}

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

.btn-icon {
  width: 20px;
  height: 20px;
}

.action-tip {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ========== 返回按钮 ========== */
.btn-secondary {
  display: inline-block;
  padding: 14px 32px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* ========== 说明区域 ========== */
.info-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.info-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.info-title:not(:first-child) {
  margin-top: 20px;
}

.info-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-list {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: 20px;
  line-height: 1.8;
}

/* ========== 页脚 ========== */
.footer {
  padding: 20px 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-color);
}

/* ========== 加载状态 ========== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== 错误状态 ========== */
.error-state {
  text-align: center;
  padding: 40px 0;
}

.error-icon {
  width: 64px;
  height: 64px;
  color: var(--error);
  margin-bottom: 16px;
}

.error-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.error-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ========== 成功状态 ========== */
.result-state {
  padding: 20px 0;
}

.success-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.success-icon {
  width: 32px;
  height: 32px;
  color: var(--success);
}

.success-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--success);
}

/* ========== 设备信息卡片 ========== */
.device-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.device-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
}

.info-row.highlight {
  background: var(--primary-light);
  border: 1px solid var(--primary);
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 60px;
  flex-shrink: 0;
}

.info-value {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  word-break: break-all;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.copy-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.copy-btn svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.copy-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.copy-btn:hover svg {
  color: white;
}

/* ========== Toast 提示 ========== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 0.875rem;
  border-radius: var(--radius-xl);
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}

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

/* ========== 响应式 ========== */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  
  .qrcode-section {
    padding: 20px;
  }
  
  .qrcode {
    width: 150px;
    height: 150px;
  }
}

/* iOS Safari 特定样式 */
@supports (-webkit-touch-callout: none) {
  .notice {
    display: none;
  }
}
