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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f2f4f8;
  color: #1f2329;
  min-height: 100vh;
}

.container { max-width: 920px; margin: 0 auto; padding: 0 16px; }

/* ---------- 头部 ---------- */
.site-header {
  background: linear-gradient(135deg, #4a6cf7 0%, #6a5cff 60%, #8f5cff 100%);
  color: #fff;
  padding: 34px 0 28px;
  box-shadow: 0 4px 20px rgba(74, 108, 247, .25);
}
.site-header h1 { font-size: 30px; letter-spacing: 1px; }
.site-header .sub { font-size: 16px; font-weight: 400; opacity: .9; margin-left: 12px; }
.tagline { margin-top: 8px; font-size: 13px; opacity: .85; }

main { padding: 24px 0 60px; }

/* ---------- 上传卡片 ---------- */
.upload-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(31, 35, 41, .06);
  margin-bottom: 28px;
}
.uploader-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.nick-label { font-size: 14px; color: #646a73; white-space: nowrap; }
#nickname {
  flex: 1;
  max-width: 280px;
  padding: 8px 12px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border .2s;
  font-family: inherit;
}
#nickname:focus { border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74, 108, 247, .12); }

.drop-zone {
  border: 2px dashed #c3cad6;
  border-radius: 14px;
  padding: 34px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafbfc;
}
.drop-zone:hover, .drop-zone.drag { border-color: #4a6cf7; background: #f0f3ff; }
.dz-icon { font-size: 40px; margin-bottom: 8px; }
.drop-zone p { font-size: 14px; color: #4e5561; }
.dz-hint { margin-top: 6px; font-size: 12px !important; color: #8a919c !important; }

/* 上传进度 */
.progress-wrap { margin-top: 14px; }
.prog-row { margin-bottom: 10px; }
.prog-top { display: flex; justify-content: space-between; font-size: 12px; color: #646a73; margin-bottom: 4px; }
.prog-name { max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-bar { height: 6px; background: #eef0f4; border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; width: 0; background: linear-gradient(90deg, #4a6cf7, #8f5cff); transition: width .2s; }
.prog-row.done .prog-text { color: #2ea44f; }
.prog-row.fail .prog-text { color: #d93026; }

/* ---------- 文件列表 ---------- */
.files-section h2 { font-size: 18px; color: #1f2329; margin-bottom: 14px; }
.count { font-size: 13px; color: #8a919c; font-weight: 400; }

/* 工具栏：面包屑 + 新建文件夹 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 16px;
  font-weight: 600;
  color: #1f2329;
  min-height: 32px;
}
.crumb-link { color: #4a6cf7; cursor: pointer; font-weight: 500; }
.crumb-link:hover { text-decoration: underline; }
.crumb-sep { color: #a6adba; font-size: 13px; font-weight: 400; }

.file-card {
  background: #fff;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(31, 35, 41, .05);
  overflow: hidden;
}

/* 文件夹卡片（可点击进入） */
.folder-card { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.folder-card:hover { box-shadow: 0 4px 16px rgba(31, 35, 41, .12); transform: translateY(-1px); }
.folder-card .file-icon { background: #fff5e0; }
.enter-hint { color: #8a919c; font-size: 13px; white-space: nowrap; }
.file-main { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.file-icon {
  font-size: 30px;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: #f2f4f8;
  border-radius: 12px;
  flex-shrink: 0;
}
.file-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; flex-shrink: 0; border: 1px solid #eef0f4; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 15px; font-weight: 600; word-break: break-all; }
.file-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #8a919c; margin-top: 6px; }
.meta-up { color: #576b95; }
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: all .15s;
  font-family: inherit;
}
.btn-primary { background: #4a6cf7; color: #fff; }
.btn-primary:hover { background: #3c5ce5; }
.btn-ghost { background: #f0f2f6; color: #4e5561; }
.btn-ghost:hover { background: #e4e8ef; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- 评论区（微信/Qzone 风格） ---------- */
.comment-panel { display: none; border-top: 1px solid #f0f1f4; background: #fafbfc; padding: 14px 18px 16px; }
.comment-panel.open { display: block; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.no-comment, .loading { text-align: center; color: #a6adba; font-size: 13px; padding: 8px 0; }

.comment { display: flex; gap: 10px; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}
.c-body {
  flex: 1;
  background: #f2f3f5;
  border-radius: 0 10px 10px 10px;
  padding: 8px 12px;
  min-width: 0;
}
.c-name { font-size: 13px; color: #576b95; font-weight: 600; }
.c-content { font-size: 14px; color: #1f2329; margin-top: 2px; word-break: break-word; white-space: pre-wrap; }
.c-time { font-size: 11px; color: #a6adba; margin-top: 4px; text-align: right; }

.comment-input { background: #fff; border: 1px solid #e8ebf0; border-radius: 10px; padding: 10px; }
.ci-row { display: flex; gap: 8px; }
.ci-row + .ci-row { margin-top: 8px; align-items: flex-end; }
.ci-name {
  padding: 7px 10px;
  border: 1px solid #e8ebf0;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  width: 220px;
  max-width: 100%;
  font-family: inherit;
}
.ci-name:focus, .ci-content:focus { border-color: #4a6cf7; }
.ci-content {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e8ebf0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  resize: vertical;
  font-family: inherit;
  min-height: 44px;
}
.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

.empty {
  background: #fff;
  border-radius: 14px;
  padding: 60px 20px;
  text-align: center;
  color: #a6adba;
  font-size: 14px;
}
.hidden { display: none !important; }

/* ---------- 身份行 / 管理员 ---------- */
.identity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.identity { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.id-label { font-size: 12px; color: #8a919c; }
.id-chip {
  background: #eef2ff;
  color: #4a6cf7;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.id-hint { font-size: 11px; color: #a6adba; }
.btn-admin-on { background: #fdecec; color: #c5373a; }
.btn-danger { background: #d93026; color: #fff; }
.btn-danger:hover { background: #b3271e; }

/* 小图标按钮（重命名/删除） */
.btn-icon {
  border: none;
  background: #f0f2f6;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  text-decoration: none;
}
.btn-icon:hover { background: #e4e8ef; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal h3 { font-size: 17px; margin-bottom: 14px; color: #1f2329; }
.modal input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.modal input:focus { border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74, 108, 247, .12); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: #646a73; margin-bottom: 4px; }
.admin-hint { font-size: 12px; color: #8a919c; margin-top: 8px; line-height: 1.6; }
.confirm-text { font-size: 14px; color: #4e5561; line-height: 1.7; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2329;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  max-width: 86%;
}
.toast.show { opacity: 1; }
.toast-error { background: #c5373a; }

/* ---------- 评论区提示 ---------- */
.ci-hint { font-size: 12px; color: #8a919c; margin-bottom: 6px; }

/* ---------- 管理员按钮行 ---------- */
.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.admin-actions { display: flex; gap: 8px; }
.admin-only.hidden { display: none; }
.btn-admin-on { background: #fdecec; color: #c5373a; }
.btn-danger { background: #d93026; color: #fff; }
.btn-danger:hover { background: #b3271e; }

/* 小图标按钮（重命名/删除） */
.btn-icon {
  border: none;
  background: #f0f2f6;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  text-decoration: none;
}
.btn-icon:hover { background: #e4e8ef; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 380px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
#mPanel .modal,
.modal.modal-wide {
  max-width: 640px;
}
.modal h3 { font-size: 17px; margin-bottom: 14px; color: #1f2329; }
.modal input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.modal input:focus { border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74, 108, 247, .12); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: #646a73; margin-bottom: 4px; }
.confirm-text { font-size: 14px; color: #4e5561; line-height: 1.7; }

/* ---------- 管理面板 ---------- */
.panel-section { margin-top: 16px; }
.panel-section h4 { font-size: 14px; color: #1f2329; margin-bottom: 8px; }
.panel-hint { font-size: 12px; color: #8a919c; margin-bottom: 8px; line-height: 1.6; }
.audit-list, .snap-list {
  border: 1px solid #eef0f4;
  border-radius: 10px;
  background: #fafbfc;
  max-height: 260px;
  overflow-y: auto;
}
.audit-item, .snap-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #eef0f4;
  font-size: 13px;
}
.audit-item:last-child, .snap-item:last-child { border-bottom: none; }
.audit-time { color: #8a919c; font-family: ui-monospace, monospace; font-size: 12px; min-width: 160px; }
.audit-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #eef2ff;
  color: #4a6cf7;
  min-width: 60px;
  text-align: center;
  flex-shrink: 0;
}
.audit-type-delete { background: #fdecec; color: #c5373a; }
.audit-type-restore { background: #fff5e0; color: #b8810d; }
.audit-type-login { background: #e6f4ec; color: #2a8a4d; }
.audit-type-upload { background: #e6f4ff; color: #1f6fc4; }
.audit-type-comment { background: #f3e8ff; color: #6a3aaa; }
.audit-type-folder { background: #fff7e0; color: #9a6700; }
.audit-type-blacklist { background: #1f2329; color: #fff; }
.audit-type-unblock { background: #e6f4ec; color: #2a8a4d; }
.audit-target { color: #4e5561; flex: 1; word-break: break-all; min-width: 0; }
.audit-ip { color: #8a919c; font-family: ui-monospace, monospace; font-size: 12px; min-width: 110px; }
.snap-time { color: #4e5561; flex: 1; font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }
.snap-item .btn { padding: 4px 10px; font-size: 12px; flex-shrink: 0; }
.audit-item .btn-icon { width: 28px; height: 28px; font-size: 14px; flex-shrink: 0; }

/* 黑名单添加表单 */
.blacklist-add { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.blacklist-add input {
  flex: 1;
  min-width: 120px;
  padding: 7px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.blacklist-add input:focus { border-color: #4a6cf7; }
.blacklist-add .btn { padding: 7px 14px; font-size: 13px; flex-shrink: 0; }

/* ---------- COS 配置表单 ---------- */
.cos-form {
  border: 1px solid #eef0f4;
  border-radius: 10px;
  background: #fafbfc;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cos-form .field { margin-bottom: 8px; }
.cos-form input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.cos-form input:focus { border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74, 108, 247, .12); }
.cos-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.cos-actions .btn { padding: 7px 14px; font-size: 13px; }

/* ---------- 拉黑遮罩 ---------- */
.blackout {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, .85);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.blackout.hidden { display: none !important; }
.blackout-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 30px;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
.blackout-icon { font-size: 56px; margin-bottom: 12px; }
.blackout-card h2 { font-size: 20px; color: #c5373a; margin-bottom: 10px; }
.blackout-card p { font-size: 14px; color: #4e5561; line-height: 1.7; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2329;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  max-width: 86%;
}
.toast.show { opacity: 1; }
.toast-error { background: #c5373a; }

/* ---------- 评论（不显示昵称：去掉头像，左边圆角） ---------- */
.comment { display: flex; gap: 0; }
.c-body {
  flex: 1;
  background: #f2f3f5;
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 0;
}
.c-body.c-body-wide { border-radius: 10px; }
.c-content { font-size: 14px; color: #1f2329; word-break: break-word; white-space: pre-wrap; }
.c-time { font-size: 11px; color: #a6adba; margin-top: 4px; text-align: right; }

.comment-input { background: #fff; border: 1px solid #e8ebf0; border-radius: 10px; padding: 10px; }
.ci-row { display: flex; gap: 8px; }
.ci-row.ci-bottom { align-items: flex-end; }
.ci-content {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e8ebf0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  resize: vertical;
  font-family: inherit;
  min-height: 44px;
}
.ci-content:focus { border-color: #4a6cf7; }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

.empty {
  background: #fff;
  border-radius: 14px;
  padding: 60px 20px;
  text-align: center;
  color: #a6adba;
  font-size: 14px;
}
.hidden { display: none !important; }

@media (max-width: 640px) {
  .file-main { flex-wrap: wrap; }
  .file-actions { width: 100%; }
  .site-header h1 { font-size: 24px; }
  .audit-time { min-width: 0; }
  .audit-item { flex-wrap: wrap; }
}
