* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f6fa; color: #1f2937; }

/* 顶栏 */
.topbar {
  height: 56px; background: #0f2a52; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.topbar .brand { font-size: 18px; font-weight: 600; letter-spacing: .5px; }
.topbar .user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.topbar .uname { opacity: .9; }
.btn-mini {
  color: #fff; text-decoration: none; font-size: 13px;
  border: 1px solid rgba(255,255,255,.4); padding: 4px 10px; border-radius: 4px;
}
.btn-mini:hover { background: rgba(255,255,255,.12); }

/* 登录页 */
.login-wrap { min-height: calc(100vh - 56px); display: flex; align-items: center; justify-content: center; }
.login-card {
  background: #fff; padding: 36px 40px; border-radius: 10px; width: 340px;
  box-shadow: 0 8px 30px rgba(15,42,82,.12); text-align: center;
}
.login-card h1 { font-size: 20px; color: #0f2a52; margin-bottom: 6px; }
.login-card .sub { color: #6b7280; font-size: 13px; margin-bottom: 20px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card input {
  padding: 11px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}
.login-card button {
  padding: 11px; border: none; border-radius: 6px; background: #0f2a52; color: #fff;
  font-size: 15px; cursor: pointer;
}
.login-card button:hover { background: #163a6b; }
.error { color: #dc2626; font-size: 13px; margin-bottom: 8px; }

/* 主体布局 */
.container { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 220px; background: #fff; border-right: 1px solid #e5e7eb; padding: 18px 14px;
}
.side-title { font-size: 13px; color: #6b7280; margin-bottom: 10px; }
.cat-tree { list-style: none; }
.cat-tree li { margin-bottom: 4px; }
.cat-tree a {
  display: block; padding: 8px 10px; border-radius: 6px; color: #374151;
  text-decoration: none; font-size: 14px;
}
.cat-tree a:hover, .cat-tree a.active { background: #eaf0fb; color: #0f2a52; font-weight: 600; }

.content { flex: 1; padding: 24px 28px; }
.content h2 { font-size: 18px; margin-bottom: 16px; color: #0f2a52; }
.empty { color: #9ca3af; font-size: 14px; }

/* 资源卡片 */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.res-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px;
  display: flex; align-items: center; gap: 12px;
}
.res-icon { font-size: 28px; }
.res-info { flex: 1; min-width: 0; }
.res-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-meta { color: #6b7280; font-size: 12px; margin-top: 4px; }
.btn-download {
  background: #0f2a52; color: #fff; text-decoration: none; font-size: 13px;
  padding: 7px 14px; border-radius: 6px; white-space: nowrap;
}
.btn-download:hover { background: #163a6b; }

/* 资料中心 - 公开目录 */
.study { flex-direction: column; max-width: 1100px; margin: 0 auto; padding: 24px 20px 48px; }
.hero { margin: 12px 0 20px; }
.hero h1 { font-size: 26px; color: #0f2a52; }
.hero-sub { color: #6b7280; font-size: 14px; margin-top: 6px; }
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.cat-tabs a {
  text-decoration: none; font-size: 14px; color: #374151;
  padding: 6px 14px; border-radius: 16px; background: #fff; border: 1px solid #e5e7eb;
}
.cat-tabs a:hover, .cat-tabs a.active { background: #0f2a52; color: #fff; border-color: #0f2a52; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.prod-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
  text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s;
}
.prod-card:hover { box-shadow: 0 8px 24px rgba(15,42,82,.14); transform: translateY(-2px); }
.prod-cover {
  height: 150px; background: #eef1f6 center/cover no-repeat; display: flex;
  align-items: center; justify-content: center;
}
.prod-cover-ph { font-size: 42px; opacity: .35; }
.prod-body { padding: 14px 16px 18px; }
.prod-name { font-weight: 700; font-size: 16px; color: #0f2a52; }
.prod-desc { color: #6b7280; font-size: 13px; margin-top: 6px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-more { margin-top: 10px; color: #2563eb; font-size: 13px; font-weight: 600; }

/* 产品详情页 */
.product { flex-direction: column; max-width: 900px; margin: 0 auto; padding: 20px; }
.back { color: #2563eb; font-size: 14px; text-decoration: none; margin-bottom: 16px; display: inline-block; }
.prod-hero { display: flex; gap: 24px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 24px; margin-bottom: 26px; }
.prod-hero-cover {
  width: 220px; height: 180px; flex: none; border-radius: 10px; background: #eef1f6 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
}
.prod-hero-info { flex: 1; min-width: 0; }
.prod-tag { display: inline-block; background: #eaf0fb; color: #0f2a52; font-size: 12px; padding: 3px 10px; border-radius: 12px; margin-bottom: 10px; }
.prod-hero-info h1 { font-size: 24px; color: #0f2a52; margin-bottom: 12px; }
.prod-detail { color: #374151; font-size: 14px; line-height: 1.7; }
.prod-detail :where(h1,h2,h3) { color: #0f2a52; margin: 12px 0 6px; }
.prod-detail img { max-width: 100%; border-radius: 6px; }
.prod-detail a { color: #2563eb; }
.res-section h2 { font-size: 18px; color: #0f2a52; margin-bottom: 14px; }
.res-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.res-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px 18px;
}
.res-row-info { min-width: 0; }
.res-row-title { font-weight: 600; font-size: 15px; color: #1f2937; }
.res-row-meta { color: #6b7280; font-size: 12px; margin-top: 4px; }
.btn-download {
  background: #0f2a52; color: #fff; text-decoration: none; font-size: 13px;
  padding: 8px 18px; border-radius: 6px; white-space: nowrap;
}
.btn-download:hover { background: #163a6b; }
.btn-lock {
  background: #f3f4f6; color: #6b7280; text-decoration: none; font-size: 13px;
  padding: 8px 18px; border-radius: 6px; white-space: nowrap; border: 1px solid #e5e7eb;
}
.btn-lock:hover { background: #e5e7eb; color: #374151; }
.hint { color: #9ca3af; font-size: 13px; margin-top: 12px; }

/* 管理后台 */
.admin { flex-direction: column; gap: 18px; max-width: 960px; }
.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px 20px; }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.panel form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.panel input, .panel select {
  padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}
.panel button {
  padding: 9px 16px; border: none; border-radius: 6px; background: #0f2a52; color: #fff;
  font-size: 14px; cursor: pointer;
}
.panel button:hover { background: #163a6b; }
.panel button.danger { background: #dc2626; }
.panel button.danger:hover { background: #b91c1c; }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li { background: #eaf0fb; color: #0f2a52; padding: 5px 10px; border-radius: 14px; font-size: 13px; }
.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th, .grid td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eef0f3; }
.grid th { color: #6b7280; font-weight: 600; }
.inline { display: inline; }
.muted { color: #9ca3af; }
