/* ============================================================
 * 个人作品集 · 样式（深色，单页：展示 + 管理）
 * 想换主题色，只改下面 :root 里的变量即可。
 * ============================================================ */

:root {
  --bg: #0b0d12;
  --bg-soft: #12151d;
  --panel: #161a24;
  --panel-2: #1c2130;
  --line: #262c3a;
  --text: #e8ecf5;
  --muted: #98a2b8;
  --accent: #5b8cff;
  --accent-2: #37d6b0;
  --danger: #ff6b6b;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

/* 关键：下面很多元素用 display:flex/grid 布局，会盖掉 hidden 属性的 display:none，
   导致「本应隐藏」的弹窗、进度条一直显示。这条规则必须留着。 */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(91, 140, 255, .16), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(55, 214, 176, .10), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 16px/1.65 "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 5vw, 46px); letter-spacing: -.5px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
code { background: var(--panel-2); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
em { font-style: normal; color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 14px; }

.wrap { width: min(1160px, 92vw); margin: 0 auto; }

/* ------------------------------------------------------------- 顶部导航 */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(11, 13, 18, .78);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(91, 140, 255, .8);
}
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 15px; color: var(--muted); }

/* ------------------------------------------------------------------ 按钮 */

.btn, button.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--text); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #7aa2ff);
  border-color: transparent; color: #07101f; font-weight: 650;
}
.btn.primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.ghost, a.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
button.ghost:hover, a.ghost:hover { color: var(--text); border-color: var(--accent); }
button.ghost.danger:hover { color: var(--danger); border-color: var(--danger); }

/* ------------------------------------------------------------------ 首屏 */

.hero { padding: 74px 0 34px; }
.eyebrow { letter-spacing: 3px; font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.hero .lead { color: var(--muted); font-size: 17px; max-width: 620px; margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ------------------------------------------------------------------ 作品 */

.works { padding: 22px 0 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.count { color: var(--muted); font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 6px 0 22px; }
#search, input[type="text"], input[type="password"], textarea {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 10px 14px; border-radius: 10px; font: inherit; font-size: 14px; width: 100%;
}
#search { max-width: 300px; }
input:focus, textarea:focus, #search:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  padding: 6px 13px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active { background: rgba(91, 140, 255, .16); border-color: var(--accent); color: var(--text); }

.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding-bottom: 20px;
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  display: flex; flex-direction: column;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px); border-color: rgba(91, 140, 255, .6); box-shadow: var(--shadow); outline: none;
}
.thumb { position: relative; aspect-ratio: 16 / 9; background: #05070c; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 26px; color: #fff; opacity: 0; transition: opacity .16s ease;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.55));
}
.card:hover .play { opacity: 1; }
.thumb .duration {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(0, 0, 0, .72); color: #fff; font-size: 12px;
  padding: 2px 8px; border-radius: 6px;
}
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.card-title { margin: 0; font-size: 16px; }
.card-desc {
  margin: 0; color: var(--muted); font-size: 13.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; color: var(--accent-2);
  background: rgba(55, 214, 176, .1); border: 1px solid rgba(55, 214, 176, .25);
  padding: 1px 9px; border-radius: 999px; cursor: pointer;
}

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 8px; }
.empty h3 { color: var(--text); }

.about { padding: 50px 0 70px; border-top: 1px solid var(--line); margin-top: 40px; }
.about p { color: var(--muted); max-width: 720px; }

/* ------------------------------------------------------------------ 页脚 */

.footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.footer-links { display: flex; gap: 16px; }

/* -------------------------------------------------------- 管理区（同页） */

.manage {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 44px 0 10px;
  margin-top: 30px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 76px;
}
.manage-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
}
.panel h3 { margin-top: 0; }

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 34px 20px; text-align: center; cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(91, 140, 255, .07); }
.drop-icon { font-size: 26px; margin-bottom: 6px; }
.drop p { margin: 4px 0; }
.file-info {
  display: flex; align-items: center; gap: 14px; margin-top: 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.file-thumb { width: 132px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: #000; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid textarea { resize: vertical; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s ease; }
.actions { display: flex; align-items: center; gap: 14px; }

.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
}
.admin-thumb { width: 116px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: #05070c; }
.admin-info { flex: 1; min-width: 0; }
.admin-actions { display: flex; gap: 8px; }

/* -------------------------------------------------------------- 播放弹窗 */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 3vh 3vw; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 6, 11, .82); backdrop-filter: blur(4px); }
.modal-box {
  position: relative; width: min(980px, 100%); max-height: 94vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal-box.small { width: min(440px, 100%); }
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; border: none; cursor: pointer; font-size: 15px;
}
.player { background: #000; }
.player video { width: 100%; max-height: 68vh; display: block; }
.modal-info { padding: 16px 20px 22px; }
.modal-info h3 { margin-bottom: 6px; }
.modal-info p { color: var(--muted); margin: 0 0 10px; white-space: pre-wrap; }
.modal-meta { color: var(--muted); font-size: 13px; }

.login-box { padding: 26px 24px 24px; }
.login-box h3 { margin-bottom: 6px; }
.login-box form { margin-top: 16px; }

.row { display: flex; gap: 10px; align-items: center; }
.row input { flex: 1 1 auto; min-width: 0; }
.row .btn { flex: 0 0 auto; }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 24px; }
  .admin-item { flex-wrap: wrap; }
  .file-thumb, .admin-thumb { width: 100%; }
  .nav-links { gap: 12px; font-size: 14px; }
}

/* ------------------------------------------------------------ 技能标签 */

.skills { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.skill {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: 999px; font-size: 13.5px;
  color: var(--text);
  background: rgba(91, 140, 255, .10);
  border: 1px solid rgba(91, 140, 255, .32);
}