/* ===== 原神角色制作排行榜 ===== */
:root {
  --bg: #0f131c;
  --bg-2: #171d2b;
  --card: #1e2536;
  --line: #2c3549;
  --text: #e8ecf4;
  --muted: #9aa6bd;
  --gold: #c9a86a;
  --blue: #5b8def;
  --green: #4caf86;
  --red: #d96666;
  --radius: 14px;
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(91,141,239,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(201,168,106,.12), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 头部 ===== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15,19,28,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-size: 18px; font-weight: 700; color: var(--text); }
.brand-gem { color: var(--gold); }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--text); }
.nav a:hover { color: var(--gold); text-decoration: none; }
.nav-user { color: var(--muted); display: flex; align-items: center; gap: 8px; }

.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.tag-wait { background: rgba(217,102,102,.18); color: var(--red); }
.tag-ok   { background: rgba(76,175,134,.18); color: var(--green); }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--text); padding: 8px 16px; border-radius: 10px; cursor: pointer;
  font-size: 14px; transition: .15s;
}
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--gold), #b8924f); border-color: transparent; color: #1a1408; font-weight: 600; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-danger { color: var(--red); border-color: rgba(217,102,102,.4); }

/* ===== 页头横幅 ===== */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: 30px; letter-spacing: 2px; }
.hero p { color: var(--muted); margin-top: 8px; }

/* ===== 分类切换 ===== */
.tabs { display: flex; justify-content: center; gap: 12px; margin: 24px 0; }
.tab {
  padding: 10px 26px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); background: var(--bg-2); cursor: pointer; font-size: 15px;
}
.tab.active { background: linear-gradient(135deg, var(--gold), #b8924f); color: #1a1408; border-color: transparent; font-weight: 600; }

/* ===== 排行榜网格 ===== */
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; padding-bottom: 40px; }
.rank-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .15s, border-color .15s;
}
.rank-top { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.rank-title { flex: 1; min-width: 0; }
.rank-title h3 { font-size: 16px; line-height: 1.5; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rank-title .sub {
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
  white-space: normal; word-break: break-word;
}
.rank-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 10px; border-top: 1px solid rgba(44,53,73,.75);
}
.rank-bottom .rank-meta { margin: 0; }
.rank-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.rank-no {
  width: 36px; height: 36px; flex: none; border-radius: 11px; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 16px;
  background: var(--bg-2); color: var(--muted);
}
.rank-no.top1 { background: linear-gradient(135deg,#f3d27a,#c9a86a); color:#1a1408; }
.rank-no.top2 { background: linear-gradient(135deg,#d7dde8,#9aa6bd); color:#1a1408; }
.rank-no.top3 { background: linear-gradient(135deg,#e0a878,#b5763f); color:#1a1408; }

.avatar {
  width: 56px; height: 56px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
  background: linear-gradient(135deg, #2b3550, #1a2133); color: var(--gold);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.rank-meta { color: var(--gold); font-size: 14px; font-weight: 600; }

.rank-action { flex: none; }

/* ===== 表单卡片 ===== */
.form-wrap { max-width: 420px; margin: 40px auto; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.form-card h2 { margin-bottom: 18px; text-align: center; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: 15px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.form-card .btn { width: 100%; margin-top: 6px; }
.form-alt { text-align: center; margin-top: 16px; color: var(--muted); font-size: 14px; }

/* ===== 提示条 ===== */
.alert { padding: 12px 16px; border-radius: 10px; margin: 16px 0; font-size: 14px; }
.alert-error { background: rgba(217,102,102,.15); color: var(--red); border: 1px solid rgba(217,102,102,.35); }
.alert-ok    { background: rgba(76,175,134,.15); color: var(--green); border: 1px solid rgba(76,175,134,.35); }
.alert-info  { background: rgba(91,141,239,.15); color: var(--blue); border: 1px solid rgba(91,141,239,.35); }

/* ===== 后台表格 ===== */
.admin-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 16px; }
.admin-head h2 { font-size: 22px; }
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 30px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; background: var(--bg-2); }
tr:last-child td { border-bottom: none; }
td .muted { color: var(--muted); font-size: 13px; }

.admin-tabs { display: flex; gap: 10px; margin: 20px 0; }
.admin-tabs a { padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); }
.admin-tabs a.active { border-color: var(--gold); color: var(--gold); }

/* ===== 页脚 ===== */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 22px 0; text-align: center; }

@media (max-width: 600px) {
  .rank-grid { grid-template-columns: 1fr; }
  .nav { gap: 10px; font-size: 13px; }
  .hero h1 { font-size: 23px; }
}

/* ===== 已制作状态 ===== */
.badge-made {
  display: inline-block; vertical-align: middle;
  margin-left: 8px; padding: 1px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; line-height: 19px;
  color: #0f2b1f; background: linear-gradient(135deg, #7ee2b0, #4fbf8b);
  border: 1px solid rgba(126,226,176,.5);
}
.btn-made {
  background: rgba(78,191,139,.16); color: #7ee2b0;
  border: 1px solid rgba(126,226,176,.42);
}
.btn-made:hover { background: rgba(78,191,139,.26); color: #9bf0c6; }
.card-made {
  border-color: rgba(126,226,176,.34) !important;
  background: linear-gradient(180deg, rgba(78,191,139,.07), rgba(20,27,41,.9));
}
.avatar { background: radial-gradient(circle at 50% 40%, #33405c, #1a2133); }

/* ===== 后台筛选条 ===== */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 14px;
}
.chip {
  display: inline-block; padding: 5px 14px; border-radius: 20px;
  font-size: 13px; color: var(--muted); text-decoration: none;
  background: var(--card); border: 1px solid var(--line);
}
.chip:hover { color: #e8ecf4; border-color: rgba(201,168,106,.5); }
.chip.active { color: #1a1408; background: linear-gradient(135deg,#c9a86a,#b8924f); border-color: transparent; font-weight: 600; }
.filter-progress { margin-left: auto; font-size: 13px; color: var(--muted); }
.filter-progress b { color: #7ee2b0; font-size: 15px; }

/* ===== 后台角色行 ===== */
.admin-char { display: flex; align-items: center; gap: 9px; }
.admin-av {
  width: 34px; height: 34px; flex: none; border-radius: 9px; overflow: hidden;
  background: linear-gradient(135deg,#2b3550,#1a2133);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--gold);
}
.admin-av img { width: 100%; height: 100%; object-fit: cover; }
.row-made { background: rgba(78,191,139,.05); }
.nowrap { white-space: nowrap; }
.nowrap-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }

/* ===== 制作备注 / 完成时间 / 代投 ===== */
.made-stamp { font-size: 11.5px; color: #7ee2b0; margin-top: 2px; letter-spacing: .2px; white-space: nowrap; }
.made-note {
  font-size: 12px; color: #b7c2d6; line-height: 1.5;
  background: rgba(91,141,239,.10); border-left: 2px solid rgba(91,141,239,.55);
  padding: 4px 9px; border-radius: 0 6px 6px 0;
  white-space: normal; word-break: break-word;
}
.my-votes { margin-left: 8px; font-size: 12px; color: #7ee2b0; font-weight: 600; }

.note-form { display: flex; gap: 6px; align-items: center; }
.note-input {
  width: 100%; min-width: 150px; max-width: 230px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 7px; padding: 5px 9px; font-size: 12.5px; font-family: inherit;
}
.note-input:focus { outline: none; border-color: rgba(201,168,106,.6); }
.btn-xs { padding: 4px 10px !important; font-size: 12px !important; border-radius: 7px !important; }
.made-time { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* 后台表格列宽修正 */
table th { white-space: nowrap; }
table td { white-space: normal; }
.char-cat {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 5px;
  font-size: 11px; font-weight: 400; color: var(--muted);
  background: rgba(44,53,73,.6); border: 1px solid var(--line);
  white-space: nowrap;
}
.note-form .btn-xs { flex: none; white-space: nowrap; }
.table-card table { font-size: 13px; }
.table-card td, .table-card th { padding-left: 8px; padding-right: 8px; }

/* ===== 搜索 + 筛选 ===== */
.search-bar { align-items: flex-start; }
.search-form { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.search-input {
  flex: 1 1 240px; max-width: 340px; min-width: 180px;
  padding: 7px 13px; border-radius: 20px; font-size: 13px;
  color: #e8ecf4; background: var(--card); border: 1px solid var(--line);
  outline: none; font-family: inherit;
}
.search-input::placeholder { color: #6b7690; }
.search-input:focus { border-color: rgba(201,168,106,.65); box-shadow: 0 0 0 2px rgba(201,168,106,.12); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-count { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.filter-count b { color: #c9a86a; font-size: 15px; }
.empty-hint { grid-column: 1 / -1; text-align: center; padding: 40px 0; }
.table-card th { white-space: nowrap; }
