/* 资产拍摄 · admin 后台样式 */
:root {
  --bg: #0b1220;
  --surface: #121a2b;
  --surface-2: #1a2438;
  --border: #243350;
  --text: #e8eef8;
  --text-dim: #93a4c3;
  --accent: #38bdf8;
  --accent-deep: #0ea5e9;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
[hidden] { display: none !important; }

.btn {
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border: none; color: #04222f;
  box-shadow: 0 5px 16px rgba(56, 189, 248, .26), 0 1px 0 rgba(255, 255, 255, .18) inset;
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 7px 20px rgba(56, 189, 248, .34); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 3px 9px rgba(56, 189, 248, .28); }
.btn-danger { background: var(--danger); border: none; color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }
/* 提交中：文字隐藏 + 转圈，防重复提交 */
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid rgba(4, 34, 47, .3); border-top-color: #04222f;
  border-radius: 50%; animation: btnspin .65s linear infinite;
}
@keyframes btnspin { to { transform: rotate(360deg); } }
.btn-text { color: var(--text-dim); font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.btn-text:hover { background: var(--surface-2); color: var(--text); }

/* 登录 */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card {
  width: min(380px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 30px 24px 24px; text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.login-logo { font-size: 44px; margin-bottom: 10px; line-height: 1; filter: drop-shadow(0 4px 12px rgba(56, 189, 248, .28)); }
.login-card h1 { font-size: 20px; margin-bottom: 24px; font-weight: 700; letter-spacing: .5px; }
.field { text-align: left; margin-bottom: 16px; position: relative; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; font-weight: 500; }
.field input {
  width: 100%; background: var(--bg); border: 1.5px solid #4d76ad; color: var(--text);
  border-radius: 11px; padding: 13px 14px; font-size: 16px; outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input::placeholder { color: #5b6b87; }
/* 聚焦：主色边框 + 外发光 */
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .16);
}
.field input.has-toggle { padding-right: 46px; }
/* 密码显隐按钮 */
.pw-toggle {
  position: absolute; right: 6px; top: 32px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-dim); font-size: 17px; border-radius: 8px;
}
.pw-toggle:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.login-err {
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: #fca5a5;
  font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; line-height: 1.5;
}

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px; background: rgba(11,18,32,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 700; font-size: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.user-badge {
  font-size: 13px; color: #c8d4ea; background: rgba(255, 255, 255, .06);
  padding: 4px 10px; border-radius: 999px; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== 归属人标记 ===== */
.asset-owner {
  font-size: 12px; color: var(--accent); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== 归属筛选 ===== */
#ownerFilter {
  padding: 10px 12px; border-radius: 10px; border: 1.5px solid #4d76ad;
  background: var(--surface); color: var(--text); font-size: 14px; max-width: 160px;
  outline: none; transition: border-color .18s ease, box-shadow .18s ease;
}
#ownerFilter:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(56, 189, 248, .16); }

/* ===== 用户管理面板 ===== */
.users-panel {
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px; padding: 14px; margin-bottom: 12px;
}
.up-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 15px; }
.up-add { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.up-add input, .up-add select {
  padding: 11px 12px; border-radius: 10px; border: 1.5px solid #4d76ad;
  background: var(--bg); color: var(--text); font-size: 14px; flex: 1 1 120px; min-width: 110px;
  transition: border-color .18s ease, box-shadow .18s ease; outline: none;
}
.up-add input::placeholder { color: #5b6b87; }
.up-add input:focus, .up-add select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px rgba(56, 189, 248, .16);
}
.up-add button { flex: 0 0 auto; }
.up-list { display: flex; flex-direction: column; gap: 8px; }
.up-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, .04);
}
.up-info { min-width: 0; flex: 1; }
.up-name { font-size: 14px; color: #e6edf8; }
.self-tag { color: #6b7a97; font-size: 12px; }
.up-meta { font-size: 12px; color: #8494b0; margin-top: 3px; }
.up-acts { display: flex; gap: 4px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.role-tag { padding: 1px 7px; border-radius: 999px; font-size: 11px; }
.role-admin { background: rgba(255, 176, 32, .16); color: #ffb020; }
.role-user { background: rgba(120, 160, 255, .14); color: #8fb0ff; }
.btn-danger-text { color: #ff6b6b; }
.up-empty { padding: 16px; text-align: center; color: #6b7a97; font-size: 13px; }

.login-switch { margin-top: 14px; font-size: 13px; color: #6b7a97; text-align: center; }
.login-switch a { color: var(--accent); text-decoration: none; }

/* 工具栏 & 列表 */
.toolbar { display: flex; gap: 10px; padding: 16px 18px 6px; }
.toolbar input {
  flex: 1; background: var(--surface); border: 1.5px solid #4d76ad; color: var(--text);
  border-radius: 10px; padding: 10px 13px; font-size: 14px; outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.toolbar input:focus, .toolbar select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px rgba(56, 189, 248, .16);
}
.stats { padding: 4px 18px 10px; font-size: 13px; color: var(--text-dim); }

.asset-list { padding: 6px 18px 10px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.asset-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s;
}
.asset-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.asset-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: #0a0f1c; height: 150px; }
.asset-thumbs .th { position: relative; overflow: hidden; background: var(--surface-2); }
.asset-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-thumbs .more { position: absolute; inset: 0; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.asset-thumbs .vtag { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 8px; }
.asset-info { padding: 12px 14px; }
.asset-name { font-weight: 700; font-size: 15px; margin-bottom: 5px; word-break: break-all; }
.asset-meta { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 12px 0 30px; color: var(--text-dim); font-size: 14px; }
.list-empty { text-align: center; padding: 60px 0 30px; color: var(--text-dim); }
.list-empty-icon { font-size: 46px; margin-bottom: 10px; }
.list-empty-sub { font-size: 13px; margin-top: 6px; color: #55648a; }

/* 弹层 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(3px); }
.modal-box {
  width: min(480px, 100%); max-height: 90dvh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.modal-lg { width: min(960px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.icon-btn { font-size: 22px; color: var(--text-dim); width: 34px; height: 34px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.d-meta { font-size: 13.5px; color: var(--text-dim); line-height: 1.7; margin-bottom: 14px; }
.d-meta b { color: var(--text); }
.d-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.d-actions .btn { text-decoration: none; display: inline-flex; align-items: center; }
.d-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.d-media .m-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); aspect-ratio: 1; cursor: pointer; }
.d-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-media .m-tag { position: absolute; left: 5px; top: 5px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 8px; }
.d-media video { width: 100%; height: 100%; object-fit: cover; }

/* 大图查看 */
#viewer { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 60; display: flex; align-items: center; justify-content: center; }
#viewer img, #viewer video { max-width: 96vw; max-height: 90dvh; object-fit: contain; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: rgba(20,28,46,.96); border: 1px solid var(--border); color: var(--text);
  padding: 11px 20px; border-radius: 12px; font-size: 14px; z-index: 70; max-width: 86vw;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
#toast.ok { border-color: var(--ok); }
#toast.err { border-color: var(--danger); }

@media (max-width: 640px) {
  .asset-list { grid-template-columns: 1fr; }
  .toolbar { flex-direction: row; }
}
