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

:root {
  --primary: #03a84e;
  --primary-hover: #028f42;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --border: #d0d5dd;
  --text: #1d2939;
  --text-muted: #667085;
  --error: #f04438;
  --success: #12b76a;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
}

header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

header p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--card-bg);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: #f0fdf4;
}

.drop-zone-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

.drop-zone-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.drop-zone-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

input[type='file'] {
  display: none;
}

.status {
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}

.status-info {
  background: #eef2ff;
  color: #3538cd;
}

.status-success {
  background: #ecfdf3;
  color: #067647;
}

.status-error {
  background: #fef3f2;
  color: #b42318;
}

#preview {
  margin-top: 24px;
}

.sheet-spacer {
  height: 1px;
}

.hidden {
  display: none !important;
}

.preview-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #f9fafb;
}

.preview-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.tab-bar {
  display: flex;
  overflow-x: auto;
  background: #f0f1f3;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  gap: 2px;
}

.tab-bar::-webkit-scrollbar {
  height: 4px;
}

.tab-bar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.tab-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.tab-btn:hover {
  color: var(--text);
  background: #e4e5e8;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--card-bg);
  font-weight: 600;
}

.tab-panels {
  position: relative;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.preview-table th {
  background: #f9fafb;
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.preview-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  white-space: pre-line;
  overflow-wrap: break-word;
  word-break: break-word;
}

.preview-table tr:hover td {
  background: #f9fafb;
}

.preview-note {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

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

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

footer {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

footer a {
  color: var(--primary);
  text-decoration: none;
}
