:root {
  --pink: #e84e8a;
  --pink-d: #d23b78;
  --pink-l: #ff8fbc;
  --bg1: #fff1f7;
  --bg2: #f4f0ff;
  --ink: #2b2330;
  --muted: #8a8593;
  --line: #efe6ee;
  --ok: #1e9e63;
  --err: #d23b3b;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 100%);
}
.hidden { display: none !important; }

/* ===================== 通用控件 ===================== */
.card {
  background: #fff; border-radius: 18px; padding: 26px 24px;
  box-shadow: 0 18px 50px rgba(180,90,140,.14);
  animation: rise .35s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card h2 { font-size: 17px; margin: 0 0 4px; }
.card .tip { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 13px; }
input[type=text], input[type=password] {
  width: 100%; padding: 11px 13px; font-size: 14px;
  border: 1.5px solid var(--line); border-radius: 10px; outline: none;
  transition: border-color .15s, box-shadow .15s; background: #fff;
}
/* 隐藏 Edge/IE 自带的密码显示图标，避免与自定义眼睛按钮重复 */
input[type=password]::-ms-reveal,
input[type=password]::-ms-clear {
  display: none;
}
input[type=text]:focus, input[type=password]:focus {
  border-color: var(--pink); box-shadow: 0 0 0 3px rgba(232,78,138,.12);
}
.pwd { position: relative; }
.pwd input { padding-right: 42px; }
.pwd .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: none; background: none; cursor: pointer;
  color: var(--muted); font-size: 16px; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center; border-radius: 8px;
}
.pwd .eye:hover { color: var(--pink-d); background: #fff0f6; }
.btn {
  width: 100%; margin-top: 20px; padding: 12px 18px; font-size: 15px; font-weight: 600;
  cursor: pointer; border: none; border-radius: 11px; color: #fff;
  background: linear-gradient(135deg, var(--pink-l), var(--pink));
  box-shadow: 0 8px 18px rgba(232,78,138,.28); transition: filter .15s, transform .05s;
}
.btn:hover:not(:disabled) { filter: brightness(1.04); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.link { color: var(--pink-d); cursor: pointer; font-weight: 600; }
.link:hover { text-decoration: underline; }
.msg { margin-top: 14px; white-space: pre-wrap; font-size: 13px; line-height: 1.5; min-height: 1px; }
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }

/* ===================== 登录 / 注册 ===================== */
.auth-wrap {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-wrap .wrap { width: 100%; max-width: 460px; }
.brand { text-align: center; margin-bottom: 18px; }
.brand .logo {
  width: 64px; height: 64px; border-radius: 16px; object-fit: contain;
  box-shadow: 0 8px 22px rgba(232,78,138,.30);
}
.brand h1 { font-size: 22px; margin: 12px 0 2px; letter-spacing: .5px; }
.brand .sub { color: var(--muted); font-size: 13px; margin: 0; }

/* ===================== 应用外壳（侧边栏布局） ===================== */
.app { min-height: 100vh; display: flex; align-items: stretch; }

.sidebar {
  flex: none; width: 260px; min-height: 100vh;
  display: flex; flex-direction: column; gap: 8px;
  padding: 26px 18px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 22px rgba(180,90,140,.06);
  position: sticky; top: 0;
}
.brand-side { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-side img { width: 42px; height: 42px; border-radius: 11px; object-fit: contain;
  box-shadow: 0 6px 16px rgba(232,78,138,.28); }
.brand-side-txt { display: flex; flex-direction: column; line-height: 1.25; }
.brand-side-txt .bs-name { font-weight: 800; font-size: 16px; letter-spacing: .3px; }
.brand-side-txt .bs-sub { color: var(--muted); font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  border: none; background: none; cursor: pointer;
  padding: 12px 14px; border-radius: 11px; font-size: 14.5px; font-weight: 600;
  color: var(--muted); transition: background .15s, color .15s;
}
.nav-item .ni-ico { font-size: 17px; }
.nav-item:hover { color: var(--pink-d); background: #fff0f6; }
.nav-item.active {
  color: #fff; background: linear-gradient(135deg, var(--pink-l), var(--pink));
  box-shadow: 0 8px 18px rgba(232,78,138,.26);
}

.side-foot { border-top: 1px solid var(--line); padding-top: 16px; }
.side-foot .who { font-size: 13px; color: var(--muted); margin-bottom: 10px; padding: 0 8px;
  word-break: break-all; }
.side-foot .who b { color: var(--ink); }
.side-foot .logout {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13.5px; padding: 9px 14px; border-radius: 10px;
  transition: background .15s, color .15s;
}
.side-foot .logout:hover { color: var(--pink-d); background: #fff0f6; }

.content {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 22px;
}
.content .page { width: 100%; max-width: 600px; margin: 0 auto; }

/* ===================== 拖拽上传 ===================== */
/* 类型选择器（分段控件） */
.seg {
  display: flex; gap: 4px; margin: 16px 0 4px;
  padding: 4px; border-radius: 12px; background: #f7eef4;
}
.seg-item {
  flex: 1; border: none; background: none; cursor: pointer;
  padding: 9px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 700;
  color: var(--muted); letter-spacing: .3px; transition: background .15s, color .15s, box-shadow .15s;
}
.seg-item:hover { color: var(--pink-d); }
.seg-item.active {
  color: var(--pink-d); background: #fff;
  box-shadow: 0 4px 12px rgba(180,90,140,.14);
}

/* 文件槽容器：默认单列，sovits 四文件用两列网格 */
.slots { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 10px; }
.slots.grid { grid-template-columns: 1fr 1fr; }
.slot label { margin-top: 0; }
.slot .drop { min-height: 70px; display: flex; align-items: center; justify-content: center; }

.drop {
  border: 1.5px dashed var(--pink-l); border-radius: 12px; padding: 18px 14px;
  text-align: center; cursor: pointer; transition: background .15s, border-color .15s;
  background: #fff7fb; color: var(--muted); font-size: 13px;
}
.drop:hover, .drop.over { border-color: var(--pink); background: #ffeef6; }
.drop.optional { border-color: #e7dbe6; background: #fbf7fb; }
.drop.optional:hover, .drop.optional.over { border-color: var(--pink-l); background: #fff3f9; }
.drop .picked { color: var(--ink); font-weight: 600; word-break: break-all; }
.drop .picked small { color: var(--muted); font-weight: 400; }

/* ===================== 进度条 ===================== */
.progress { margin-top: 16px; display: none; }
.progress.show { display: block; }
.bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--pink-l), var(--pink)); transition: width .2s;
}
.bar.indet > i { width: 40%; animation: slide 1.1s infinite ease-in-out; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.progress .ptext { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: center; }

/* ===================== 资源下载 ===================== */
.res-list { display: flex; flex-direction: column; gap: 12px; }
.res-loading { color: var(--muted); font-size: 13px; text-align: center; padding: 12px; }
.res-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff7fb; transition: border-color .15s, box-shadow .15s;
}
.res-item:hover { border-color: var(--pink-l); box-shadow: 0 6px 18px rgba(232,78,138,.10); }
.res-icon {
  flex: none; width: 44px; height: 44px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: linear-gradient(135deg, var(--pink-l), var(--pink)); color: #fff;
}
.res-info { flex: 1; min-width: 0; }
.res-info .res-name { font-weight: 700; font-size: 14px; }
.res-badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; vertical-align: middle;
}
.res-badge.pro { color: #fff; background: linear-gradient(135deg, #f0a93a, #e8732e); }
.res-badge.basic { color: var(--pink-d); background: #fff0f6; border: 1px solid var(--pink-l); }
.res-info .res-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.res-info .res-meta { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.res-dl {
  flex: none; padding: 9px 18px; font-size: 13px; font-weight: 600;
  border: none; border-radius: 10px; color: #fff; cursor: pointer; text-decoration: none;
  background: linear-gradient(135deg, var(--pink-l), var(--pink));
  box-shadow: 0 6px 14px rgba(232,78,138,.26); transition: filter .15s;
}
.res-dl:hover { filter: brightness(1.04); }
.res-dl.disabled {
  background: var(--line); color: var(--muted); box-shadow: none; cursor: not-allowed;
}

/* ===================== 响应式 ===================== */
@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; min-height: auto; position: sticky; top: 0; z-index: 10;
    flex-direction: row; align-items: center; gap: 12px;
    padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--line);
  }
  .brand-side { padding: 0; }
  .brand-side-txt .bs-sub { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: flex-end; gap: 4px; }
  .nav-item { width: auto; padding: 9px 13px; }
  .side-foot { border-top: none; padding-top: 0; display: flex; align-items: center; gap: 4px; }
  .side-foot .who { display: none; }
  .side-foot .logout { width: auto; }
  .content { padding: 26px 14px 40px; }
  .slots.grid { grid-template-columns: 1fr; }
  #page-admin { padding: 22px 16px; }
}

/* ===================== 用户管理（管理员） ===================== */
/* 用户管理是宽表格，单独放宽卡片宽度，避免 600px 下挤成一团 */
#page-admin { max-width: 920px !important; padding: 30px 30px; }
#page-admin h2 { font-size: 19px; }

.admin-toolbar { display: flex; align-items: center; gap: 10px; margin: 10px 0 20px; flex-wrap: wrap; }
.admin-toolbar select {
  padding: 9px 12px; font-size: 13.5px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; outline: none; color: var(--ink);
}
.admin-toolbar select:focus { border-color: var(--pink); }
.admin-spacer { flex: 1; }

/* 管理用按钮（区别于全宽主 .btn） */
.abtn {
  padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: none; border-radius: 9px; color: #fff;
  background: linear-gradient(135deg, var(--pink-l), var(--pink));
  box-shadow: 0 5px 12px rgba(232,78,138,.24); transition: filter .15s, transform .05s;
}
.abtn:hover { filter: brightness(1.05); }
.abtn:active { transform: translateY(1px); }
.abtn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; box-shadow: none; }
.abtn.ghost {
  background: #fff; color: var(--pink-d); border: 1.5px solid var(--line); box-shadow: none;
}
.abtn.ghost:hover { background: #fff0f6; }
.abtn.danger { background: linear-gradient(135deg, #ff8a8a, var(--err)); box-shadow: none; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td {
  padding: 14px 14px; text-align: left; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; letter-spacing: .3px; }
.admin-table tbody tr:hover td { background: #fff8fb; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 备注列 */
.note-cell { white-space: normal; max-width: 220px; }
.note-cell .note-text {
  display: inline-block; max-width: 180px; vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.note-cell .note-text.empty { color: var(--muted); }
.abtn.note-edit { padding: 3px 8px; margin-left: 6px; vertical-align: middle; }

.abadge { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.abadge.pending  { background: #fff3d6; color: #b8860b; }
.abadge.approved { background: #d9f5e6; color: var(--ok); }
.abadge.banned   { background: #fbdde2; color: var(--err); }
.atag-admin { color: var(--pink-d); font-weight: 700; }
.admin-empty { text-align: center; color: var(--muted); padding: 30px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(43,35,48,.42);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal-box {
  background: #fff; border-radius: 16px; padding: 24px; width: 360px; max-width: 100%;
  box-shadow: 0 20px 60px rgba(180,90,140,.28); animation: rise .25s ease;
}
.modal-box h3 { margin: 0 0 6px; font-size: 16px; color: var(--pink-d); }
.modal-box textarea {
  width: 100%; padding: 11px 13px; font-size: 14px; box-sizing: border-box;
  border: 1.5px solid var(--line); border-radius: 10px; outline: none; resize: vertical;
  font-family: inherit; transition: border-color .15s, box-shadow .15s; background: #fff;
}
.modal-box textarea:focus {
  border-color: var(--pink); box-shadow: 0 0 0 3px rgba(232,78,138,.12);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-actions .abtn { min-width: 72px; text-align: center; }

/* ===================== 备案信息（ICP / 公安） ===================== */
/* 工信部要求备案号在首页可见。刻意做得克制但不隐藏：
   对比度仍满足 WCAG AA（--muted #8a8593 对 --bg1 #fff1f7 约 4.6:1）。 */
.icp {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.9;
}
.icp a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.icp a:hover,
.icp a:focus-visible { color: var(--pink-d); text-decoration: underline; }
.icp a + a { margin-left: 12px; }

/* 侧边栏里的那份：跟「退出登录」拉开一点距离，左对齐以贴合侧栏排版 */
.icp-side {
  text-align: left;
  margin-top: 12px;
  padding: 0 14px;
  font-size: 11.5px;
}

@media (max-width: 900px) {
  /* 窄屏侧栏变成顶部横条，这里塞不下备案号；登录页那份仍然可见，
     且工信部只要求首页可见，所以直接隐藏这一份 */
  .icp-side { display: none; }
}
