/* 校区网络U盘 Web 版 — 资源管理器风格（桌面 + 移动端响应式） */
:root {
  --brand: #007acc;
  --brand-dark: #005a9e;
  --brand-light: #3aa0e8;
  --brand-bg: #e8f4fd;
  --text: #222;
  --text-2: #666;
  --border: #ddd;
  --bg: #f2f4f8;
  --error: #d32f2f;
  --ok: #2e7d32;
  --row-hover: #e8f4fd;
  --row-selected: #cde7f9;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }

/* ===== 按钮 ===== */
.btn {
  font: inherit; font-size: 13px; padding: 8px 14px; min-height: 34px;
  background: #fff; color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer; transition: background .15s, border-color .15s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.btn:hover { background: var(--brand-bg); border-color: var(--brand); }
.btn:active { background: #d0e9f9; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; border: none; font-weight: bold; }
.btn-primary:hover { background: var(--brand-light); }
.btn-primary:active { background: var(--brand-dark); }
.btn-danger { background: var(--error); color: #fff; border: none; }
.btn-danger:hover { background: #e57373; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.15); border-color: #fff; }
.btn-block { display: flex; width: 100%; justify-content: center; margin-top: 16px; min-height: 40px; font-size: 14px; }
.link-btn { font: inherit; background: none; border: none; color: var(--brand); cursor: pointer; font-size: 12px; }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: 0 8px 30px rgba(0,60,120,.12); }
.brand-banner {
  display: flex; align-items: center; gap: 14px; padding: 20px 24px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand) 60%, var(--brand-light));
  color: #fff;
}
.brand-logo {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: bold; font-family: "Segoe UI", sans-serif; flex: none;
  overflow: hidden; position: relative;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.brand-logo.small { width: 32px; height: 32px; font-size: 15px; }
.brand-title { font-size: 20px; font-weight: bold; }
.brand-sub { font-size: 10px; opacity: .7; margin-top: 2px; letter-spacing: .5px; }
.status-pill {
  margin-left: auto; background: rgba(0,0,0,.15); border-radius: 10px; padding: 4px 10px;
  display: flex; align-items: center; gap: 5px; font-size: 11px; flex: none;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #999; }
.dot.on { background: #6f6; box-shadow: 0 0 6px #6f6; }
.dot.off { background: #f66; }
.card-body { padding: 20px 24px 24px; }

.announce-box { background: #f7f9fc; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 16px; }
.announce-title { font-size: 12px; font-weight: bold; color: var(--brand); margin-bottom: 4px; }
.announce-text { font-size: 12px; color: var(--text-2); line-height: 19px; max-height: 72px; overflow-y: auto; white-space: pre-wrap; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.form-group input {
  width: 100%; font: inherit; font-size: 14px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 4px; outline: none; transition: border-color .15s;
}
.form-group input:focus { border-color: var(--brand); border-width: 1.5px; }
.pwd-row, .code-row { display: flex; gap: 8px; }
.pwd-row input, .code-row input { flex: 1; min-width: 0; }
.eye-btn { padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; }
.eye-btn:hover { border-color: var(--brand); }
.code-row .code-btn { flex: none; min-width: 104px; justify-content: center; padding: 0 10px; }
.sms-step-hint { font-size: 12px; color: var(--text-2); line-height: 19px; margin-bottom: 14px; }
.sms-hint { font-size: 12px; color: var(--ok); line-height: 18px; margin-top: 4px; }
.sms-back { display: block; margin: 12px auto 0; }
.remember { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin: 8px 0 0; }

.error-box {
  background: rgba(211,47,47,.1); color: var(--error); font-size: 12px;
  border-radius: 4px; padding: 8px 10px; margin-top: 10px; line-height: 18px;
}
.login-foot { text-align: center; font-size: 11px; color: var(--error); margin-top: 14px; }

/* ===== 应用框架 ===== */
.app-wrap { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.app-header {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand) 60%, var(--brand-light));
  flex: none;
}
.app-brand { display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 15px; flex: none; }
.breadcrumb { flex: 1; display: flex; align-items: center; gap: 2px; font-size: 13px; overflow-x: auto; scrollbar-width: none; min-width: 40px; }
.breadcrumb::-webkit-scrollbar { display: none; }
.crumb { padding: 4px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap; background: rgba(255,255,255,.1); flex: none; }
.crumb:hover { background: rgba(255,255,255,.25); }
.crumb.current { background: rgba(255,255,255,.3); cursor: default; }
.crumb-sep { opacity: .6; flex: none; }
.header-right { display: flex; align-items: center; gap: 8px; flex: none; }
.welcome { font-size: 12px; opacity: .9; margin-right: 4px; }

/* ===== 工具栏（精简：图标按钮 + 搜索） ===== */
.toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--border); flex-wrap: wrap; flex: none; }
.toolbar .btn.tb { padding: 6px 11px; min-height: 32px; font-size: 15px; line-height: 1; }
.toolbar .btn.tb.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.toolbar-right { margin-left: auto; }
#searchBox { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 4px; width: 190px; outline: none; }
#searchBox:focus { border-color: var(--brand); }

/* ===== 文件区（资源管理器网格） ===== */
.file-area { flex: 1; overflow-y: auto; background: #fff; }
.file-grid-head, .file-row {
  display: grid;
  grid-template-columns: 34px 30px minmax(120px, 1fr) 150px 110px 90px 40px;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
}
.file-grid-head {
  position: sticky; top: 0; z-index: 5; background: #fafbfc;
  font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--border);
  height: 34px; user-select: none;
}
.file-grid-head .sortable { cursor: pointer; padding: 6px 4px; }
.file-grid-head .sortable:hover { color: var(--brand); }
.sort-ind { color: var(--brand); font-size: 10px; }
.cell-name, .cell-time, .cell-type, .cell-size { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-grid-head .cell-name, .file-grid-head .cell-time, .file-grid-head .cell-type, .file-grid-head .cell-size { font-size: 12px; }

.file-row { height: 44px; border-bottom: 1px solid #f0f2f5; cursor: default; }
/* 复选框列开关（cb-off 时隐藏复选框列并收窄网格） */
#fileArea.cb-off .file-grid-head, #fileArea.cb-off .file-row {
  grid-template-columns: 30px minmax(120px, 1fr) 150px 110px 90px 40px;
}
#fileArea.cb-off .cell-check { display: none; }
.file-row:hover { background: var(--row-hover); }
.file-row.selected { background: var(--row-selected); }
.file-row.cut-row { opacity: .5; }
.cell-icon { display: flex; align-items: center; justify-content: center; }
.cell-icon .file-svg { width: 20px; height: 20px; }
.file-svg { display: block; flex: none; }
.cell-check { display: flex; align-items: center; justify-content: center; }
.cell-check input { cursor: pointer; }
.cell-name { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-meta { display: none; font-size: 11px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-btn {
  border: none; background: transparent; font-size: 18px; color: #889; cursor: pointer;
  width: 30px; height: 30px; border-radius: 4px; line-height: 1;
}
.more-btn:hover { background: #dde7f0; color: var(--text); }
.rename-input {
  font: inherit; font-size: 13px; padding: 4px 6px; border: 1.5px solid var(--brand);
  border-radius: 3px; outline: none; width: 100%; max-width: 320px;
}
.empty-tip, .empty-dir { text-align: center; color: var(--text-2); padding: 40px; font-size: 13px; }
.empty-icon { font-size: 42px; margin-bottom: 10px; }

/* ===== 图标视图（磁贴网格） ===== */
#fileArea.icon-view .file-grid-head { display: none; }
#fileArea.icon-view #fileList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
  padding: 12px;
  align-content: start;
}
.icon-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px 10px; border-radius: 6px; cursor: default;
  border: 1px solid transparent;
}
.icon-tile:hover { background: var(--row-hover); }
.icon-tile.selected { background: var(--row-selected); border-color: #9fd0f0; }
.icon-tile.cut-row { opacity: .5; }
.tile-icon { display: flex; align-items: center; justify-content: center; line-height: 1; }
.tile-icon .file-svg { width: 46px; height: 46px; }
.tile-name {
  font-size: 12px; text-align: center; line-height: 16px; width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}

.app-footer {
  display: flex; justify-content: space-between; gap: 12px; padding: 6px 16px;
  background: #fff; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); flex: none;
}
#clipBar { color: var(--brand-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 右键菜单 ===== */
.ctx-menu {
  position: fixed; z-index: 300; min-width: 200px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; padding: 5px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
}
.ctx-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  font-size: 13px; border-radius: 5px; cursor: pointer; user-select: none;
}
.ctx-item:hover { background: var(--brand-bg); }
.ctx-item.disabled { opacity: .4; pointer-events: none; }
.ctx-item.danger { color: var(--error); }
.ctx-item.danger:hover { background: rgba(211,47,47,.08); }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 8px; }

/* ===== 教室管理页表格（monitor.html 共用本样式表） ===== */
.file-table-wrap { overflow-x: auto; }
.file-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.file-table th {
  text-align: left; font-size: 12px; color: var(--text-2); font-weight: normal;
  padding: 8px 12px; border-bottom: 1px solid var(--border); background: #fafbfc;
  position: sticky; top: 0; user-select: none; z-index: 5;
}
.file-table td { padding: 8px 12px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.file-table tbody tr:hover { background: var(--row-hover); }
.row-actions .btn { padding: 4px 8px; min-height: 26px; font-size: 12px; margin-right: 4px; }
@media (max-width: 768px) {
  .file-table th:nth-child(2), .file-table td:nth-child(2),   /* IP */
  .file-table th:nth-child(3), .file-table td:nth-child(3) { display: none; } /* 登录时间 */
  .file-table th, .file-table td { padding: 8px; font-size: 12.5px; }
}

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  width: 380px; max-width: 100%; background: #fff; border-radius: 8px;
  padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.modal-sm { width: 320px; }
.modal-title { font-size: 15px; font-weight: bold; margin-bottom: 6px; }
.modal-hint { font-size: 12px; color: var(--text-2); margin-bottom: 14px; line-height: 18px; }
.call-volume { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.call-volume input[type=range] { flex: 1; accent-color: var(--brand); }
.call-volume span:last-child { min-width: 36px; text-align: right; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ===== 上传进度 ===== */
.upload-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 110; width: 300px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); overflow: hidden;
}
.upload-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: var(--brand); color: #fff; font-size: 13px; font-weight: bold;
}
.upload-panel-head .link-btn { color: #fff; }
#uploadList { max-height: 200px; overflow-y: auto; }
.upload-item { padding: 8px 12px; font-size: 12px; border-bottom: 1px solid #f0f2f5; }
.upload-item .name { display: flex; justify-content: space-between; margin-bottom: 4px; word-break: break-all; gap: 8px; }
.upload-item .name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .pct { color: var(--text-2); flex: none; }
.upload-item .pct.done { color: var(--ok); font-weight: bold; }
.upload-item .pct.fail { color: var(--error); font-weight: bold; }
.progress { height: 5px; background: #eef1f5; border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); width: 0; transition: width .2s; }

/* ===== 拖拽提示 / Toast ===== */
.dropzone-hint {
  position: fixed; inset: 0; z-index: 90; background: rgba(0,122,204,.12);
  border: 3px dashed var(--brand); display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--brand-dark); font-weight: bold; pointer-events: none;
}
.toast {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 400;
  background: rgba(30,30,30,.9); color: #fff; font-size: 13px;
  padding: 10px 20px; border-radius: 6px; max-width: 86vw; text-align: center;
}

/* ===== 手机端（≤768px） ===== */
@media (max-width: 768px) {
  .app-header { padding: 8px 10px; gap: 8px; }
  .app-brand-name { display: none; }
  .welcome { display: none; }
  .header-right { gap: 6px; }
  .header-right .btn { padding: 6px 8px; min-height: 30px; font-size: 12px; }

  .toolbar { padding: 6px 8px; gap: 4px; }
  .toolbar .btn.tb { padding: 6px 9px; }
  .toolbar-right { width: 100%; margin: 2px 0 0; order: 10; }
  #searchBox { width: 100%; }

  /* 网格：隐藏时间/类型/大小列，名称下显示元信息行 */
  .file-grid-head, .file-row {
    grid-template-columns: 30px 28px minmax(0, 1fr) 36px;
    padding: 0 8px;
  }
  #fileArea.cb-off .file-grid-head, #fileArea.cb-off .file-row {
    grid-template-columns: 28px minmax(0, 1fr) 36px;
  }
  .cell-time, .cell-type, .cell-size { display: none; }
  .cell-meta { display: block; }
  .file-row { height: 56px; }
  .cell-icon .file-svg { width: 22px; height: 22px; }
  .more-btn { display: flex; }               /* ⋮ 按钮手机常显 */

  /* 图标视图磁贴更紧凑 */
  #fileArea.icon-view #fileList { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 4px; padding: 8px; }
  .icon-tile { padding: 10px 4px 8px; }
  .tile-icon .file-svg { width: 42px; height: 42px; }

  .app-footer { flex-wrap: wrap; font-size: 11px; padding: 5px 10px; }

  .upload-panel { right: 8px; left: 8px; width: auto; bottom: 8px; }
  .modal { width: 100%; }
  .ctx-menu { min-width: 170px; }
}

/* 桌面端隐藏 ⋮ 按钮（有右键菜单） */
@media (min-width: 769px) {
  .more-btn { display: none; }
}
