/* 天翼云盘管理 - 文件管理器风格样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: #eef1f6; color: #24292f; height: 100vh; overflow: hidden; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9d2e0; border-radius: 4px; }

/* ===== 登录页 ===== */
#loginView { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 55%, #60a5fa 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px 36px; width: 340px; box-shadow: 0 20px 60px rgba(0,0,0,.25); text-align: center; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; color: #1e3a8a; }
.login-card p { font-size: 12px; color: #999; margin-bottom: 24px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid #d7dce5; border-radius: 10px; font-size: 15px; outline: none; margin-bottom: 16px; }
.login-card input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.btn-primary { width: 100%; padding: 12px; background: #2563eb; color: #fff; border: none; border-radius: 10px; font-size: 15px; }
.btn-primary:hover { background: #1d4ed8; }
.err-tip { color: #e02020; font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ===== 布局 ===== */
#mainView { display: none; height: 100vh; }
#mainView.show { display: flex; }
.sidebar { width: 220px; background: #fff; border-right: 1px solid #e3e8f0; display: flex; flex-direction: column; padding: 18px 14px; gap: 10px; flex-shrink: 0; }
.logo { font-size: 17px; font-weight: 700; color: #1e3a8a; padding: 2px 6px 10px; }
.side-title { font-size: 12px; color: #98a2b3; padding: 0 6px; }
.acc-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.acc-item { border: 1px solid #e9edf3; border-radius: 10px; padding: 9px 11px; cursor: pointer; background: #fbfcfe; }
.acc-item:hover { border-color: #b6cdf5; }
.acc-item.on { border-color: #2563eb; background: #eff5ff; }
.acc-name { font-size: 13px; font-weight: 600; color: #333; display: flex; justify-content: space-between; align-items: center; }
.acc-del { border: none; background: none; color: #c0c6d1; font-size: 13px; padding: 0 2px; }
.acc-del:hover { color: #e02020; }
.acc-cap { margin-top: 7px; }
.cap-track { height: 5px; background: #e9edf3; border-radius: 3px; overflow: hidden; }
.cap-fill { height: 100%; background: linear-gradient(90deg,#60a5fa,#2563eb); border-radius: 3px; }
.acc-cap-text { font-size: 10px; color: #98a2b3; margin-top: 4px; }
.side-spacer { flex: 1; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid #e3e8f0; padding: 10px 18px; display: flex; align-items: center; gap: 8px; }
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 14px; flex: 1; min-width: 120px; }
.crumb { color: #2563eb; background: none; border: none; font-size: 14px; padding: 3px 5px; border-radius: 6px; }
.crumb:hover { background: #eff5ff; }
.crumb.cur { color: #24292f; font-weight: 600; cursor: default; background: none; }
.crumb-sep { color: #b6bdcb; font-size: 12px; }
.ctl { padding: 6px 10px; border: 1px solid #d7dce5; border-radius: 8px; font-size: 13px; background: #fff; color: #333; }
.ctl:hover { border-color: #9db9ee; }
.vbtn { min-width: 34px; text-align: center; }
.vbtn.on { background: #2563eb; border-color: #2563eb; color: #fff; }

/* ===== 文件区 ===== */
.file-area { flex: 1; overflow-y: auto; padding: 14px 18px; }

/* 列表视图 */
.ftable { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e3e8f0; border-radius: 12px; overflow: hidden; }
.ftable thead th { text-align: left; font-size: 12px; font-weight: 600; color: #7a8699; background: #f7f9fc; padding: 9px 14px; border-bottom: 1px solid #e3e8f0; user-select: none; }
.ftable tbody td { padding: 8px 14px; border-bottom: 1px solid #f0f3f8; font-size: 13px; vertical-align: middle; }
.ftable tbody tr:last-child td { border-bottom: none; }
.ftable tbody tr:hover { background: #f5f9ff; }
.fname-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fthumb { width: 36px; height: 36px; border-radius: 7px; object-fit: cover; flex-shrink: 0; background: #f0f3f8; border: 1px solid #edf0f5; }
.ficon { width: 36px; height: 36px; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 19px; background: #f0f3f8; }
.fname { font-size: 13.5px; color: #24292f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; max-width: 480px; }
.fname:hover { color: #2563eb; text-decoration: underline; }
.fsize { color: #7a8699; font-size: 12px; white-space: nowrap; }
.fdate { color: #98a2b3; font-size: 12px; white-space: nowrap; }
.fops { display: flex; gap: 6px; justify-content: flex-end; }
.mini-btn { padding: 4px 10px; font-size: 12px; border: 1px solid #d7dce5; background: #fff; border-radius: 7px; color: #555; white-space: nowrap; }
.mini-btn:hover { border-color: #2563eb; color: #2563eb; }
.mini-btn.pref:hover { border-color: #52c41a; color: #52c41a; }

/* 网格视图 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gcard { background: #fff; border: 1px solid #e3e8f0; border-radius: 12px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: box-shadow .15s, transform .15s; }
.gcard:hover { box-shadow: 0 6px 18px rgba(30,58,138,.12); transform: translateY(-2px); }
.gthumb { width: 100%; height: 96px; border-radius: 9px; object-fit: cover; background: #f0f3f8; }
.gicon { width: 100%; height: 96px; border-radius: 9px; background: #f5f8fc; display: flex; align-items: center; justify-content: center; font-size: 44px; }
.gname { font-size: 12.5px; color: #333; text-align: center; width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; }
.gsub { font-size: 11px; color: #98a2b3; }
.gops { display: flex; gap: 5px; }
.gops .mini-btn { padding: 3px 8px; font-size: 11px; }

.empty-tip { text-align: center; color: #aab2c0; padding: 80px 0; font-size: 14px; }

/* ===== 分页栏 ===== */
.pagebar { background: #fff; border-top: 1px solid #e3e8f0; padding: 8px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat { font-size: 12px; color: #7a8699; }
.page-ctrl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #555; }
.page-ctrl .ctl { padding: 5px 10px; }
.page-ctrl button:disabled { opacity: .45; cursor: not-allowed; }
.page-text { font-size: 13px; color: #24292f; min-width: 52px; text-align: center; }

/* ===== 弹窗 ===== */
.mask { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100; align-items: center; justify-content: center; }
.mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: min(560px, 92vw); max-height: 88vh; overflow: auto; padding: 22px; position: relative; }
.modal.wide { width: min(940px, 94vw); }
.modal h3 { font-size: 16px; margin-bottom: 14px; color: #1e3a8a; }
.modal .close { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 20px; color: #999; z-index: 5; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab { padding: 7px 16px; border-radius: 8px 8px 0 0; border: none; background: #eef2f8; font-size: 13px; color: #555; }
.tab.on { background: #2563eb; color: #fff; }
.field { margin-bottom: 12px; }
.field input { width: 100%; padding: 11px 12px; border: 1px solid #d7dce5; border-radius: 9px; font-size: 14px; outline: none; }
.field input:focus { border-color: #3b82f6; }
.hint { font-size: 12px; color: #888; line-height: 1.7; margin-bottom: 12px; background: #f6f8fb; padding: 10px 12px; border-radius: 8px; }
.qr-box { text-align: center; padding: 10px 0; }
.qr-box img { width: 230px; height: 230px; }
.qr-status { margin-top: 10px; font-size: 13px; color: #666; min-height: 20px; }

/* 预览 */
.preview-name { font-size: 14px; color: #333; margin-bottom: 12px; word-break: break-all; padding-right: 30px; }
#playerBox { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 10px; overflow: hidden; }
#imgBox { text-align: center; }
#imgBox img { max-width: 100%; max-height: 70vh; border-radius: 10px; background: #000; }
#audioBox { padding: 30px 10px; }
#audioBox audio { width: 100%; }
.v-fallback { text-align: center; padding: 50px 20px; }
.vf-icon { font-size: 44px; margin-bottom: 14px; }
.v-fallback p { font-size: 14px; color: #444; margin-bottom: 6px; }
.vf-sub { font-size: 12px !important; color: #98a2b3 !important; }
.vf-btns { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 通用按钮 */
.btn { padding: 8px 14px; border: 1px solid #d7dce5; background: #fff; border-radius: 8px; font-size: 13px; color: #333; }
.btn:hover { border-color: #3b82f6; color: #2563eb; }
.btn.blue { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.blue:hover { background: #1d4ed8; color: #fff; }
.btn.block { width: 100%; }
.btn.danger { color: #e02020; }
.btn.danger:hover { border-color: #e02020; color: #e02020; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%); background: rgba(15,23,42,.85); color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 13px; z-index: 999; display: none; max-width: 80vw; }

/* 批量操作栏 */
.batch-bar { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); background: #fff; border: 1px solid #c9d8f5; box-shadow: 0 8px 28px rgba(30,58,138,.18); border-radius: 14px; padding: 10px 16px; display: flex; align-items: center; gap: 10px; z-index: 200; }
.batch-count { font-size: 13px; font-weight: 600; color: #1e3a8a; }
.sel-box { width: 15px; height: 15px; accent-color: #2563eb; cursor: pointer; }
.gsel { position: absolute; top: 8px; left: 8px; z-index: 3; width: 17px; height: 17px; background: rgba(255,255,255,.85); border-radius: 4px; }

/* 顶栏操作按钮 */
.ctl.act { background: #fff; border: 1px solid #d7dce5; color: #333; }
.ctl.act:hover { border-color: #3b82f6; color: #2563eb; }

/* 小弹窗 / 弹窗按钮区 */
.modal.small { width: 380px; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* 目录选择弹窗（移动/复制） */
.fp-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; font-size: 13px; }
.fp-crumb { background: none; border: none; color: #2563eb; cursor: pointer; padding: 3px 6px; border-radius: 6px; font-size: 13px; }
.fp-crumb:hover { background: #eff4ff; }
.fp-crumb.cur { color: #1e3a8a; font-weight: 600; cursor: default; }
.fp-list { border: 1px solid #e3e8f0; border-radius: 10px; max-height: 320px; min-height: 120px; overflow-y: auto; padding: 4px; }
.fp-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.fp-row:hover { background: #eff4ff; }
.fp-ic { flex-shrink: 0; }
.fp-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-open { color: #94a3b8; font-size: 12px; flex-shrink: 0; }
.fp-loading { padding: 30px; text-align: center; color: #94a3b8; font-size: 13px; }

/* 行内删除按钮 */
.mini-btn.del { color: #e02020; }
.mini-btn.del:hover { border-color: #e02020; }
