:root {
  --bg: #0b101b;
  --card: #151c2b;
  --card-alt: #1b2436;
  --border: rgba(148, 163, 184, 0.18);
  --text: #eef2f8;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #38bdf8;
  --primary: #2563eb;
  --primary-h: #1d4ed8;
  --danger: #f87171;
  --ok: #34d399;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; text-align: center;
}
.login-card h2 { font-size: 19px; margin-bottom: 6px; }
.login-card p { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.login-card input {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: #0f1624; color: var(--text); font-size: 14px; margin-bottom: 12px; outline: none;
}
.login-card input:focus { border-color: var(--accent); }

.app { max-width: 1080px; margin: 0 auto; padding: 18px 18px 48px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.home-link { font-size: 12px; color: var(--muted); text-decoration: none; font-weight: 400; margin-left: 6px; }
.home-link:hover { color: var(--accent); }

.top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quota-box { min-width: 190px; }
.quota-text { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; font-family: Consolas, monospace; }
.quota-track { height: 6px; border-radius: 999px; background: #222d42; overflow: hidden; }
.quota-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.25s ease; }

.btn {
  border: 1px solid var(--border); background: var(--card-alt); color: var(--text);
  border-radius: 9px; padding: 8px 14px; font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--primary-h); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.full { width: 100%; padding: 11px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  border-radius: 10px; padding: 8px 15px; font-size: 13.5px; cursor: pointer; font-weight: 500;
}
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 18px;
}

.drop-zone {
  border: 2px dashed rgba(56, 189, 248, 0.35); border-radius: 12px; padding: 28px 16px;
  text-align: center; cursor: pointer; transition: all 0.18s; background: rgba(56, 189, 248, 0.04);
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: rgba(56, 189, 248, 0.10); }
.drop-icon { font-size: 30px; margin-bottom: 6px; }
.drop-title { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.drop-sub { font-size: 12px; color: var(--muted); }

.upload-opts {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px;
}
.opt { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.opt select, .opt input[type="text"], .input {
  background: #0f1624; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; outline: none;
}
.check-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }

.progress-wrap { margin-top: 12px; }
.progress-text { font-size: 12px; color: var(--accent); margin-bottom: 6px; font-family: Consolas, monospace; }

.clip-top { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.clip-top .input:first-child { flex: 1; min-width: 180px; }
.textarea {
  width: 100%; background: #0f1624; border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-family: Consolas, monospace; font-size: 13px; resize: vertical; outline: none;
}

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.img-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}
.img-thumb {
  height: 150px; background: #0f1624; display: flex; align-items: center; justify-content: center;
  cursor: zoom-in; overflow: hidden;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-meta { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { font-size: 11.5px; color: var(--muted); }
.item-ops { display: flex; gap: 5px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }

.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-row {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.file-info { flex: 1; min-width: 200px; }
.badge {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: rgba(56, 189, 248, 0.14); color: var(--accent); margin-left: 6px;
}
.badge.warn { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }

.clip-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 10px;
}
.clip-pre {
  margin-top: 8px; white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow-y: auto;
  background: #0f1624; padding: 10px; border-radius: 8px; font-family: Consolas, monospace; font-size: 12.5px;
}

.empty { text-align: center; padding: 48px 16px; color: var(--dim); font-size: 14px; }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.85);
  display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.lightbox img { max-width: 95vw; max-height: 92vh; border-radius: 10px; }

.toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--card-alt); border: 1px solid var(--border); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-size: 13px;
}
.toast.err { border-color: var(--danger); color: var(--danger); }
