/* hhbcloud —— 左侧多模块布局，浅色，卡片式 */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1c2233;
  --ink-2: #5b6478;
  --muted: #8a93a6;
  --line: #e6eaf2;
  --brand: #2b59ff;
  --brand-soft: #e9eeff;
  --danger: #e5484d;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(28, 34, 51, .06);
  --side-w: 232px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 整体布局 ---------- */
.layout { display: flex; min-height: 100vh; }

/* ---------- 左侧栏 ---------- */
.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w);
  position: sticky; top: 0; align-self: flex-start; height: 100vh;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 16px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2b59ff, #6f8dff); color: #fff; font-size: 16px;
  box-shadow: 0 4px 12px rgba(43, 89, 255, .35);
}
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .3px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--ink-2); font-size: 14.5px; font-weight: 500;
}
.nav-item:hover { background: var(--bg); }
.nav-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.side-foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--line); }
.side-link { border: none; background: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 2px 0; text-decoration: underline; }
.beian a { color: var(--muted); font-size: 12px; text-decoration: none; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line);
}
.menu-btn {
  display: none; border: 1px solid var(--line); background: #fff; border-radius: 9px;
  width: 38px; height: 38px; font-size: 17px; cursor: pointer; color: var(--ink);
}
.topbar-title { font-size: 17px; font-weight: 700; }
.topbar-spacer { flex: 1; }
.top-up {
  border: none; background: var(--brand); color: #fff; padding: 9px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(43, 89, 255, .3);
}
.top-up:active { transform: translateY(1px); }

.view { max-width: 1180px; width: 100%; margin: 0 auto; padding: 16px 18px 60px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card h2 { margin: 0 0 8px; font-size: 16px; }
.card-h h2 { margin: 0; }
.card-h a { color: var(--brand); font-size: 13px; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 22px 10px; }

.hero { background: linear-gradient(140deg, #ffffff, #eef3ff); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 6px; font-size: 23px; letter-spacing: .3px; }
.hero p { margin: 0; color: var(--ink-2); font-size: 14px; }
.stats { display: flex; gap: 26px; margin-top: 18px; flex-wrap: wrap; }
.stat b { display: block; font-size: 21px; color: var(--brand); }
.stat span { font-size: 12.5px; color: var(--muted); }


/* ---------- 网格（相册/视频） ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-decoration: none; color: inherit; overflow: hidden; }
.tile:active { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(28, 34, 51, .08); }
.tile-ic { width: 100%; height: 104px; object-fit: contain; background: #fff; border-radius: 8px; }
.tile-ic.big { height: 132px; }

/* 拖拽：文件拖到文件夹上 */
.drop-on { border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(43, 89, 255, .18) !important; }
.crumb.drop-on { background: var(--brand-soft); border-radius: 6px; box-shadow: none !important; }
.fcheck { position: static; z-index: 3; width: 16px; height: 16px; flex: none; }
.tile-name { font-size: 13px; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-size { font-size: 11.5px; color: var(--muted); }
.tile-open { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.thumb { width: 100%; height: 104px; object-fit: cover; border-radius: 8px; background: #f2f5fa; }
.tile-del { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(28, 34, 51, .55); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }
.tile-del.small { position: static; background: none; color: var(--danger); width: auto; height: auto; }

/* ---------- 文件列表（一行一行） ---------- */
.flist { list-style: none; margin: 0; padding: 0; }
.flist-card { padding: 4px 14px; }
.frow { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-top: 1px solid var(--line); }
.frow:first-child { border-top: none; }
.frow:hover { background: #fafbff; }
.fname { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; word-break: break-all; }
.fname:hover { color: var(--brand); }
.fsize { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.fdate { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
/* 行内图标（用户提供的素材） */
.fic { width: 38px; height: 38px; object-fit: contain; flex: none; border-radius: 8px; }
.fthumb { width: 38px; height: 38px; object-fit: cover; flex: none; border-radius: 8px; background: #f2f5fa; }
.folder-row { cursor: pointer; }
/* 行拖拽 */
.frow.dragging { opacity: .45; }
.frow.drop-on { background: var(--brand-soft); box-shadow: none !important; }

/* ---------- 文件管理器 ---------- */
.fm-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 14px; color: var(--ink-2); }
.crumb { cursor: pointer; padding: 3px 8px; border-radius: 8px; color: var(--brand); font-weight: 600; }
.crumb:hover { background: var(--brand-soft); }
.crumb-sep { color: var(--muted); margin: 0 1px; }
.fm-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.selbar { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--brand-soft); border-radius: 10px; }
.sel-count { font-size: 13px; color: var(--brand); font-weight: 600; }
.sel-move { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; outline: none; max-width: 180px; }
.ft-del { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(28, 34, 51, .5); color: #fff; font-size: 11px; line-height: 1; cursor: pointer; }
.fcheck { width: 18px; height: 18px; flex: 0 0 18px; cursor: pointer; accent-color: var(--brand); }

/* ---------- 笔记 ---------- */
.nlist { list-style: none; margin: 0; padding: 0; }
.nlist li + li { border-top: 1px solid var(--line); }
.nlist a { display: block; padding: 10px 2px; text-decoration: none; color: inherit; }
.nlist a:active { background: var(--brand-soft); }
.n-title { display: block; font-weight: 600; font-size: 14.5px; }
.n-meta { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.search { display: flex; gap: 8px; margin-bottom: 4px; }
.search input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; outline: none; }
.search input:focus { border-color: var(--brand); }

/* ---------- 文章 ---------- */
.article { padding: 18px; }
.a-meta { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.chip { display: inline-block; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 1px 9px; font-size: 12px; margin-left: 4px; }
.acts { display: flex; gap: 6px; }
.back { display: inline-block; margin-top: 14px; color: var(--brand); font-size: 13.5px; text-decoration: none; }
.md { line-height: 1.75; }
.md h1 { font-size: 19px; margin: 16px 0 8px; } .md h2 { font-size: 17px; margin: 16px 0 8px; } .md h3 { font-size: 15.5px; margin: 14px 0 6px; }
.md p { margin: 8px 0; } .md ul, .md ol { padding-left: 22px; } .md li { margin: 3px 0; }
.md code { background: #f2f5fa; border-radius: 5px; padding: 1px 5px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.md pre { background: #1e2433; color: #dfe6f5; border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: 12px 0; }
.md pre code { background: none; color: inherit; padding: 0; font-size: 12.5px; }
.md blockquote { margin: 10px 0; padding: 6px 12px; border-left: 3px solid var(--brand); background: var(--brand-soft); color: var(--ink-2); border-radius: 0 8px 8px 0; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.md a { color: var(--brand); }

/* ---------- 编辑 ---------- */
.edit { display: flex; flex-direction: column; gap: 8px; }
.e-title, .e-course, .e-tags { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; outline: none; background: #fff; }
.e-title { font-weight: 600; }
.e-body { min-height: 46vh; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13.5px; line-height: 1.7; outline: none; resize: vertical; }
.edit-bar { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- AI / 关于 ---------- */
.rows { margin: 10px 0; }
.row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.row span { color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 14px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f3c9cb; }
.btn.small { padding: 5px 10px; font-size: 13px; }

/* ---------- 预览层 / 提示 ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(18, 22, 33, .92); display: flex; align-items: center; justify-content: center; padding: 20px; }
.lb-inner { text-align: center; }
.lb-inner img { max-width: 100%; max-height: 80vh; border-radius: 10px; }
.lb-dl { display: inline-block; margin-top: 12px; color: #fff; font-size: 13px; text-decoration: none; border: 1px solid rgba(255,255,255,.4); padding: 7px 16px; border-radius: 999px; }
.lb-close { position: absolute; top: 16px; right: 16px; background: rgba(255, 255, 255, .14); border: none; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px); background: rgba(28, 34, 51, .93); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none; transition: .22s; z-index: 60; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(229, 72, 77, .95); }

/* ---------- 自定义对话框（替代浏览器 prompt / confirm） ---------- */
.modal {
  position: fixed; inset: 0; z-index: 120; background: rgba(20, 24, 35, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  width: 340px; max-width: 92vw; background: var(--card); border-radius: 14px;
  padding: 20px; box-shadow: 0 18px 50px rgba(28, 34, 51, .25);
}
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.modal-msg { font-size: 14px; color: var(--ink-2); margin-bottom: 0; }
.modal-input {
  width: 100%; padding: 10px 12px; margin-top: 12px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px; outline: none;
}
.modal-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 89, 255, .10); }
.modal-acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- 登录 / 注册页（独立页面，不是弹窗） ---------- */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef3ff 0%, #f7f9fc 45%, #eaf0ff 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px 16px;
}
.lp-wrap { width: 100%; max-width: 380px; }
.lp-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 26px 22px; box-shadow: 0 18px 50px rgba(28, 34, 51, .10); text-align: center;
}
.lp-logo { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(135deg, #2b59ff, #6f8dff); color: #fff; font-size: 27px; box-shadow: 0 8px 20px rgba(43,89,255,.35); }
.lp-title { margin: 2px 0 2px; font-size: 22px; letter-spacing: .4px; }
.lp-tabs { display: flex; gap: 4px; justify-content: center; margin: 0 0 18px; background: var(--bg); padding: 4px; border-radius: 11px; }
.ltab { flex: 1; font-size: 14px; color: var(--muted); padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.ltab.on { color: var(--brand); font-weight: 700; background: #fff; box-shadow: var(--shadow); }
.lp-field { text-align: left; margin-bottom: 12px; }
.lp-field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }
.lp-field input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; outline: none; background: #fff; color: var(--ink); }
.lp-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,89,255,.10); }
.lp-fmsg { font-size: 12px; margin-top: 4px; min-height: 15px; color: var(--muted); }
.lp-fmsg.bad { color: var(--danger); }
.lp-fmsg.ok { color: #16a34a; }
.lp-btn { width: 100%; margin-top: 6px; padding: 12px; font-size: 15px; }
.lp-btn:disabled { opacity: .6; cursor: default; }
.lp-err { color: var(--danger); font-size: 12.5px; margin-top: 10px; min-height: 16px; }

/* ---------- 主页大图 ---------- */
.hbanner {
  position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px;
  min-height: 210px; display: flex; align-items: flex-end;
  background: linear-gradient(140deg, #dfe8ff, #f2f5ff);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hbanner.noimg { min-height: 168px; }
.hb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hb-mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,18,40,.05) 0%, rgba(12,18,40,.55) 100%); }
.hb-text { position: relative; padding: 18px 20px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.hb-text h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: .4px; }
.hb-text p { margin: 0; font-size: 13.5px; opacity: .95; }
.hb-acts { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.btn.light { background: rgba(255,255,255,.92); color: var(--ink); border: 1px solid rgba(255,255,255,.6); }
.btn.light:hover { background: #fff; }
.hbanner.noimg .hb-mask { background: none; }
.hbanner.noimg .hb-text { color: var(--ink); text-shadow: none; }

/* ---------- 主页数据面板（格子数随屏幕宽度自动增减） ---------- */
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; }
.dtile {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.dtile b { display: block; font-size: 19px; color: var(--brand); word-break: break-all; }
.dtile span { font-size: 12.5px; color: var(--muted); }

/* 主页下半部分：最近上传 / 最近笔记，宽屏并排、窄屏自动堆叠 */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.cols .card { margin-top: 0; }

.side-me { font-size: 12.5px; color: var(--ink-2); margin: 4px 0 2px; word-break: break-all; }

.overlay { display: none; }

/* ---------- 移动端：左侧抽屉 ---------- */
@media (max-width: 899px) {
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 40; height: 100vh;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.18);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: block; }
  .overlay.show { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.35); }
  .view { padding: 14px 14px 70px; }
  .stats { gap: 18px; }
}
@media (min-width: 900px) {
  .overlay { display: none !important; }
}

/* ---------- 游戏：坦克对战测试场 ---------- */
.game-wrap { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 16px; align-items: start; }
.game-stage { position: relative; background: #0e1119; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.game-canvas { display: block; width: 100%; height: auto; background: #0e1119; touch-action: none; cursor: crosshair; }
.game-hud {
  position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between;
  align-items: center; pointer-events: none; font-size: 13px; color: #e8edf7;
}
.hud-bar { display: flex; align-items: center; gap: 8px; background: rgba(10,14,24,.55); padding: 6px 10px; border-radius: 10px; }
.hud-label { color: var(--muted); }
.hud-track { width: 120px; height: 8px; background: #000; border-radius: 6px; overflow: hidden; }
.hud-fill { height: 100%; width: 100%; background: linear-gradient(90deg,#36d97a,#9ee84a); transition: width .12s linear; }
.hud-shield { display: none; color: #4d8bff; border: 1px solid #4d8bff; border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.hud-right { display: flex; gap: 12px; align-items: center; background: rgba(10,14,24,.55); padding: 6px 10px; border-radius: 10px; }
.hud-power { color: #ff4d5e; font-weight: 600; }
.game-status { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #cfd6e6; font-size: 14px; background: rgba(10,14,24,.6); padding: 6px 14px; border-radius: 10px; pointer-events: none; }
.game-help { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); color: #9aa6bd; font-size: 12.5px; background: rgba(10,14,24,.55); padding: 5px 12px; border-radius: 10px; pointer-events: none; white-space: nowrap; }
.game-side { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.game-side h3 { margin: 0 0 8px; font-size: 17px; color: var(--brand); }
.game-side p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.game-items { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.game-items li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot.kill { background: #ff4d5e; }
.dot.health { background: #36d97a; }
.dot.shield { background: #4d8bff; }
.dot.rapid { background: #ffd24d; }
.game-note { color: var(--muted); font-size: 12.5px; margin-bottom: 0; }

@media (max-width: 899px) {
  .game-wrap { grid-template-columns: 1fr; }
  .game-help { white-space: normal; text-align: center; }
}
