* { box-sizing: border-box; margin: 0; padding: 0; }
[v-cloak] { display: none; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f4f6f9; color: #1f2937; font-size: 14px; line-height: 1.5;
}
input, select, textarea, button {
  font-family: inherit; font-size: 14px; border: 1px solid #d9dee5;
  border-radius: 8px; padding: 8px 10px; background: #fff; color: #1f2937; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #3b82f6; }
button { cursor: pointer; transition: .15s; }
button:hover { filter: brightness(.97); }
button:disabled { opacity: .6; cursor: not-allowed; }
.primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.primary:hover { background: #2563eb; }
.link { background: none; border: none; color: #3b82f6; padding: 4px 6px; }
.link.danger { color: #ef4444; }
.muted { color: #8a94a6; }
.big { font-size: 28px; font-weight: 700; margin-top: 6px; }
.big.red { color: #ef4444; }

/* 登录 */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-card {
  width: 340px; background: #fff; border-radius: 16px; padding: 32px 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,.08); text-align: center;
}
.auth-card h1 { font-size: 22px; }
.auth-card .sub { color: #8a94a6; margin: 6px 0 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button { flex: 1; padding: 8px; border-radius: 8px; background: #f1f4f8; border: 1px solid transparent; }
.tabs button.active { background: #3b82f6; color: #fff; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card form button { padding: 10px; }
.error { color: #ef4444; margin-top: 10px; }
.hint { color: #8a94a6; font-size: 12px; margin-top: 14px; }
.wecom-btn {
  margin-top: 12px; width: 100%; padding: 10px; border-radius: 8px;
  background: #2e7f3b; color: #fff; border: none; cursor: pointer; font-size: 14px;
}
.wecom-btn:hover { background: #276a32; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; background: #fff; border-right: 1px solid #e8ecf1; padding: 20px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { font-weight: 700; font-size: 18px; margin-bottom: 20px; padding-left: 8px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav button {
  text-align: left; background: none; border: none; padding: 10px 12px; border-radius: 8px; color: #4b5563;
}
.sidebar nav button.active { background: #eaf2ff; color: #2563eb; font-weight: 600; }
.user-box { border-top: 1px solid #e8ecf1; padding-top: 12px; }
.user-box .uname { font-weight: 600; margin-bottom: 4px; }
.content { flex: 1; padding: 24px 32px; max-width: 1100px; }
.content h2 { margin-bottom: 16px; }

/* 卡片 */
.cards { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.04); flex: 1; min-width: 180px; }
.card.wide { flex-basis: 100%; }
.card-title { font-weight: 600; color: #374151; margin-bottom: 8px; }
.card .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #eef1f5; }
.card .stat div { padding: 3px 0; }

.tag { display: inline-block; background: #eef2f7; color: #475569; border-radius: 6px; padding: 2px 8px; font-size: 12px; margin: 2px; }
.tag.red { background: #fee2e2; color: #dc2626; }
.tag.green { background: #dcfce7; color: #16a34a; }
.tag.blue { background: #dbeafe; color: #2563eb; }

/* 头部操作 */
.head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.head > div { display: flex; gap: 8px; align-items: center; }

/* 表格 */
table { width: 100%; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.04); border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eef1f5; }
th { background: #f8fafc; font-weight: 600; color: #475569; font-size: 13px; }
tr:last-child td { border-bottom: none; }

/* 计划列表 */
.plan-list { display: flex; flex-direction: column; gap: 12px; }
.plan-item { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.plan-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.progress { height: 8px; background: #eef1f5; border-radius: 5px; margin: 10px 0 6px; overflow: hidden; }
.progress .bar { height: 100%; background: #3b82f6; border-radius: 5px; transition: width .3s; }
.plan-actions { display: flex; gap: 10px; align-items: center; }

/* 周报 */
.report-actions { display: flex; gap: 10px; margin-top: 12px; }
.report-text { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; margin-top: 12px; white-space: pre-wrap; font-size: 13px; overflow-x: auto; }
.line { padding: 3px 0; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(15,23,42,.4); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: 380px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; }
.modal form { display: flex; flex-direction: column; gap: 12px; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #475569; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* toast */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

/* 设置页 */
.perm-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.perm-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #f8fafc; border-radius: 10px; }
.perm-row .switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.perm-row .switch input { width: 18px; height: 18px; }

/* 移动端底部导航（桌面端隐藏；企业微信多为手机端，放底部更好点） */
.bottom-nav { display: none; }

@media (max-width: 640px) {
  /* 手机端隐藏左侧栏，改用底部标签栏 */
  .sidebar { display: none; }
  .layout { display: block; min-height: 100vh; padding-bottom: 70px; }
  .content { padding: 14px 14px 20px; max-width: 100%; }

  /* 头部操作在手机上纵向排列，避免挤成一团 */
  .head { flex-direction: column; align-items: stretch; }
  .head > div { flex-wrap: wrap; }
  .head h2 { font-size: 18px; }

  /* 表格横向滚动，手机不会被撑爆 */
  table { display: block; overflow-x: auto; white-space: nowrap; font-size: 13px; }

  .cards { gap: 12px; }
  .card { min-width: 0; }
  .modal { width: 92%; padding: 18px; }
  .auth-wrap { padding: 16px; }
  .auth-card { width: 100%; max-width: 360px; }

  /* 底部标签栏 */
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: 56px; background: #fff; border-top: 1px solid #e8ecf1;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav button {
    flex: 1; background: none; border: none; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px; color: #8a94a6; font-size: 11px;
  }
  .bottom-nav button span { font-size: 20px; line-height: 1; }
  .bottom-nav button.active { color: #2563eb; font-weight: 600; }
}
