/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* 头部 */
header {
  padding: 24px 32px 16px;
  border-bottom: 1px solid #eee;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.subtitle {
  color: #666;
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Tab 导航 */
.tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}

.tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: none;
  font-size: 0.95rem;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.tab:hover {
  color: #333;
  background: #f9f9f9;
}

.tab.active {
  color: #4a90d9;
  border-bottom-color: #4a90d9;
  font-weight: 500;
}

/* 内容区域 */
main {
  padding: 24px 32px 32px;
}

.section {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

/* 按钮 */
.btn-primary {
  padding: 10px 24px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #3a7bc8;
}

.btn-primary:disabled {
  background: #a0c4e8;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 8px 16px;
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 16px;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-copy {
  padding: 4px 12px;
  background: #e8f4fd;
  color: #4a90d9;
  border: 1px solid #b8d9f0;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: #d0ebfa;
}

.btn-copy.copied {
  background: #d4edda;
  color: #28a745;
  border-color: #a3d9b1;
}

/* 加载状态 */
.loading {
  margin-top: 16px;
  color: #666;
  font-size: 0.9rem;
  align-items: center;
  gap: 8px;
}

.loading:not([hidden]) {
  display: flex;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top-color: #4a90d9;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 错误提示 */
.error-box {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 0.9rem;
}

/* 结果列表 */
.result-list {
  list-style: none;
  margin-top: 16px;
}

.result-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

/* 邮件列表 */
.mail-list {
  list-style: none;
  margin-top: 16px;
}

.mail-list li {
  padding: 12px 14px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.mail-list li:hover {
  background: #f0f7ff;
  border-color: #b8d9f0;
}

.mail-list .mail-from {
  font-size: 0.85rem;
  color: #666;
}

.mail-list .mail-subject {
  font-weight: 500;
  margin-top: 4px;
}

.mail-list .mail-time {
  font-size: 0.8rem;
  color: #999;
  margin-top: 4px;
}

.mail-list .mail-unread {
  border-left: 3px solid #4a90d9;
}

/* 邮件详情 */
.mail-detail {
  margin-top: 16px;
}

.mail-detail-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.mail-detail-header h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.mail-detail-header .meta {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.8;
}

.mail-detail-body {
  padding: 16px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #eee;
  min-height: 200px;
  overflow: auto;
}

.mail-detail-body iframe {
  width: 100%;
  min-height: 300px;
  border: none;
}
