:root {
  --primary: #3370ff;
  --primary-hover: #2860e0;
  --danger: #e34d59;
  --warning: #ed7b2f;
  --success: #2ba471;
  --bg: #f5f6f7;
  --card-bg: #ffffff;
  --text: #1f2329;
  --text-secondary: #646a73;
  --border: #dee0e3;
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left .logo {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
}

.header-left .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.user-info img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

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

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

.btn-outline:hover { background: var(--bg); }

.btn-large {
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 500;
}

/* Main Content */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Login Page */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  text-align: center;
}

.login-page h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.login-page p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 15px;
}

.feishu-login-btn {
  background: var(--primary);
  color: white;
  padding: 12px 32px;
  border-radius: var(--radius);
  font-size: 16px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.feishu-login-btn:hover { background: var(--primary-hover); }

/* Upload Area */
.upload-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  border: 2px dashed var(--border);
  transition: all 0.3s;
  cursor: pointer;
  margin-bottom: 24px;
}

.upload-card:hover, .upload-card.dragover {
  border-color: var(--primary);
  background: #f0f5ff;
}

.upload-card .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.upload-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.upload-card p {
  color: var(--text-secondary);
  font-size: 13px;
}

.upload-card input[type="file"] {
  display: none;
}

/* Progress */
.progress-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  display: none;
}

.progress-bar {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar .fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s;
  animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.progress-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Report */
.report {
  display: none;
}

.report-header {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.report-header h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-item {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
}

.stat-item .number {
  font-size: 24px;
  font-weight: 600;
}

.stat-item .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-item.error .number { color: var(--danger); }
.stat-item.warning .number { color: var(--warning); }
.stat-item.success .number { color: var(--success); }

/* Issue Cards */
.section {
  margin-bottom: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.issue-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  border-left: 3px solid transparent;
}

.issue-card.error { border-left-color: var(--danger); }
.issue-card.warning { border-left-color: var(--warning); }
.issue-card.safe { border-left-color: var(--success); }

.issue-card .seg-id {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.issue-card .text-row {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 4px;
}

.issue-card .text-row .label {
  color: var(--text-secondary);
  font-weight: 500;
  margin-right: 8px;
}

.issue-card .issue-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.issue-card .issue-detail .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 4px;
}

.tag-missing { background: #fde8e8; color: var(--danger); }
.tag-extra { background: #fff3e0; color: var(--warning); }

/* Responsive */
@media (max-width: 640px) {
  .main { padding: 16px; }
  .upload-card { padding: 32px 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .header { padding: 0 16px; }
}

/* Hidden utility */
.hidden { display: none !important; }
