* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #667eea;
  --primary-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #f9fafb;
  --white: #fff;
  --border: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  --radius: 0.5rem;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--primary-grad); padding: 1rem; }
.login-container { width: 100%; max-width: 400px; }
.login-card { background: var(--white); border-radius: var(--radius); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); padding: 2.5rem; }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.login-header p { color: var(--text-light); font-size: 0.875rem; }

/* 表单 */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.875rem; }
.form-control { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.875rem; transition: 0.2s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
textarea.form-control { min-height: 180px; resize: vertical; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius); font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary-grad); color: var(--white); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 警告 */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.875rem; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }

/* 头部 */
.app-header { background: var(--primary-grad); color: var(--white); padding: 1rem 2rem; box-shadow: var(--shadow); }
.header-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.app-title { font-size: 1.25rem; font-weight: 700; }
.header-actions { display: flex; gap: 0.75rem; }
.header-actions .btn { padding: 0.5rem 1rem; font-size: 0.75rem; }

/* 主内容 */
.app-main { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 2rem; }

/* 卡片 */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.card-title { font-size: 1.125rem; font-weight: 600; }
.next-check-timer { font-size: 0.75rem; color: var(--text-light); font-weight: normal; }
.next-check-timer span { color: var(--primary); font-weight: 600; font-family: monospace; font-size: 1rem; }

/* 统计 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; text-align: center; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-light); }

/* 单选 */
.radio-group { display: flex; gap: 1.5rem; margin-bottom: 1rem; }
.radio-item { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.radio-item input { width: 1rem; height: 1rem; }

/* 邮件列表 */
.email-list { margin-top: 1rem; }
.email-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }
.email-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.email-recipient { font-weight: 600; font-size: 0.875rem; }
.email-subject { font-size: 0.875rem; color: var(--text-light); margin-bottom: 0.5rem; }
.email-meta { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--text-light); flex-wrap: wrap; }
.email-status { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 0.25rem; font-size: 0.75rem; font-weight: 500; }
.status-sent { background: #ecfdf5; color: var(--success); }
.status-failed { background: #fef2f2; color: var(--danger); }
.status-scheduled { background: #fffbeb; color: var(--warning); }
.status-pending { background: #eff6ff; color: var(--info); }

/* 加载 */
.spinner { display: inline-block; width: 1rem; height: 1rem; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: white; animation: spin 0.6s linear infinite; margin-right: 0.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .app-main { padding: 1rem; }
  .header-content { flex-direction: column; gap: 1rem; text-align: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}