:root {
  --bg: #f5f7fa;
  --elev: #ffffff;
  --soft: #eef1f5;
  --line: #d7dde5;
  --line-soft: #e6ebf1;
  --text: #1f2933;
  --muted: #6b7484;
  --accent: #0b7fc4;
  --accent-soft: rgba(11, 127, 196, 0.12);
  --danger: #cf222e;
  --green: #1a7f37;
  --orange: #9a6700;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: var(--elev);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; }
.brand-icon { font-size: 19px; }
.top-actions { display: flex; align-items: center; }

.admin-panel {
  max-width: 1040px;
  margin: 12px auto 0;
  padding: 10px 14px;
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.code-form { display: flex; gap: 8px; }
.code-form input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  outline: none;
}
.code-form input:focus { border-color: var(--accent); }
.admin-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-tip { color: var(--muted); font-size: 12px; }

.btn {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 13px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.danger { color: var(--danger); border-color: rgba(207,34,46,.35); }

.container { max-width: 1080px; margin: 0 auto; padding: 14px 16px 60px; }
.usage-bar { margin-bottom: 12px; }
.usage-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.usage-track { height: 7px; border-radius: 8px; background: var(--line-soft); overflow: hidden; }
.usage-fill { height: 100%; width: 0; background: linear-gradient(90deg, #0b7fc4, #1a7f37); transition: width .3s; }

.crumb-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.crumb {
  border: 0;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 11px;
  border-radius: 8px;
  font-weight: 600;
}
.crumb-text { color: var(--muted); font-size: 13px; word-break: break-all; }
.crumb-bar .btn { margin-left: auto; }

.file-list {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.empty { text-align: center; color: var(--muted); padding: 46px 10px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #fafbfc; }
.file-icon { font-size: 18px; flex: 0 0 auto; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-name a { color: var(--accent); text-decoration: none; }
.file-name a:hover { text-decoration: underline; }
.file-dir { border: 0; background: none; padding: 0; text-align: left; color: var(--text); font-weight: 600; }
.file-size { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.file-time { color: var(--muted); font-size: 12px; flex: 1 0 120px; text-align: right; }
.file-actions { display: flex; gap: 5px; flex-wrap: wrap; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1f2933;
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  z-index: 50;
  font-size: 13px;
  max-width: min(90vw, 420px);
}

@media (max-width: 700px) {
  .file-row { flex-wrap: wrap; }
  .file-name { flex: 1 1 100%; order: 1; white-space: normal; }
  .file-size { order: 2; }
  .file-time { order: 3; flex: 1 0 auto; text-align: right; }
  .file-actions { order: 4; width: 100%; }
  .container { padding: 12px 10px 60px; }
  .admin-tools .btn { flex: 1; }
}
