:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2e38;
  --text: #e6e8ec;
  --text-dim: #8a8f9c;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --err: #ff5c5c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 {
  margin: 0 0 4px;
  font-size: 20px;
}
.topbar h1 span {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 14px;
  margin-left: 8px;
}
.subtitle {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 74px);
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}

.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.08);
}

.upload-box { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }

#upload-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
}
#upload-btn:disabled { opacity: .5; cursor: default; }
#upload-btn:hover:not(:disabled) { filter: brightness(1.1); }

.status { margin: 0; font-size: 12px; min-height: 16px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  margin: 0 0 10px;
}

.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.file-item {
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.file-item:hover { background: var(--panel); }
.file-item.active { background: rgba(79, 140, 255, 0.15); color: var(--accent); }
.file-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .badge { font-size: 10px; color: var(--text-dim); flex-shrink: 0; }

.main-panel { display: flex; flex-direction: column; min-width: 0; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

.tab-content { flex: 1; display: none; overflow: auto; padding: 20px; }
.tab-content.active { display: block; }

.empty-hint { color: var(--text-dim); font-size: 14px; text-align: center; margin-top: 80px; }

.preview-wrap {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: center;
}
.preview-wrap img { max-width: 100%; height: auto; }

.text-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}
