* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #1f2329; font-size: 14px; }
#login-screen { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 48px; width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.2); text-align: center; }
.login-card h1 { font-size: 24px; color: #1e3a8a; margin-bottom: 8px; }
.login-card .subtitle { color: #8a8f99; margin-bottom: 32px; font-size: 13px; }
.login-card .tip { color: #8a8f99; margin-bottom: 16px; font-size: 13px; }
.user-list { display: flex; flex-direction: column; gap: 12px; }
.user-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #e5e6eb; border-radius: 10px; cursor: pointer; transition: all .2s; }
.user-item:hover { border-color: #2563eb; background: #f0f7ff; transform: translateY(-2px); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.avatar.manager { background: #f59e0b; } .avatar.admin { background: #8b5cf6; }
.user-meta { text-align: left; flex: 1; } .user-meta .name { font-weight: 600; } .user-meta .role { font-size: 12px; color: #8a8f99; }

#app { display: none; height: 100vh; }
.app-layout { display: flex; height: 100vh; }
.sidebar { width: 220px; background: #1e293b; color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar .logo { padding: 20px; font-size: 18px; font-weight: 700; color: #fff; border-bottom: 1px solid #334155; }
.sidebar .logo small { display: block; font-size: 11px; color: #64748b; font-weight: 400; margin-top: 4px; }
.nav-menu { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item { padding: 12px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all .2s; border-left: 3px solid transparent; }
.nav-item:hover { background: #334155; color: #fff; }
.nav-item.active { background: #2563eb; color: #fff; border-left-color: #93c5fd; }
.nav-item .icon { font-size: 16px; }
.sidebar .user-box { padding: 16px 20px; border-top: 1px solid #334155; display: flex; align-items: center; gap: 10px; }
.sidebar .user-box .name { color: #fff; font-size: 13px; } .sidebar .user-box .role { font-size: 11px; color: #64748b; }
.btn-logout { margin-left: auto; color: #64748b; cursor: pointer; font-size: 12px; }
.btn-logout:hover { color: #f87171; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid #e5e6eb; display: flex; align-items: center; padding: 0 24px; gap: 16px; flex-shrink: 0; }
.topbar h2 { font-size: 18px; flex: 1; }
.content { flex: 1; overflow-y: auto; padding: 24px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-card .label { color: #8a8f99; font-size: 13px; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #1e293b; }
.stat-card .value.blue { color: #2563eb; } .stat-card .value.green { color: #16a34a; } .stat-card .value.orange { color: #f59e0b; } .stat-card .value.red { color: #dc2626; }

.card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title .badge { font-size: 11px; background: #fef3c7; color: #b45309; padding: 2px 8px; border-radius: 4px; font-weight: 400; }

.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-select, .search-input, .form-input, .form-select, .form-textarea { padding: 8px 12px; border: 1px solid #d4d6dc; border-radius: 8px; font-size: 13px; outline: none; }
.filter-select:focus, .search-input:focus, .form-input:focus, .form-select:focus { border-color: #2563eb; }
.search-input { width: 240px; }
.spacer { flex: 1; }

.btn { padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; transition: all .2s; }
.btn-primary { background: #2563eb; color: #fff; } .btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #16a34a; color: #fff; } .btn-success:hover { background: #15803d; }
.btn-warning { background: #f59e0b; color: #fff; } .btn-warning:hover { background: #d97706; }
.btn-danger { background: #dc2626; color: #fff; } .btn-danger:hover { background: #b91c1c; }
.btn-default { background: #fff; color: #1f2329; border: 1px solid #d4d6dc; } .btn-default:hover { border-color: #2563eb; color: #2563eb; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
th { background: #fafafa; color: #5c6066; font-weight: 600; white-space: nowrap; }
tr:hover { background: #f7faff; }
.table-wrap { overflow-x: auto; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.tag-blue { background: #e0edff; color: #2563eb; } .tag-green { background: #dcfce7; color: #16a34a; }
.tag-orange { background: #fef3c7; color: #d97706; } .tag-gray { background: #f1f3f5; color: #8a8f99; }
.tag-red { background: #fee2e2; color: #dc2626; } .tag-purple { background: #ede9fe; color: #7c3aed; }

.modal-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; align-items: center; justify-content: center; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 640px; max-width: 92vw; max-height: 88vh; overflow-y: auto; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; }
.modal-header h3 { font-size: 17px; flex: 1; }
.modal-close { cursor: pointer; color: #8a8f99; font-size: 22px; line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 12px; }

.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-group { flex: 1; }
.form-group label { display: block; margin-bottom: 6px; color: #5c6066; font-size: 13px; }
.form-group label .req { color: #dc2626; }
.form-input, .form-select, .form-textarea { width: 100%; }
.form-textarea { min-height: 70px; resize: vertical; font-family: inherit; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: 16px; height: 16px; }

.detail-section { margin-bottom: 20px; }
.detail-section h4 { font-size: 14px; color: #2563eb; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; }
.detail-item { display: flex; }
.detail-item .k { color: #8a8f99; width: 90px; flex-shrink: 0; }
.detail-item .v { color: #1f2329; }

.follow-item { padding: 12px; border-left: 3px solid #2563eb; background: #f7faff; border-radius: 0 8px 8px 0; margin-bottom: 10px; }
.follow-item .head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.follow-item .date { color: #8a8f99; font-size: 12px; }
.follow-item .content { color: #1f2329; }

.warn-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 12px 16px; color: #b45309; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.danger-box { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.info-box { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 12px 24px; border-radius: 8px; z-index: 2000; opacity: 0; transition: opacity .3s; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; }
.toast.success { background: #16a34a; } .toast.error { background: #dc2626; } .toast.warning { background: #f59e0b; }

.empty { text-align: center; padding: 48px; color: #8a8f99; }
.progress-bar { height: 8px; background: #f1f3f5; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: #2563eb; }
.bar-chart { display: flex; align-items: flex-end; gap: 16px; height: 180px; padding: 16px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar { width: 100%; max-width: 48px; background: linear-gradient(to top, #2563eb, #60a5fa); border-radius: 6px 6px 0 0; min-height: 4px; transition: height .4s; }
.bar-label { font-size: 12px; color: #5c6066; } .bar-value { font-size: 12px; font-weight: 600; color: #1e293b; }

/* ============ 移动端适配 ============ */
.hamburger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: #1f2329; padding: 4px 8px; margin-right: 4px; }
.sidebar-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; }
.sidebar-mask.show { display: block; }

@media (max-width: 768px) {
  body { font-size: 13px; }
  .hamburger { display: block; }
  .hide-mobile { display: none; }

  /* 侧边栏改为抽屉 */
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; transform: translateX(-100%); transition: transform .28s ease; width: 78vw; max-width: 280px; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.25); }
  .nav-item { padding: 16px 20px; font-size: 15px; }

  .topbar { padding: 0 14px; height: 54px; }
  .topbar h2 { font-size: 16px; }
  .content { padding: 14px; }

  /* 统计卡片改为两列 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card .value { font-size: 24px; }

  /* 工具栏竖向排列 */
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .spacer { display: none; }
  .search-input, .filter-select { width: 100%; }
  .toolbar .btn { width: 100%; }

  /* 表格横向滚动提示 */
  .table-wrap { -webkit-overflow-scrolling: touch; position: relative; }
  table { min-width: 640px; }

  /* 弹窗全屏化 */
  .modal { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .modal-body { padding: 16px; }
  .form-row { flex-direction: column; gap: 12px; }
  .detail-grid { grid-template-columns: 1fr; }

  /* 详情项换行 */
  .detail-item { flex-direction: column; }
  .detail-item .k { width: auto; margin-bottom: 2px; }

  /* 柱状图缩小 */
  .bar-chart { height: 150px; gap: 8px; }

  /* 卡片标题里的按钮组换行不挤压 */
  .card-title { flex-wrap: wrap; gap: 8px; }
  .card-title .btn-sm { font-size: 12px; }

  /* 表格内操作按钮：移动端略缩小并允许换行 */
  table td .btn-sm { padding: 4px 8px; font-size: 11px; margin-bottom: 2px; }

  /* 标签选择器在窄屏更紧凑 */
  .tag-picker { gap: 6px; }
  .tag-pick { padding: 6px 12px; font-size: 13px; }

  /* 附件缩略图小屏适配 */
  .img-thumb { width: 64px; height: 64px; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ===== 登录/注册表单（真实账号体系）===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  text-align: left;
}
.auth-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid #d1d9e6;
  border-radius: 8px;
  outline: none;
  transition: border-color .2s;
}
.auth-input:focus {
  border-color: #2b7de9;
  box-shadow: 0 0 0 3px rgba(43, 125, 233, .12);
}
.auth-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  margin-top: 4px;
}
.auth-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  margin-top: 6px;
}
.auth-switch a {
  color: #2b7de9;
  cursor: pointer;
  font-weight: 600;
}
.auth-switch a:hover {
  text-decoration: underline;
}

/* 标签选择器 */
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tag-pick { padding: 5px 12px; border: 1px solid #d1d5db; border-radius: 16px; font-size: 13px; cursor: pointer; user-select: none; transition: all .15s; background: #fff; color: #4b5563; }
.tag-pick:hover { border-color: #2563eb; }
.tag-pick.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.tag-purple { background: #ede9fe; color: #7c3aed; }

/* 图片预览缩略图 */
.img-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-thumb { position: relative; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; border: 1px solid #e5e7eb; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.img-del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 16px; text-align: center; background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; cursor: pointer; font-size: 14px; }
