:root {
  --primary: #1a73e8;
  --primary-dark: #0d47a1;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #222222;
  --muted: #8a8a8a;
  --border: #ececec;
  --sidebar-bg: #ffffff;
  --sidebar-text: #4a4f63;
  --sidebar-border: #eaecef;
  --sidebar-hover: #f3f5f9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #e9edf2;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.logo {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.brand-logo { display: inline-flex; flex-shrink: 0; }
.brand-logo img {
  width: 38px; height: 38px; border-radius: 9px;
  display: block; object-fit: contain; background: #fff;
}

/* ===== 总容器：桌面端为左右布局（侧边栏 + 主区） ===== */
#app {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

/* ===== 桌面端侧边栏（网站后台导航） ===== */
.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 1px 0 0 rgba(17,24,39,0.02), 3px 0 14px rgba(17,24,39,0.07);
  z-index: 5;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.brand-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2433;
  white-space: nowrap;
}
.brand-sub {
  font-size: 11px;
  font-weight: 400;
  color: #9aa0ad;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-nav {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  color: var(--sidebar-text);
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: var(--sidebar-hover); color: #1f2433; }
.sidebar .nav-link.active { background: var(--primary); color: #fff; }
.nav-link .nav-ico { font-size: 16px; line-height: 1; width: 18px; text-align: center; }
/* 侧边栏用户信息卡：展示登录人 + 退出（桌面端） */
.user-card {
  display: flex; align-items: center; gap: 10px;
  margin: auto 14px 14px; padding: 10px 12px;
  background: #f3f5f9; border-radius: 12px;
}
.uc-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.uc-info { flex: 1; min-width: 0; line-height: 1.3; }
.uc-name {
  color: #1f2433; font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.uc-role { color: #9aa0ad; font-size: 12px; }
.uc-logout {
  border: 1px solid #e2e5ea; background: #fff; color: #555;
  font-size: 12px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  transition: background .15s; flex-shrink: 0;
}
.uc-logout:hover { background: #eef1f6; }

/* 锁定页 / 通用退出按钮 */
.logout-btn {
  border: 1px solid var(--border); background: #fff; color: #555;
  font-size: 13px; padding: 8px 18px; border-radius: 8px; cursor: pointer;
}
.logout-btn:hover { background: #f5f5f5; }

/* ===== 主区域 ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* 顶部栏：桌面端隐藏（由侧边栏承担导航），仅移动端显示 */
.app-bar {
  display: none;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  align-items: center;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-bar .brand {
  display: none; /* 桌面端由侧边栏承担品牌，顶栏隐藏 */
}
.app-bar .title {
  flex: 1;
  text-align: left;
  padding-left: 2px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
}
.app-bar .back {
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  width: 36px;
  margin-right: 6px;
  display: none;
}

/* 视图区 */
#view {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 0;
}

/* 首页 Hero */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 22px 32px 16px;
  text-align: center;
}
.hero h1 { font-size: 24px; font-weight: 700; letter-spacing: 2px; }
.hero p { font-size: 13px; opacity: 0.85; margin-top: 6px; }
.hero .who {
  display: inline-block; margin-top: 14px; padding: 6px 16px;
  background: rgba(255,255,255,0.16); border-radius: 20px;
  font-size: 14px; font-weight: 600;
}

.section-title {
  padding: 24px 28px 6px;
  font-size: 15px;
  font-weight: 600;
  color: #444;
}

/* 功能宫格：桌面端自动铺满多列 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 14px 28px 12px;
}
.cell {
  position: relative;
  background: var(--card);
  border-radius: 14px;
  padding: 20px 6px 16px;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}
.cell:active { transform: scale(0.98); }
.cell .icon {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 21px;
  font-weight: 600;
}
.cell .label { font-size: 13px; color: #333; line-height: 1.2; }
.cell.building { opacity: 0.6; }
.cell.building:hover { transform: none; box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
.cell .dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
}
.cell.active .dot { background: #34a853; }

/* 建设中占位 */
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--muted);
  text-align: center;
  padding: 0 24px;
}
.placeholder .big { font-size: 48px; margin-bottom: 14px; opacity: 0.5; }
.placeholder .ptitle { font-size: 18px; color: #555; margin-bottom: 6px; }
.placeholder .psub { font-size: 13px; }

/* 模块 iframe：占满主区（桌面端无顶部栏，故占满整高） */
.module-frame {
  width: 100%;
  height: 100vh;
  border: none;
  background: #fff;
  display: block;
}

/* 我的（账户信息 / 修改密码） */
.profile-card {
  background: var(--card);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 16px 28px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.profile-row {
  display: flex;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }
.pr-label { width: 96px; color: var(--muted); flex-shrink: 0; }
.pr-val { color: #333; font-weight: 500; }
.pc-title { font-size: 15px; margin-bottom: 14px; }
.pc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #666;
  margin-bottom: 14px;
}
.pc-field input {
  height: 40px;
  border: 1px solid #dfe1ef;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
}
.form-actions { margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.form-actions button {
  height: 40px; padding: 0 22px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; cursor: pointer; font-size: 14px;
}
.form-actions button:disabled { opacity: 0.6; cursor: default; }
.form-msg { font-size: 13px; }
@media (max-width: 768px) {
  .profile-card { margin: 14px 14px; }
}
@media (max-width: 768px) {
  .profile-card { margin: 14px 14px; }
}

/* 桌面端默认隐藏移动端底部 Tab（仅在 ≤768px 时显示） */
.tab-bar { display: none; }

/* ===== 面试成绩查询 ===== */
.scores-wrap { padding: 16px 28px 24px; }
.scores-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--card); border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06); margin-bottom: 16px;
}
.scores-bar input[type=text] {
  flex: 1; min-width: 180px; height: 38px; border: 1px solid #dfe1ef;
  border-radius: 8px; padding: 0 12px; font-size: 14px;
}
.scores-bar select {
  height: 38px; border: 1px solid #dfe1ef; border-radius: 8px;
  padding: 0 10px; font-size: 14px; background: #fff;
}
.scores-bar button {
  height: 38px; padding: 0 20px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; cursor: pointer; font-size: 14px;
}
.scores-bar button.ghost { background: #f1f3f4; color: #555; }
.scores-bar button.danger { background: #fdecea; color: #c62828; }
.scores-bar button.danger:disabled { opacity: .5; cursor: not-allowed; }
.scores-stats { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.sc-stat {
  background: var(--card); border-radius: 10px; padding: 14px 22px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06); text-align: center; min-width: 110px;
}
.sc-stat .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.sc-stat.pass .num { color: #34a853; }
.sc-stat.fail .num { color: #ea4335; }
.sc-stat .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sc-table-wrap {
  overflow-x: auto; background: var(--card); border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.sc-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.sc-table thead th {
  text-align: left; padding: 14px 16px; background: #f5f7fb; color: #5a6172;
  font-weight: 600; font-size: 13px; border-bottom: 2px solid #eef0f5; white-space: nowrap;
}
.sc-th-check, .sc-td-check { width: 42px; text-align: center; padding-left: 16px !important; padding-right: 16px !important; }
.sc-th-check input, .sc-td-check input { width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }
.sc-table tbody td {
  padding: 13px 16px; border-bottom: 1px solid var(--border); color: #333;
  vertical-align: middle; white-space: nowrap;
}
.sc-table tbody tr.sc-row { transition: background .12s; }
.sc-table tbody tr.sc-row:hover { background: #f7f9fc; }
.sc-td-name { font-weight: 600; }
.sc-td-date, .sc-td-q { color: var(--muted); }
.sc-role { background: #fff3e0; color: #e65100; padding: 3px 10px; border-radius: 6px; font-size: 12px; }
.sc-badge { padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.sc-badge.pass { background: #e8f5e9; color: #2e7d32; }
.sc-badge.fail { background: #fce4ec; color: #c62828; }
.sc-cat { background: #e3f2fd; color: #1565c0; padding: 3px 10px; border-radius: 6px; font-size: 12px; }
.sc-toggle {
  border: 1px solid #dfe1ef; background: #fff; color: var(--primary);
  padding: 5px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; transition: background .12s;
}
.sc-toggle:hover { background: #eef2ff; }
.sc-detail-row td { background: #fafbfd; padding: 0 !important; }
.sc-detail-box { padding: 16px 18px; }
.sc-qitem {
  padding: 10px 12px; margin: 8px 0; background: #f8f9fa; border-radius: 8px;
  border-left: 3px solid var(--primary); font-size: 13px; line-height: 1.6;
  color: #333; white-space: pre-wrap; word-break: break-word;
}
.sc-qmod {
  display: inline-block; background: #eef2ff; color: #3a3f8f;
  padding: 1px 8px; border-radius: 5px; font-size: 11px; margin-right: 8px;
}
.scores-loading, .scores-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
@media (max-width: 768px) {
  .scores-wrap { padding: 12px 14px 20px; }
}

/* ===== 移动端（≤768px）：退回 App 竖屏样式，用底部 Tab ===== */
@media (max-width: 768px) {
  #app { flex-direction: column; }

  .sidebar { display: none; }

  .main { min-height: 100vh; }

  .app-bar { display: none; }

  #view { padding-bottom: 60px; }

  .hero { padding: 24px 16px 20px; }
  .hero h1 { font-size: 21px; }
  .section-title { padding: 16px 16px 4px; font-size: 14px; }
  .grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px 12px 6px;
  }
  .cell { padding: 14px 4px 10px; border-radius: 12px; }
  .cell .icon { width: 42px; height: 42px; border-radius: 11px; font-size: 18px; }
  .cell .label { font-size: 12px; }
  .module-frame { height: calc(100vh - 56px); }

  .tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: #fff;
    border-top: 1px solid var(--border);
    z-index: 30;
  }
  .tab {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    color: var(--muted);
    font-size: 11px;
  }
  .tab .tab-icon { font-size: 18px; line-height: 1; }
  .tab-bar .tab.active { background: transparent; color: var(--primary); font-weight: 600; }
  .tab-bar .tab.active .tab-icon { filter: drop-shadow(0 0 0 currentColor); }
}
