/* 云匣 · 网页版样式（v49 起与 App 统一：森林绿 + 白卡片 + 圆角） */
:root {
  --green: #2f7d4f;
  --green-d: #256b41;
  --green-l: #eaf3ee;
  --bg: #f2f5f3;
  --card: #ffffff;
  --text: #1f2a24;
  --text2: #6b7a72;
  --text3: #9aa6a0;
  --line: #e3eae6;
  --danger: #c0392b;
  --shadow: 0 2px 10px rgba(31, 42, 36, .07);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
}
.hidden { display: none !important; }
button, input { font-family: inherit; }
button { cursor: pointer; }

/* ---------- 登录 ---------- */
#loginScreen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #eaf3ee 0%, #f2f5f3 55%, #e6efe9 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 20px;
  padding: 34px 26px 26px; box-shadow: 0 18px 50px rgba(31, 42, 36, .12);
  border: 1px solid var(--line);
}
.login-brand { display: flex; align-items: center; gap: 10px; justify-content: center; }
.login-brand .logo {
  width: 44px; height: 44px; border-radius: 12px; background: var(--green);
  color: #fff; font-size: 22px; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(47,125,79,.35);
}
.login-brand h1 { margin: 0; font-size: 24px; letter-spacing: 2px; }
.login-sub { text-align: center; color: var(--text3); font-size: 12px; margin: 10px 0 24px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.field input, .modal-card input[type=text], .modal-card input[type=password] {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; background: #fbfcfb; color: var(--text); outline: none; transition: .15s;
}
.field input:focus, .modal-card input:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 3px rgba(47,125,79,.1); }
.login-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; color: var(--text2); font-size: 12px; }
.login-row input { accent-color: var(--green); width: 15px; height: 15px; }
.err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin: 10px 0 0; }

/* ---------- 按钮 ---------- */
.btn { border: none; border-radius: 12px; padding: 11px 16px; font-size: 14px; transition: .15s; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-d); }
.btn.ghost { background: #eef2f0; color: var(--text2); }
.btn.ghost:hover { background: #e4eae7; }
.btn.danger { background: #fdeceb; color: var(--danger); }
.btn.danger:hover { background: #fbdad7; }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.pill {
  border: none; background: #eef2f0; color: var(--text); border-radius: 11px;
  padding: 9px 13px; font-size: 13px; white-space: nowrap; transition: .15s;
}
.pill:hover { background: #e3ebe6; }
.pill.on { background: var(--green-l); color: var(--green-d); }
.icon-btn {
  border: none; background: #eef2f0; color: var(--text2); border-radius: 10px;
  width: 34px; height: 34px; font-size: 15px; display: grid; place-items: center;
}
.icon-btn:hover { background: #e3ebe6; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.topbar-main { display: flex; align-items: center; gap: 12px; padding: 13px 0 9px; }
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.brand .name { font-size: 20px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.brand .user { font-size: 14px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .ver { font-size: 11px; color: var(--text3); }
.spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* 账号菜单 */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border-radius: 14px;
  box-shadow: 0 12px 34px rgba(31,42,36,.16); border: 1px solid var(--line);
  min-width: 190px; padding: 6px; z-index: 40;
}
.menu button, .menu a {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: var(--text);
  text-decoration: none; cursor: pointer;
}
.menu button:hover, .menu a:hover { background: #f2f6f4; }

/* 路径栏 */
.pathbar { display: flex; align-items: center; gap: 10px; padding-bottom: 9px; }
.crumbs { flex: 1; display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.crumb {
  border: none; background: none; color: var(--text2); font-size: 13.5px;
  padding: 5px 6px; border-radius: 8px; white-space: nowrap; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis;
}
.crumb:hover { background: #f2f6f4; color: var(--text); }
.crumb.here { color: var(--text); font-weight: 600; }
.sep { color: #c4cec8; font-size: 12px; }
.tools { display: flex; align-items: center; gap: 8px; }
.search {
  width: 190px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcfb; font-size: 13px; outline: none;
}
.search:focus { border-color: var(--green); background: #fff; }

/* 类型 chips */
.chips { display: flex; gap: 8px; padding-bottom: 11px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--text2);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; white-space: nowrap;
}
.chip.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }

/* ---------- 内容区 ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 16px 18px 130px; }
.empty { text-align: center; color: var(--text3); padding: 64px 10px; font-size: 13.5px; }
.empty .big { font-size: 40px; margin-bottom: 10px; opacity: .55; }

/* 共享卡片 */
.shares { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.share-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 16px; box-shadow: var(--shadow); transition: .16s; cursor: pointer;
}
.share-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(31,42,36,.1); border-color: #cfe0d6; }
.share-card .ico { font-size: 26px; }
.share-card .nm { margin-top: 8px; font-size: 15px; font-weight: 600; }
.share-card .sub { margin-top: 4px; font-size: 11.5px; color: var(--text3); word-break: break-all; }
.share-card .badge {
  display: inline-block; margin-left: 6px; font-size: 10px; color: var(--green-d);
  background: var(--green-l); border-radius: 6px; padding: 1px 6px; vertical-align: 2px; font-weight: 500;
}

/* 列表 */
.thead, .row {
  display: grid; grid-template-columns: 34px 34px minmax(0,1fr) 96px 150px 92px;
  align-items: center; gap: 8px;
}
.thead { padding: 6px 12px 8px; color: var(--text3); font-size: 12px; }
.thead .cell-check { display: flex; align-items: center; }
.rows { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.row { padding: 11px 12px; border-top: 1px solid #f0f4f2; cursor: default; }
.row:first-child { border-top: none; }
.row:hover { background: #f8fbf9; }
.row.sel { background: var(--green-l); }
.row input[type=checkbox], .thead input[type=checkbox] { accent-color: var(--green); width: 16px; height: 16px; }
.fi { font-size: 20px; text-align: center; }
.nm { min-width: 0; display: flex; align-items: center; gap: 6px; }
.nm .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.nm .txt:hover { color: var(--green-d); text-decoration: underline; }
.meta { color: var(--text3); font-size: 12.5px; }
.ops { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: .12s; }
.row:hover .ops { opacity: 1; }
.op {
  border: none; background: none; padding: 6px 7px; border-radius: 8px; font-size: 13px; color: var(--text2);
}
.op:hover { background: #eaf1ec; }

/* 网格视图 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.gcell {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 10px;
  text-align: center; box-shadow: var(--shadow); position: relative; transition: .16s;
}
.gcell:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(31,42,36,.1); }
.gcell.sel { background: var(--green-l); border-color: #bcd8c9; }
.gcell .ico { font-size: 32px; height: 40px; display: grid; place-items: center; }
.gcell .nm { font-size: 12.5px; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.gcell .sub { font-size: 11px; color: var(--text3); margin-top: 3px; }
.gcell .check { position: absolute; left: 8px; top: 8px; }
.gcell .thumb { width: 100%; height: 92px; object-fit: cover; border-radius: 10px; background: #f0f4f2; }
.gcell .thumb-wrap { height: 92px; border-radius: 10px; overflow: hidden; background: #f0f4f2; display: grid; place-items: center; }

/* 最近视图的行内副标题 */
.row .where { color: var(--text3); font-size: 11px; margin-top: 2px; }

/* ---------- 多选浮动条 ---------- */
.selbar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: #1f2a24; color: #fff; border-radius: 16px; padding: 10px 14px;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.26); z-index: 35;
  max-width: calc(100vw - 24px);
}
.selbar .cnt { font-size: 13px; margin-right: 4px; white-space: nowrap; }
.selbar button {
  border: none; border-radius: 10px; padding: 9px 13px; font-size: 13px;
  background: rgba(255,255,255,.14); color: #fff;
}
.selbar button:hover { background: rgba(255,255,255,.24); }
.selbar button.danger { background: rgba(192,57,43,.85); }
.selbar button.plain { background: transparent; color: #cfd8d3; }

/* ---------- 上传进度 ---------- */
.upbar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 34px rgba(31,42,36,.16); padding: 12px 16px; z-index: 36;
  display: flex; align-items: center; gap: 12px; min-width: 300px;
}
.upbar .track { flex: 1; height: 8px; background: #e9efec; border-radius: 999px; overflow: hidden; }
.upbar .fill { height: 100%; width: 0; background: var(--green); transition: width .15s; }
.upbar .txt { font-size: 12.5px; color: var(--text2); white-space: nowrap; }

/* ---------- 拖拽遮罩 ---------- */
.dropmask {
  position: fixed; inset: 0; z-index: 60; background: rgba(47,125,79,.14);
  border: 3px dashed var(--green); display: grid; place-items: center;
  color: var(--green-d); font-size: 18px; font-weight: 600;
  background-color: rgba(242,245,243,.86); backdrop-filter: blur(2px);
}

/* ---------- 预览 ---------- */
.viewer { position: fixed; inset: 0; z-index: 70; background: #0f1512; display: flex; flex-direction: column; }
.vbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: #fff; background: rgba(255,255,255,.06); }
.vbar .vnav { border: none; background: rgba(255,255,255,.12); color: #fff; width: 38px; height: 38px; border-radius: 10px; font-size: 22px; }
.vbar .vnav:hover { background: rgba(255,255,255,.22); }
.vcenter { flex: 1; min-width: 0; text-align: center; }
.vname { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcount { font-size: 11px; color: #9fb3a8; margin-top: 2px; }
.vbody { flex: 1; overflow: auto; display: grid; place-items: center; padding: 14px; }
.vbody img, .vbody video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.vbody iframe { width: 100%; height: 100%; border: none; background: #fff; border-radius: 8px; }
.vbody pre { color: #dbe5e0; white-space: pre-wrap; font-size: 13px; width: 100%; padding: 10px; line-height: 1.6; }
.vtip { color: #cfdad4; text-align: center; max-width: 340px; }
.vtip p { color: #9fb3a8; font-size: 13px; margin: 0 0 16px; }
.vtip a {
  display: block; margin: 8px auto; padding: 11px 16px; background: var(--green); color: #fff;
  border-radius: 10px; text-decoration: none; font-size: 14px;
}
.vload {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.55); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px;
}

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(18,26,22,.42); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card {
  background: #fff; width: 100%; max-width: 380px; border-radius: 18px; padding: 22px 20px 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.24); max-height: 86vh; display: flex; flex-direction: column;
}
.modal-card h3 { margin: 0 0 14px; font-size: 17px; }
.modal-card .body { flex: 1; overflow: auto; min-height: 40px; }
.modal-card .hint { font-size: 12.5px; color: var(--text2); margin: 0 0 12px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* 目录选择器 */
.pick-path { font-size: 12.5px; color: var(--text2); background: #f4f7f5; border-radius: 10px; padding: 9px 11px; margin-bottom: 10px; word-break: break-all; }
.pick-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-height: 46vh; overflow-y: auto; }
.pick-item { display: flex; align-items: center; gap: 9px; padding: 12px 12px; border-top: 1px solid #f0f4f2; font-size: 14px; cursor: pointer; }
.pick-item:first-child { border-top: none; }
.pick-item:hover { background: #f6faf8; }
.pick-item .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item .arrow { color: #b9c6bf; }

/* 响应式 */
@media (max-width: 820px) {
  .topbar-inner { padding: 0 12px; }
  main { padding: 12px 12px 120px; }
  .search { width: 130px; }
  .thead, .row { grid-template-columns: 30px 28px minmax(0,1fr) 76px; }
  .thead .cell-size, .thead .cell-time, .row .size, .row .time { display: none; }
  .ops { opacity: 1; }
  .brand .name { font-size: 17px; }
  .brand .user { font-size: 12.5px; }
  .topbar-actions .pill { padding: 8px 10px; font-size: 12.5px; }
  .selbar { bottom: 12px; padding: 8px 10px; }
  .selbar button { padding: 8px 10px; font-size: 12.5px; }
}
@media (max-width: 560px) {
  .brand .user { display: none; }
  .search { width: 96px; }
  .shares { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
