:root {
  --bg: #0f1115; --panel: #161a22; --panel2: #1c212c; --border: #2a3040;
  --text: #e8ebf2; --muted: #8b94a8; --accent: #4f8cff; --danger: #ff5d5d;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.55;
}
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login form {
  width: min(340px, 90vw); display: flex; flex-direction: column; gap: 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
}
.login-brand { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.login-err { color: var(--danger); min-height: 1.2em; text-align: center; font-size: 13px; }

input, textarea, button, a.btn {
  font: inherit; color: var(--text); border-radius: 8px; outline: none;
}
input, textarea { background: #0b0e13; border: 1px solid var(--border); padding: 9px 12px; width: 100%; }
input:focus, textarea:focus { border-color: var(--accent); }
button, a.btn {
  background: var(--accent); border: 0; padding: 8px 14px; cursor: pointer;
  color: #fff; text-decoration: none; display: inline-block; text-align: center;
}
button:hover, a.btn:hover { filter: brightness(1.1); }
button.ghost { background: var(--panel2); border: 1px solid var(--border); }
button.small { padding: 3px 10px; font-size: 12px; }
a.btn.small { padding: 3px 10px; font-size: 12px; }

/* ---------- 顶栏 ---------- */
header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px; padding: 10px 20px;
  background: rgba(15, 17, 21, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 16px; white-space: nowrap; }
.disk { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.disk-bar { flex: 1; max-width: 320px; height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; }
.disk-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .4s; }
.disk-text { color: var(--muted); font-size: 12px; white-space: nowrap; }
.header-right { display: flex; align-items: center; gap: 8px; }
.dev-label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dev-label input { width: 100px; padding: 5px 8px; font-size: 12px; }

/* ---------- 双栏 ---------- */
main {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  padding: 16px 20px; max-width: 1280px; margin: 0 auto;
}
@media (max-width: 760px) {
  main { grid-template-columns: 1fr; }
  header { flex-wrap: wrap; row-gap: 8px; }
  .disk { order: 3; flex-basis: 100%; }
}
.col {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; min-height: calc(100vh - 140px);
}
.col h2 { margin: 0 0 12px; font-size: 15px; }

/* ---------- 剪贴板输入 ---------- */
.clip-input { display: flex; gap: 8px; margin-bottom: 12px; }
.clip-input textarea { flex: 1; min-height: 72px; max-height: 220px; resize: vertical; }
.clip-input button { align-self: flex-start; flex-shrink: 0; }

/* ---------- 列表 ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  animation: slidein .18s ease;
}
@keyframes slidein { from { opacity: 0; transform: translateY(-4px); } }
.meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.content {
  white-space: pre-wrap; word-break: break-all; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
li.expanded .content { -webkit-line-clamp: unset; }
.ops { display: flex; gap: 8px; margin-top: 8px; }
.ops button { padding: 4px 10px; font-size: 12px; }
.fname { font-weight: 600; word-break: break-all; }

/* ---------- 上传区 ---------- */
.drop {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 22px 14px; text-align: center; color: var(--muted);
  margin-bottom: 12px; transition: border-color .15s, background .15s; cursor: pointer;
}
.drop.drag { border-color: var(--accent); background: rgba(79, 140, 255, .08); color: var(--text); }
.drop-icon { font-size: 26px; }
.drop-hint { font-size: 12px; margin-top: 4px; opacity: .8; }
.fake-link { color: var(--accent); cursor: pointer; text-decoration: underline; }

/* ---------- 进度条 ---------- */
.progress { height: 6px; background: #0b0e13; border-radius: 3px; overflow: hidden; margin: 6px 0 2px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .2s; }

/* ---------- 弹窗 / toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  width: min(560px, 94vw); max-height: 86vh; overflow: auto; padding: 18px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modal-head h3 { margin: 0; }
.modal-sec { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.modal-sec h4 { margin: 0 0 10px; font-size: 14px; }
.modal-sec > input { margin-bottom: 8px; }
.token-create { display: flex; gap: 8px; }
.token-create input { flex: 1; margin: 0; }
.token-result { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.token-result input { flex: 1; min-width: 200px; margin: 0; font-family: ui-monospace, monospace; font-size: 12px; }
.token-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.token-table th, .token-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.token-table th { color: var(--muted); font-weight: 500; }
.empty { color: var(--muted); text-align: center !important; padding: 14px !important; }
.form-msg { color: var(--muted); min-height: 1.2em; margin-top: 6px; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #2b3244; border: 1px solid var(--border); color: var(--text);
  padding: 9px 18px; border-radius: 20px; z-index: 99; box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
  font-size: 13px;
}
