/* ===== 开发工具下载展示平台 - 共享样式 ===== */
:root {
  --primary: #1e3a5f;
  --primary-hover: #15293d;
  --accent: #2c6cb0;
  --accent-hover: #1f5a96;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 2px 10px rgba(30, 58, 95, 0.08);
  --radius: 12px;
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* 顶部标题栏 */
.topbar {
  background: linear-gradient(135deg, var(--primary) 0%, #2c5282 100%);
  color: #fff;
  padding: 22px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.topbar .wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.topbar .brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}
.topbar .brand small {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.85;
  margin-left: 8px;
}
.topbar .nav a {
  color: #fff;
  opacity: 0.9;
  font-size: 14px;
}
.topbar .nav a:hover { opacity: 1; }

/* 容器 */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.container.narrow {
  max-width: 460px;
  padding-top: 60px;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  margin-bottom: 24px;
}
.card h2 {
  color: var(--primary);
  font-size: 20px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.card h3 {
  color: var(--primary);
  font-size: 17px;
  margin-bottom: 8px;
}

/* 区块标题 */
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.section-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

/* 简介 */
.intro-box { color: var(--text); }
.intro-box .desc { font-size: 15px; margin-bottom: 12px; }
.intro-box .env {
  display: inline-block;
  background: #eef4fb;
  color: var(--accent);
  border: 1px solid #d6e4f5;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
}

/* 教程 */
.tutorial-video {
  width: 100%;
  max-height: 480px;
  background: #000;
  border-radius: 10px;
  margin-bottom: 22px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.step-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.step-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f0f2f5;
}
.step-card .step-body {
  padding: 14px 16px;
}
.step-card .step-no {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.step-card .step-text { font-size: 14px; color: var(--text); }

.empty-hint {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 24px;
}

/* 版本下载卡片 */
.version-list { display: grid; gap: 16px; }
.version-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.version-card .v-info { flex: 1; min-width: 220px; }
.version-card .v-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.version-card .v-ver {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}
.version-card .v-date {
  font-size: 12px;
  color: var(--muted);
}
.version-card .v-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.version-card .v-log {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
}
.version-card .v-actions { display: flex; align-items: center; }

/* 按钮 */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.08s ease;
  text-align: center;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; display: block; }
.btn.primary { background: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #c53636; }
.btn.ghost {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn.ghost:hover { background: #f0f4f8; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.18s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 108, 176, 0.12);
}
.form-group textarea { resize: vertical; min-height: 90px; }

/* 消息提示 */
.msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
}
.msg.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.msg.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.msg.info { background: #eef4fb; color: #1e40af; border: 1px solid #bfdbfe; }

/* 后台标签页 */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-weight: 500;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 资源列表 */
.res-list { display: grid; gap: 10px; }
.res-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
  flex-wrap: wrap;
}
.res-item .res-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: #e5e7eb;
  flex-shrink: 0;
}
.res-item .res-vid {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
  flex-shrink: 0;
}
.res-item .res-meta { flex: 1; min-width: 160px; }
.res-item .res-title { font-weight: 600; font-size: 14px; }
.res-item .res-sub { font-size: 12px; color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}
.tag.image { background: #eef4fb; color: #1e40af; }
.tag.video { background: #fef3c7; color: #92400e; }

/* 软件下载密码行（后台） */
.pwd-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}
.pwd-label { color: var(--muted); white-space: nowrap; }
.pwd-chip {
  font-family: Consolas, Menlo, "Courier New", monospace;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
  font-weight: 600;
  user-select: all;
}
.pwd-none { color: var(--muted); font-size: 12px; }
.pwd-edit-row {
  width: 100%;
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
}
.pwd-edit-row.show { display: flex; }
.pwd-edit-row input { min-width: 200px; flex: 1; max-width: 280px; }

/* 教程步骤行 */
.step-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fafbfc;
}
.step-row img.preview {
  width: 90px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  background: #e5e7eb;
}
.step-row .no-preview {
  width: 90px;
  height: 64px;
  border-radius: 6px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 12px;
}

/* 页脚 */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ===== 多软件：前台软件卡片网格 ===== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.app-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.12s ease;
}
.app-card:hover {
  box-shadow: 0 8px 24px rgba(30, 58, 95, 0.14);
  transform: translateY(-2px);
}
.app-card .app-cover {
  height: 150px;
  background: linear-gradient(135deg, #234a73 0%, #2c6cb0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.app-card .app-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-card .app-cover .app-logo-fallback {
  font-size: 44px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}
.app-card .app-body {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.app-card .app-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.app-card .app-summary {
  font-size: 14px;
  color: var(--muted);
  flex: 1;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-card .app-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.app-card .app-latest {
  font-size: 12px;
  color: var(--muted);
}
.app-card .app-latest b { color: var(--accent); }

/* 详情页 */
.back-link {
  display: inline-block;
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--accent);
}
.detail-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.detail-head .detail-icon {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  background: linear-gradient(135deg, #234a73, #2c6cb0);
  flex-shrink: 0;
}
.detail-head .detail-icon.fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
}
.detail-head h1 {
  font-size: 26px;
  color: var(--primary);
  line-height: 1.3;
}
.detail-tabs-note { margin-bottom: 18px; }

/* ===== 后台：软件选择器 + 工作台 ===== */
.app-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.app-switcher select {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.work-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.work-section > .ws-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.work-section > .ws-head h3 {
  color: var(--primary);
  font-size: 17px;
  margin: 0;
}
.work-section > .ws-head .ws-no {
  background: var(--primary);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.ws-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 16px;
}
.inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.inline-form .form-group { flex: 1; min-width: 200px; margin-bottom: 0; }

/* 素材网格 */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.asset-cell {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fafbfc;
  position: relative;
}
.asset-cell .cell-media {
  height: 100px;
  background: #e5e7eb;
}
.asset-cell .cell-media img { width: 100%; height: 100%; object-fit: cover; }
.asset-cell .cell-media video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.asset-cell .cell-info {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-cell .cell-del {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  padding: 3px 8px;
  cursor: pointer;
}
.asset-cell .cell-del:hover { background: #c53636; }

/* 前台软件截图画廊 */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.gallery a {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f0f2f5;
  position: relative;
}
.gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
  cursor: zoom-in;
}
.gallery a:hover img { transform: scale(1.05); }
.gallery .g-title {
  display: block;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 教程步骤图可点击放大 */
.step-card { cursor: zoom-in; }

/* 更多视频 */
.more-video-item { margin-top: 18px; }
.more-video-item .mv-title {
  font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px;
}

/* 图片放大查看（灯箱） */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.86);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox .lb-close {
  position: absolute;
  top: 18px; right: 26px;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  opacity: 0.85;
}
.lightbox .lb-close:hover { opacity: 1; }
.lightbox .lb-hint {
  position: absolute;
  bottom: 18px; left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  pointer-events: none;
}

/* 资源管理：按软件分组的文件清单 */
.res-group { margin-bottom: 22px; }
.res-group-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  padding: 8px 12px;
  background: #eef4fb;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.res-group-title .res-count { font-size: 12px; color: var(--muted); font-weight: 400; }
.tag.zip { background: #ede9fe; color: #5b21b6; }

/* 响应式补充 */
@media (max-width: 640px) {
  .apps-grid { grid-template-columns: 1fr; }
  .detail-head h1 { font-size: 21px; }
  .work-section { padding: 16px 14px; }
  .asset-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .app-switcher select { max-width: none; }
}
