:root {
  --bg: #f4f6fb;
  --bg-2: #eef1f8;
  --text: #1c2230;
  --muted: #6b7385;
  --card: rgba(255, 255, 255, 0.55);
  --card-border: rgba(255, 255, 255, 0.7);
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --shadow: 0 20px 50px -20px rgba(40, 50, 90, 0.35);
  --radius: 20px;
}

[data-theme="dark"] {
  --bg: #0b0e17;
  --bg-2: #11152250;
  --text: #e8ecf5;
  --muted: #9aa3b8;
  --card: rgba(28, 33, 50, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* 背景光斑 */
.orb { position: fixed; border-radius: 50%; filter: blur(80px); opacity: 0.5; z-index: 0; pointer-events: none; }
.orb-a { width: 420px; height: 420px; background: #818cf8; top: -120px; left: -80px; animation: float 16s ease-in-out infinite; }
.orb-b { width: 360px; height: 360px; background: #f472b6; bottom: -100px; right: -60px; animation: float 20s ease-in-out infinite reverse; }
.orb-c { width: 300px; height: 300px; background: #34d399; top: 40%; left: 55%; opacity: 0.3; animation: float 24s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,-30px); } }

.glass {
  background: var(--card);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-radius: 0 0 var(--radius) var(--radius);
  margin: 0 auto; max-width: 1180px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 22px; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: 0.3px; }
.brand-tag { font-size: 12px; color: var(--muted); border: 1px solid var(--card-border); padding: 2px 8px; border-radius: 999px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

/* 容器 */
.container { position: relative; z-index: 1; max-width: 1180px; margin: 26px auto; padding: 0 18px 60px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.card { border-radius: var(--radius); padding: 22px; }
.card h2 { margin: 0 0 14px; font-size: 17px; }
.card h3 { margin: 14px 0 6px; font-size: 14px; }
.mt { margin-top: 22px; }

/* 按钮 */
.primary-btn {
  width: 100%; padding: 13px; border: none; border-radius: 14px; cursor: pointer;
  background: var(--accent-grad); color: #fff; font-weight: 700; font-size: 15px;
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), box-shadow 0.25s;
  box-shadow: 0 10px 24px -10px var(--accent);
}
.primary-btn:hover { transform: translateY(-2px) scale(1.01); }
.magnetic { transition: transform 0.25s cubic-bezier(0.16,1,0.3,1); }
.ghost-btn {
  background: transparent; border: 1px solid var(--card-border); color: var(--text);
  padding: 8px 14px; border-radius: 12px; cursor: pointer; font-size: 13px;
  transition: background 0.2s, border-color 0.2s;
}
.ghost-btn:hover { background: rgba(127,127,160,0.12); }
.ghost-btn.small { padding: 6px 10px; font-size: 12px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--card-border);
  background: transparent; cursor: pointer; font-size: 16px; transition: transform 0.2s, background 0.2s;
}
.icon-btn:hover { transform: rotate(15deg); background: rgba(127,127,160,0.12); }

/* 表单 */
.field { margin-bottom: 12px; }
.field.row { display: flex; align-items: center; gap: 10px; }
.link { color: var(--accent); cursor: pointer; text-decoration: underline; }
input, select {
  width: 100%; padding: 11px 13px; border-radius: 12px; font-size: 14px;
  border: 1px solid var(--card-border); background: rgba(127,127,160,0.08); color: var(--text);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.18); }
.select { width: auto; min-width: 140px; }
.select.small { padding: 7px 10px; font-size: 13px; }

/* 登录 */
.login-card { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.login-card h1 { margin: 4px 0 8px; font-size: 24px; }
.login-card .field { text-align: left; margin-top: 16px; }
.error { color: #ef4444; font-size: 13px; margin-top: 10px; }

/* 拖拽区 */
.dropzone {
  border: 2px dashed var(--card-border); border-radius: 16px; padding: 30px 16px;
  text-align: center; cursor: pointer; transition: border-color 0.25s, background 0.25s, transform 0.2s;
  background: rgba(127,127,160,0.05);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(99,102,241,0.08); transform: scale(1.005); }
.dz-icon { font-size: 34px; margin-bottom: 6px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.center { text-align: center; }

/* 上传列表 */
.upload-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.up-item { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 10px; border-radius: 12px; background: rgba(127,127,160,0.08); }
.up-thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.up-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-status { font-size: 12px; color: var(--muted); }
.up-status.ok { color: #10b981; }
.up-status.err { color: #ef4444; }

/* 相册列表 */
.album-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(127,127,160,0.1); font-size: 13px; border: 1px solid transparent; cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent-grad); color: #fff; }
.chip .cnt { opacity: 0.7; font-size: 11px; }
.chip .del { margin-left: 2px; opacity: 0.6; }
.chip .del:hover { opacity: 1; }

/* 复制行 */
.copy-row { display: flex; align-items: center; gap: 8px; }
.token { flex: 1; font-size: 12px; padding: 8px 10px; border-radius: 10px; background: rgba(127,127,160,0.1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 画廊 */
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.gallery-head h2 { margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.g-item { border-radius: 14px; overflow: hidden; background: rgba(127,127,160,0.08); border: 1px solid var(--card-border); transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), box-shadow 0.25s; }
.g-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.g-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; cursor: pointer; }
.g-meta { padding: 8px 10px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.g-actions { display: flex; gap: 6px; }
.g-actions button { flex: 1; padding: 5px; font-size: 11px; border-radius: 8px; border: 1px solid var(--card-border); background: transparent; color: var(--text); cursor: pointer; transition: background 0.2s; }
.g-actions button:hover { background: rgba(127,127,160,0.15); }
.g-actions .danger:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(10,12,20,0.5); backdrop-filter: blur(6px); padding: 20px; }
.modal-card { max-width: 560px; width: 100%; border-radius: var(--radius); padding: 26px; position: relative; max-height: 86vh; overflow: auto; }
.modal-close { position: absolute; top: 14px; right: 16px; background: transparent; border: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.code-block { background: rgba(127,127,160,0.12); padding: 12px; border-radius: 10px; font-size: 12px; overflow: auto; white-space: pre-wrap; word-break: break-all; max-height: 260px; }
.guide-list { padding-left: 18px; margin: 6px 0; line-height: 1.9; }
.guide-list code.token { display: inline-block; max-width: 320px; vertical-align: middle; }

/* Toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 13px; z-index: 80; box-shadow: var(--shadow); animation: pop 0.3s ease; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
