/* TPDisk 前端样式（无外部依赖） */
:root {
  --bg: #0e1120;
  --bg2: #141830;
  --panel: #181c31;
  --panel2: #1f2440;
  --line: #272d4a;
  --text: #e9ecf7;
  --muted: #98a1bf;
  --brand: #4f7cff;
  --brand2: #7a5cff;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(1200px 700px at 10% -10%, #1b2350 0%, transparent 55%),
              radial-gradient(900px 600px at 110% 10%, #2a1d4d 0%, transparent 50%),
              var(--bg);
  color: var(--text);
  font: 14px/1.6 "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea { font: inherit; color: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { background: #262c4d; border-color: #3a4370; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); border: none; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .4); color: #ff9d9d; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input {
  width: 100%;
  background: #11142a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 124, 255, .18); }

.card {
  background: linear-gradient(180deg, var(--panel), #151932);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.muted { color: var(--muted); }
.center { display: flex; align-items: center; justify-content: center; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }

/* ---------------- 登录页 ---------------- */
.auth-wrap {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
}
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none !important; } }

.auth-side {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(160deg, rgba(79,124,255,.18), rgba(122,92,255,.06) 45%, transparent);
  border-right: 1px solid var(--line);
}
.auth-side h1 { font-size: 40px; margin: 0; letter-spacing: -1px; }
.auth-side p { color: var(--muted); max-width: 460px; }
.auth-feats { display: grid; gap: 12px; margin-top: 10px; }
.auth-feat { display: flex; gap: 12px; align-items: flex-start; }
.auth-feat .ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(79,124,255,.16); display: grid; place-items: center; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-box { width: 100%; max-width: 400px; padding: 30px; }
.auth-box h2 { margin: 0 0 6px; }
.tabs { display: flex; gap: 6px; background: #11142a; padding: 5px; border-radius: 12px; margin: 18px 0 20px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--panel2); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------------- 网盘主界面 ---------------- */
.shell { display: grid; grid-template-columns: 236px 1fr; height: 100vh; overflow: hidden; }
@media (max-width: 820px) { .shell { grid-template-columns: 1fr; } .sidebar { display: none; } }

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(15, 18, 34, .75);
  backdrop-filter: blur(10px);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: grid; place-items: center; font-size: 17px;
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 10px; color: #c6cce4; text-decoration: none;
}
.nav a:hover { background: rgba(79,124,255,.1); text-decoration: none; }
.nav a.active { background: rgba(79,124,255,.16); color: #fff; }
.nav a .n { margin-left: auto; font-size: 11px; color: var(--muted); }

.quota { padding: 12px; border-radius: 12px; background: #131730; border: 1px solid var(--line); font-size: 12px; }
.bar { height: 6px; border-radius: 99px; background: #232a48; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); border-radius: 99px; }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: rgba(15, 18, 34, .6);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}
.search { position: relative; flex: 1; min-width: 180px; max-width: 460px; }
.search input { padding-left: 34px; }
.search .mag { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.content { padding: 18px 20px 40px; overflow: auto; flex: 1; }

.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: .5; }
.crumbs .cur { color: var(--text); font-weight: 600; }

.dropzone {
  border: 1.5px dashed #333c66;
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 16px;
  transition: .15s;
}
.dropzone.hover { border-color: var(--brand); background: rgba(79,124,255,.08); color: #cdd6ff; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 10px; border-bottom: 1px solid rgba(39,45,74,.55); vertical-align: middle; }
.table tr:hover td { background: rgba(79,124,255,.06); }
.table .name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .name .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #202644; font-size: 15px; flex: none; }
.file-icon.folder { background: rgba(245, 158, 11, .16); }
.file-icon.image { background: rgba(34, 197, 94, .16); }
.file-icon.video { background: rgba(236, 72, 153, .16); }
.file-icon.audio { background: rgba(14, 165, 233, .16); }
.file-icon.archive { background: rgba(168, 85, 247, .16); }
.file-icon.doc { background: rgba(79, 124, 255, .16); }
.ops { display: flex; gap: 4px; justify-content: flex-end; opacity: .35; transition: .15s; }
tr:hover .ops { opacity: 1; }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 5px 7px; border-radius: 7px; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.star { color: var(--warn); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .big { font-size: 44px; margin-bottom: 10px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { padding: 14px; border-radius: 12px; background: #151932; border: 1px solid var(--line); cursor: pointer; }
.tile:hover { border-color: #3a4370; background: #1a1f3a; }
.tile .ic { font-size: 30px; }
.tile .nm { margin-top: 8px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 上传队列 */
.uploads {
  position: fixed; right: 18px; bottom: 18px; width: 340px; max-height: 46vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 60;
}
.uploads .hd { padding: 11px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.upload-item { padding: 10px 14px; border-bottom: 1px solid rgba(39,45,74,.6); font-size: 12px; }
.upload-item .nm { display: flex; justify-content: space-between; gap: 8px; }
.upload-item .st { color: var(--muted); }
.upload-item.done .st { color: var(--ok); }
.upload-item.error .st { color: var(--danger); }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(5,7,16,.72); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 90; padding: 20px;
}
.modal { width: 100%; max-width: 460px; padding: 22px; }
.modal.wide { max-width: 860px; }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 提示 */
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { padding: 10px 16px; border-radius: 10px; background: #232a48; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; animation: pop .18s ease; }
.toast.ok { border-color: rgba(34,197,94,.5); }
.toast.err { border-color: rgba(239,68,68,.55); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* 预览 */
#preview { position: fixed; inset: 0; background: rgba(4,6,14,.92); z-index: 120; display: flex; flex-direction: column; }
#preview .pv-bar { padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
#preview .pv-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 18px; }
#preview img, #preview video { max-width: 100%; max-height: 100%; border-radius: 10px; }
#preview iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 10px; }
#preview pre { width: 100%; height: 100%; overflow: auto; background: #0b0e1a; padding: 16px; border-radius: 10px; margin: 0; }

/* 后台 */
.admin-shell { display: grid; grid-template-columns: 210px 1fr; height: 100vh; }
.admin-main { overflow: auto; padding: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.stat { padding: 16px; border-radius: 14px; background: linear-gradient(180deg, #191e36, #151932); border: 1px solid var(--line); }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 6px; }
.panel { padding: 18px; border-radius: 14px; background: linear-gradient(180deg, #191e36, #151932); border: 1px solid var(--line); }
.section-title { font-size: 15px; font-weight: 600; margin: 22px 0 12px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; background: #232a48; color: #c6cce4; }
.tag.ok { background: rgba(34,197,94,.16); color: #7ee2a8; }
.tag.bad { background: rgba(239,68,68,.16); color: #ff9d9d; }
.tag.warn { background: rgba(245,158,11,.16); color: #f7c86b; }

/* 分享页 */
.share-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 26px; }
.share-box { width: 100%; max-width: 560px; padding: 26px; }
.share-file { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 12px; background: #131730; border: 1px solid var(--line); }
.share-file .big-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: rgba(79,124,255,.16); }
