/* 网兜 Web 版 — 排版对齐桌面应用 */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #8a94a6;
  --line: #e5e9f0;
  --primary: #3d7fff;
  --primary-soft: #eaf1ff;
  --danger: #e5484d;
}
* { box-sizing: border-box; }
/* hidden 属性优先于作者 display 规则（修复登录/主视图同时显示） */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 14px;
}
button { font-family: inherit; }
.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.42rem 0.85rem;
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { color: #fff; background: #2f6bef; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 0.28rem 0.65rem; font-size: 0.84rem; }
.btn-block { width: 100%; }
.hint { color: var(--muted); font-size: 0.85rem; }
.hint.tight { margin: 0.2rem 0 0; }
.msg { min-height: 1.2em; font-size: 0.86rem; margin: 0.4rem 0; }
.msg.is-error { color: var(--danger); }
a { color: var(--primary); }

/* 顶栏（对齐应用：白底 + 按钮） */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 1.1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.brand img { border-radius: 6px; }
.user-chip {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}
.topbar-actions { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.topbar-btn.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* 登录 */
.login-view { display: flex; align-items: flex-start; justify-content: center; padding: 7vh 1rem 2rem; }
.login-card {
  width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem 1.5rem;
  box-shadow: 0 8px 24px rgba(15, 34, 58, 0.06);
}
.login-card h1 { font-size: 1.2rem; margin: 0 0 0.4rem; }
.login-card label { display: block; margin: 0.8rem 0 0.2rem; font-size: 0.88rem; }
.login-card input {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.92rem;
}
.login-card input:focus { outline: none; border-color: var(--primary); }
.login-card .btn-block { margin-top: 0.9rem; }
.login-card .code-row { display: flex; gap: 0.4rem; align-items: center; }
.login-card .code-row input { flex: 1; width: auto; }
.login-card .code-row .btn { white-space: nowrap; }
.captcha-row { display: flex; gap: 0.5rem; align-items: flex-end; }
.captcha-row label { flex: 1; }
.captcha-img {
  flex: 0 0 132px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 2px;
}
.captcha-img svg { display: block; }
.turnstile-row { margin: 0.6rem 0 0; min-height: 70px; }
.linklike { border: none; background: transparent; color: var(--primary); cursor: pointer; padding: 0.4rem 0 0; }

#modal-root .modal textarea {
  width: 100%;
  min-height: 84px;
  margin-top: 0.2rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
}
#modal-root .modal { min-width: 380px; max-width: 480px; }
#modal-root .modal select {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--panel);
}

.supported-block {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
}
.supported-title { font-weight: 700; font-size: 0.86rem; margin-bottom: 0.45rem; }
.supported-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.supported-chip {
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  background: #fbfcfe;
}
.supported-chip.is-web {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}

/* 主布局 */
.app-view { display: flex; min-height: calc(100vh - 54px); }
.side {
  width: 250px;
  flex: 0 0 250px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.side-head {
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.side-add {
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 6px;
}
.side-add:hover { background: var(--primary-soft); }
.side-head-hint { display: block; font-size: 0.74rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}
.account-list li {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 0.45rem;
  background: #fbfcfe;
}
.account-list li:hover { border-color: var(--primary); }
.account-list li.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.account-list li.is-unsupported { color: var(--muted); cursor: default; background: #f7f8fa; }
.account-list li.is-unsupported:hover { border-color: transparent; }
.acc-line1 { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.acc-icon { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 4px; }
.account-banner {
  border: 1px solid #ffd6d0;
  background: #fff2ef;
  color: var(--danger);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  word-break: break-all;
}
.supported-chip { display: inline-flex; align-items: center; gap: 4px; }
.supported-chip img { width: 15px; height: 15px; border-radius: 3px; }
.provider-tag {
  font-size: 0.72rem;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 4px;
  padding: 0 0.3rem;
  flex: 0 0 auto;
  font-weight: 600;
}
.acc-name {
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-line2, .acc-line3, .acc-line4 {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  margin-top: 4px;
}
.acc-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.main { flex: 1; min-width: 0; padding: 0.8rem 1.1rem; }

.side-resizer {
  flex: 0 0 5px;
  cursor: col-resize;
  background: transparent;
  margin: 0 -2px;
  z-index: 10;
}
.side-resizer:hover { background: var(--primary-soft); }
.page { width: 100%; }

/* 工具栏 */
.toolbar { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.crumbs { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .crumb-link { color: var(--primary); cursor: pointer; margin-right: 0.3rem; }
.crumbs .crumb-current { color: var(--ink); }
.table-wrap { margin-top: 0.6rem; overflow-x: auto; }
.file-table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 10px; overflow: hidden; }
.file-table th, .file-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  white-space: nowrap;
}
.file-table th { color: var(--muted); font-weight: 500; background: #fafbfd; }
.file-table td.col-name { max-width: 460px; overflow: hidden; text-overflow: ellipsis; }
.file-table td.col-name .name-click {
  color: var(--ink);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}
.file-table td.col-name .name-click:hover { color: var(--primary); }
.col-size, .col-time { color: var(--muted); }
.col-check { width: 34px; }
.col-ops .btn { margin-right: 0.3rem; }
.empty-cell { text-align: center; color: var(--muted); padding: 2rem 0; }

/* 音乐视频页 */
.media-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.media-head h2 { font-size: 1.05rem; margin: 0; }
.media-actions { display: flex; gap: 0.5rem; }
.media-tabs { margin: 0.6rem 0 0.3rem; display: flex; gap: 0.4rem; }
.media-tabs .is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.media-tabs .btn { border-radius: 8px; }

/* 播放器（在侧栏内，固定于支持网盘上方，对齐应用端） */
.player {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  width: 100%;
  margin-bottom: 0.5rem;
}
.player-disc {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #35507a, #101d33 70%);
  border: 3px solid #0e1727;
  position: relative;
}
.player-disc::after {
  content: "";
  position: absolute;
  inset: 40%;
  border-radius: 50%;
  background: #e8edf5;
}
.player-disc.is-playing { animation: pl-spin 3.2s linear infinite; }
@keyframes pl-spin { to { transform: rotate(360deg); } }
.player-main { flex: 1; min-width: 0; }
.player-progress { display: flex; align-items: center; gap: 0.3rem; }
.player-volume { display: flex; align-items: center; gap: 0.25rem; }
.pl-volume { width: 56px; accent-color: var(--primary); height: 4px; }
.pl-seek { flex: 1; min-width: 40px; accent-color: var(--primary); height: 4px; }

.scan-targets { margin: 0.5rem 0; }
.scan-target-list { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin-top: 0.25rem; }
.scan-target {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.86rem;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
}
.scan-target input { accent-color: var(--primary); }
.pager-cell { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.player-title {
  font-size: 0.84rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}
.player-controls { display: flex; align-items: center; gap: 0.35rem; }
.pl-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.15rem 0.3rem;
  border-radius: 6px;
}
.pl-btn:hover { background: var(--primary-soft); }
.pl-time { font-size: 0.74rem; color: var(--muted); white-space: nowrap; }
.pl-playlist {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 34, 58, 0.14);
  padding: 0.4rem;
}
.pl-track {
  padding: 0.4rem 0.55rem;
  border-radius: 7px;
  font-size: 0.84rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-track:hover { background: var(--primary-soft); }
.pl-track.is-active { color: var(--primary); font-weight: 600; }

/* 简易弹窗 */
#modal-root .modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 34, 58, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
#modal-root .modal {
  background: var(--panel);
  border-radius: 12px;
  padding: 1.2rem 1.3rem;
  min-width: 320px;
  max-width: 90vw;
}
#modal-root .modal h3 { margin: 0 0 0.7rem; font-size: 1rem; }
#modal-root .modal label { display: block; margin: 0.6rem 0 0.2rem; font-size: 0.88rem; }
#modal-root .modal input {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
}
#modal-root .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.scan-area { margin-top: 0.6rem; }
.scan-qr { margin-top: 0.5rem; display: flex; justify-content: center; }
.scan-qr img { border: 1px solid var(--line); border-radius: 8px; }
