* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f2f4f7; color: #233; }
#app { height: 100%; display: flex; flex-direction: column; }

/* 登录页 */
.login-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 28px 12px; overflow-y: auto; background: linear-gradient(135deg, #c0211f 0%, #e23b2e 100%); }
/* 备案号：置于登录卡下方居中，红底上用半透明白字保证对比度 */
.beian-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; line-height: 1.6; color: rgba(255,255,255,.84); text-align: center; }
.beian-bar a { display: inline-flex; align-items: center; gap: 4px; color: rgba(255,255,255,.9); text-decoration: none; }
.beian-bar a:hover { color: #fff; text-decoration: underline; }
.beian-ico { width: 16px; height: 16px; display: block; flex: 0 0 auto; }
.beian-sep { color: rgba(255,255,255,.42); }
.login-card { background: #fff; border-radius: 14px; padding: 34px 30px; width: 340px; max-width: 88vw; box-shadow: 0 12px 40px rgba(0,0,0,.18); text-align: center; }
.login-card .brand { font-size: 30px; font-weight: 800; color: #c0211f; letter-spacing: 1px; }
.login-card .sysname { font-size: 17px; font-weight: 600; margin: 6px 0 2px; }
.login-card .login-tip { font-size: 12px; color: #889; margin-bottom: 18px; }
.login-err { background: #fdecea; color: #c0392b; font-size: 13px; padding: 8px; border-radius: 6px; margin-bottom: 12px; }

/* 登录页底部功能入口 */
.login-links { margin-top: 16px; font-size: 13px; color: #889; display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-links a { color: #c0211f; text-decoration: none; cursor: pointer; }
.login-links a:hover { text-decoration: underline; }
.login-links .sep { color: #ccd; }

/* 弹窗（修改密码 / 找回密码） */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 500; }
.modal-card { background: #fff; border-radius: 14px; padding: 24px 24px 20px; width: 360px; max-width: 90vw; box-shadow: 0 12px 40px rgba(0,0,0,.25); text-align: left; max-height: 92vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; font-size: 17px; font-weight: 700; color: #c0211f; margin-bottom: 14px; }
.modal-x { border: none; background: transparent; font-size: 22px; line-height: 1; color: #99a; cursor: pointer; }
.modal-form { display: flex; flex-direction: column; gap: 4px; }
.modal-form label { font-size: 13px; color: #556; margin-top: 6px; }
.modal-form input, .modal-select { padding: 10px 12px; border: 1px solid #d8dde3; border-radius: 8px; font-size: 14px; outline: none; width: 100%; }
.modal-form input:focus, .modal-select:focus { border-color: #e23b2e; }
.field-err { color: #e23b2e; font-size: 12px; min-height: 14px; }
.form-msg { font-size: 13px; padding: 8px 10px; border-radius: 6px; margin: 6px 0; }
.form-msg.err { background: #fdecea; color: #c0392b; }
.form-msg.ok { background: #f0f9eb; color: #67c23a; }
.form-tip { font-size: 13px; padding: 8px 10px; border-radius: 6px; background: #fff7e6; color: #b86b00; margin-bottom: 8px; }
.form-tip.ok { background: #f0f9eb; color: #67c23a; }
.modal-form .btn.primary { margin-top: 12px; }
.modal-back { margin-top: 8px; align-self: center; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card input { padding: 11px 12px; border: 1px solid #d8dde3; border-radius: 8px; font-size: 15px; outline: none; }
.login-card input:focus { border-color: #e23b2e; }

.btn { border: none; border-radius: 8px; padding: 10px 16px; font-size: 14px; cursor: pointer; }
.btn.primary { background: #c0211f; color: #fff; font-weight: 600; }
.btn.primary:hover { background: #a81b19; }
.btn.primary:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: #556; border: 1px solid #ccd; }
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* 外壳顶栏 */
.topbar { display: flex; align-items: center; gap: 16px; background: #fff; border-bottom: 1px solid #e6e9ee; padding: 0 18px; height: 56px; flex-shrink: 0; }
.topbar .brand { display: flex; align-items: center; font-weight: 800; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: #E60012; color: #fff; border-radius: 7px; font-size: 16px; font-weight: 800; margin-right: 8px; }
.logo-text { font-size: 20px; font-weight: 800; color: #E60012; letter-spacing: .5px; }
.portal-tag { font-size: 12px; font-weight: 600; color: #667; margin-left: 6px; background: #f0f2f5; padding: 2px 8px; border-radius: 10px; }
.tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: none; background: transparent; padding: 8px 16px; font-size: 15px; color: #667; cursor: pointer; border-radius: 8px; white-space: nowrap; flex-shrink: 0; scroll-snap-align: start; }
.tab.on { background: #fdecea; color: #c0211f; font-weight: 600; }
.right { display: flex; align-items: center; gap: 12px; }
.bell { position: relative; background: transparent; border: none; font-size: 20px; cursor: pointer; }
.badge { position: absolute; top: -4px; right: -6px; background: #e23b2e; color: #fff; font-size: 11px; border-radius: 10px; padding: 0 5px; }
.uname { font-size: 14px; color: #445; }

/* iframe 区 */
.frame-wrap { flex: 1; min-height: 0; background: #eef1f5; }
.frame-wrap iframe { width: 100%; height: 100%; border: none; background: #fff; }

/* 手机端 */
@media (max-width: 700px) {
  .topbar { gap: 8px; padding: 0 10px; height: 50px; }
  .topbar .brand { font-size: 16px; }
  .portal-tag { display: none; }
  .tabs { gap: 2px; }
  .tab { padding: 7px 10px; font-size: 14px; }
  .uname { display: none; }
  .notif-panel { top: 50px; right: 6px; width: 94vw; }
}

/* 通知中心面板 */
.notif-panel { position: fixed; top: 56px; right: 14px; width: 340px; max-width: 92vw; max-height: 70vh; overflow: hidden; background: #fff; border: 1px solid #e6e9ee; border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,.18); z-index: 300; display: flex; flex-direction: column; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid #eef1f5; font-size: 14px; font-weight: 600; color: #334; }
.notif-close { border: none; background: transparent; font-size: 20px; line-height: 1; color: #99a; cursor: pointer; }
.notif-list { overflow-y: auto; }
.notif-item { padding: 10px 14px; border-bottom: 1px solid #f2f4f7; cursor: pointer; }
.notif-item:hover { background: #fafbfc; }
.notif-item.unread { background: #fef6f5; }
.notif-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.notif-sys { font-size: 11px; padding: 1px 7px; border-radius: 8px; color: #fff; }
.sys-purchase { background: #c0211f; }
.sys-proposal { background: #2f6fed; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #e23b2e; }
.notif-title { font-size: 13.5px; color: #223; line-height: 1.4; }
.notif-msg { font-size: 12px; color: #778; margin-top: 2px; line-height: 1.4; }
.notif-time { font-size: 11px; color: #aab; margin-top: 4px; }
.notif-empty { padding: 30px; text-align: center; color: #aab; font-size: 13px; }


/* ===== 登录页底部链接 / 修改密码页 ===== */
.login-foot { margin-top: 14px; text-align: center; font-size: 13px; }
.login-foot a { color: #c62828; text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }

.pwd-card { width: 380px; padding-top: 24px; padding-bottom: 20px; max-height: 92vh; overflow-y: auto; }
.pwd-card .brand { font-size: 26px; }
.pwd-card .sysname { font-size: 16px; margin-top: 4px; }
.pwd-card .login-tip { font-size: 12px; line-height: 1.45; margin: 6px 0 10px; }
.pwd-card input, .pwd-card .pwd-sel {
  display: block; width: 100%; box-sizing: border-box;
  margin-bottom: 7px; padding: 8px 12px;
  border: 1px solid #dcdfe6; border-radius: 6px;
  font-size: 14px; outline: none; background: #fff; color: #303133;
}
.pwd-card input:focus, .pwd-card .pwd-sel:focus { border-color: #c62828; }
.pwd-card input[readonly] { background: #f5f7fa; color: #909399; }
.pwd-tabs { display: flex; gap: 8px; margin: 2px 0 12px; }
.pwd-tab {
  flex: 1; padding: 7px 0; font-size: 13px; cursor: pointer;
  border: 1px solid #dcdfe6; border-radius: 6px; background: #fff; color: #606266;
}
.pwd-tab.on { border-color: #c62828; color: #c62828; background: #fdf3f3; font-weight: 600; }
.pwd-code-row { display: flex; gap: 8px; margin-bottom: 8px; }
.pwd-code-row input { margin-bottom: 0; flex: 1; }
.pwd-code-row .btn { white-space: nowrap; }
.pwd-meter { min-height: 16px; font-size: 12px; margin-bottom: 6px; }
.pw-bad { color: #e6a23c; }
.pw-ok { color: #67c23a; }

/* ===== 帮助与支持 ===== */
.help-entry { background:#c0211f; color:#fff; border:none; border-radius:8px; padding:7px 14px; font-size:14px; font-weight:600; cursor:pointer; white-space:nowrap; }
.help-entry:hover { background:#a81b19; }
.help-page { height:100%; display:flex; flex-direction:column; background:#f2f4f7; }
.help-topbar { display:flex; align-items:center; justify-content:space-between; background:#fff; border-bottom:1px solid #e6e9ee; padding:0 18px; height:56px; flex-shrink:0; }
.help-main { flex:1; min-height:0; overflow-y:auto; padding:20px; max-width:960px; width:100%; margin:0 auto; }
.help-hero { display:flex; align-items:center; gap:16px; background:linear-gradient(135deg,#c0211f,#e23b2e); color:#fff; border-radius:14px; padding:24px; box-shadow:0 10px 30px rgba(192,33,31,.18); }
.help-hero-ico { font-size:40px; line-height:1; }
.help-hero h1 { font-size:22px; margin:0 0 6px; }
.help-hero p { font-size:14px; margin:0; line-height:1.6; opacity:.95; }
.help-card { background:#fff; border:1px solid #e6e9ee; border-radius:14px; padding:20px; margin-top:18px; box-shadow:0 4px 16px rgba(0,0,0,.04); }
.help-card-hd { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:14px; }
.help-card-hd h2 { font-size:17px; margin:0; color:#c0211f; }
.help-card-hd span { font-size:12px; color:#99a; }
.help-videos { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:16px; }
.hv-card { border:1px solid #eef1f5; border-radius:10px; overflow:hidden; background:#fafbfc; }
.hv-video { background:#000; }
.hv-video video { display:block; width:100%; height:auto; max-height:420px; background:#000; }
.hv-meta { padding:12px 14px; }
.hv-title { font-size:14px; font-weight:600; color:#233; }
.hv-desc { font-size:12px; color:#889; margin-top:4px; line-height:1.5; }
.hv-empty { grid-column:1/-1; border:1px dashed #d8dde3; border-radius:10px; padding:36px 20px; text-align:center; background:#fafbfc; }
.hv-empty-icon { font-size:38px; }
.hv-empty-t { font-size:15px; font-weight:600; color:#556; margin:10px 0 6px; }
.hv-empty-d { font-size:12px; color:#99a; line-height:1.7; }
.support-box { display:flex; align-items:center; gap:18px; }
.support-avatar { width:64px; height:64px; flex:0 0 64px; border-radius:50%; background:#fdecea; color:#c0211f; font-size:26px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.support-info { min-width:0; }
.support-name { font-size:18px; font-weight:700; color:#233; }
.support-role { font-size:12px; color:#889; margin:3px 0 10px; }
.support-contact { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.support-tel { font-size:20px; font-weight:700; color:#c0211f; text-decoration:none; letter-spacing:.5px; }
.support-wx { font-size:13px; color:#667; margin-top:10px; }
.support-wx b { color:#c0211f; }
.help-faq ul { margin:0; padding-left:20px; }
.help-faq li { font-size:13px; color:#556; line-height:1.9; }
@media (max-width:700px){
  .topbar .help-entry { padding:6px 10px; font-size:13px; }
  .help-topbar { height:50px; padding:0 12px; }
  .help-main { padding:12px; }
  .help-hero { padding:18px; gap:12px; }
  .help-hero-ico { font-size:32px; }
  .help-hero h1 { font-size:19px; }
  .help-hero p { font-size:13px; }
  .help-card { padding:14px; margin-top:12px; }
  .help-videos { grid-template-columns:1fr; }
  .support-tel { font-size:17px; }
}

/* ===== 视频管理 ===== */
.hv-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; }
.hv-card .hv-video { position:relative; cursor:pointer; }
.hv-play { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:46px; height:46px; border-radius:50%; background:rgba(192,33,31,.92); color:#fff; font-size:18px; display:flex; align-items:center; justify-content:center; pointer-events:none; }
.hv-sub { font-size:12px; color:#99a; margin-top:3px; }
.hv-ops { display:flex; gap:8px; margin-top:10px; }
.btn.danger { color:#c0392b; border-color:#e6b4b0; }
.vfilters { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.vfilter { border:1px solid #e2e6ec; background:#fff; color:#556; border-radius:18px; padding:5px 12px; font-size:13px; cursor:pointer; }
.vfilter span { font-size:11px; color:#99a; margin-left:2px; }
.vfilter.on { background:#c0211f; border-color:#c0211f; color:#fff; }
.vfilter.on span { color:#fff; opacity:.85; }
.vm-panel { background:#fafbfc; border:1px solid #eef1f5; border-radius:10px; padding:14px; margin-bottom:16px; }
.vm-panel-hd { font-size:14px; font-weight:600; color:#233; margin-bottom:12px; }
.vm-panel-hd span { font-size:11px; font-weight:400; color:#99a; margin-left:6px; }
.vm-cats-title { font-size:12px; color:#667; font-weight:600; margin:6px 0 8px; }
.vm-cat-list { display:flex; flex-direction:column; gap:6px; margin-bottom:8px; }
.vm-cat-item { display:flex; align-items:center; justify-content:space-between; gap:10px; background:#fff; border:1px solid #eef1f5; border-radius:8px; padding:6px 10px; font-size:13px; }
.vm-cat-item small { color:#99a; font-size:11px; }
.vm-cat-item span:last-child { display:flex; gap:6px; }
.vm-empty { font-size:12px; color:#aab; padding:6px 0; }
.vm-cat-add, .vm-row { display:flex; gap:8px; margin-bottom:8px; }
.vm-cat-add input, .vm-row input, .vm-row select, .vm-upload > input { flex:1; min-width:0; padding:7px 10px; border:1px solid #d8dde3; border-radius:7px; font-size:13px; outline:none; background:#fff; }
.vm-row select { flex:0 0 150px; }
.vm-limit { font-size:11px; color:#99a; }
.vm-progress { display:flex; align-items:center; gap:10px; margin-top:8px; font-size:12px; color:#556; }
.vm-bar { flex:1; height:8px; background:#eef1f5; border-radius:5px; overflow:hidden; }
.vm-bar i { display:block; height:100%; width:0; background:#c0211f; transition:width .15s; }
.vm-msg { font-size:12px; margin-top:6px; min-height:15px; }
.vm-msg.err { color:#c0392b; }
.vm-msg.ok { color:#27ae60; }
.video-play-mask { position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:600; display:flex; align-items:center; justify-content:center; padding:20px; }
.video-play-card { background:#fff; border-radius:12px; width:min(820px,96vw); overflow:hidden; box-shadow:0 16px 50px rgba(0,0,0,.3); }
.video-play-hd { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; font-size:15px; font-weight:600; border-bottom:1px solid #eef1f5; }
.video-play-card video { display:block; width:100%; max-height:72vh; background:#000; }
.video-play-desc { padding:10px 16px; font-size:13px; color:#667; }
@media (max-width:700px){
  .hv-grid { grid-template-columns:1fr; }
  .vm-row { flex-direction:column; }
  .vm-row select { flex:1; }
  .vm-cat-item { flex-wrap:wrap; }
}


/* ===== 视频编辑弹窗 ===== */
.video-edit-card { background:#fff; border-radius:12px; width:min(520px,96vw); max-height:92vh; overflow:auto; box-shadow:0 16px 50px rgba(0,0,0,.3); }
.video-edit-card .video-play-hd { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid #eef1f5; font-size:16px; font-weight:600; color:#233; }
.ve-body { display:flex; flex-direction:column; gap:6px; padding:16px 18px; }
.ve-body label { font-size:13px; color:#556; margin-top:6px; }
.ve-body input, .ve-body select { padding:9px 11px; border:1px solid #d8dde3; border-radius:8px; font-size:14px; outline:none; width:100%; background:#fff; }
.ve-body input:focus, .ve-body select:focus { border-color:#e23b2e; }
.ve-body .vm-limit { font-size:12px; color:#99a; margin-top:2px; }
.ve-foot { display:flex; justify-content:flex-end; gap:10px; padding:12px 18px 18px; }

/* ===== MOBILE NAV FIX 20261123 (v2: 2行顶栏) ===== */
/* 目标：手机上顶栏只占 2 行——第1行 logo + 功能按钮，第2行子系统 tabs。
 * 原 3 行（logo / 按钮 / tabs）浪费竖向空间；本块压缩间距与按钮尺寸，
 * 确保 390px 主流机型 logo 与「铃铛/帮助/修改密码/退出」同行；
 * ≤360px 极窄屏隐藏 "Fortek" 文字仅留 F 图标，仍同行。 */
@media (max-width: 700px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 48px;
    padding: 5px 10px 3px;
    gap: 4px 6px;
    align-content: center;
  }
  .topbar .brand { order: 1; flex-shrink: 0; }
  .topbar .brand .portal-tag { display: none; }
  .topbar .right { order: 2; margin-left: auto; flex-shrink: 0; gap: 4px; }
  .topbar .right .btn,
  .topbar .right .help-entry { padding: 5px 8px; font-size: 12px; white-space: nowrap; }
  .topbar .right .bell { font-size: 18px; }
  .topbar .tabs {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    padding-top: 3px;
    border-top: 1px solid #eef1f5;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .topbar .tab { flex: 0 0 auto; padding: 7px 12px; font-size: 14px; }
}
/* 极窄屏：只留 F 图标，保证 logo 与按钮同行 */
@media (max-width: 360px) {
  .topbar .logo-text { display: none; }
  .topbar .logo-mark { margin-right: 0; }
}

/* ===== 顶栏第一行收拢：帮助降级 + 用户菜单 ===== */
/* 理由：手机上 390px 首行要同时容纳 logo、铃铛、帮助、修改密码、退出，
 * 5 个元素必然拥挤且「退出」等破坏性操作容易被误触。
 * 方案：破坏性/低频操作收进用户菜单，首行只保留 品牌 / 铃铛 / 帮助 / 用户。 */
.topbar .help-entry {
  background: transparent; color: #556; border: 1px solid #d8dde3;
  border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
}
.topbar .help-entry:hover { background: #f5f6f8; color: #c0211f; border-color: #e9b7b3; }
.usermenu-wrap { position: relative; flex-shrink: 0; }
.usermenu-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid #d8dde3; border-radius: 999px;
  padding: 3px 9px 3px 3px; cursor: pointer; color: #445; font-size: 13px;
}
.usermenu-btn:hover { background: #f5f6f8; border-color: #c9d0d8; }
.usermenu-btn .avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: #c0211f; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0;
}
.usermenu-btn .caret { font-size: 10px; color: #99a; }
.usermenu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 168px;
  background: #fff; border: 1px solid #e6e9ee; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20,30,50,.14); padding: 6px; z-index: 60;
}
.usermenu-head {
  padding: 7px 10px 9px; border-bottom: 1px solid #eef1f5; margin-bottom: 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.usermenu-head b { font-size: 13px; color: #223; }
.usermenu-head span { font-size: 12px; color: #889; }
.usermenu-item {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; border-radius: 7px;
  padding: 9px 10px; font-size: 13px; color: #445; cursor: pointer;
}
.usermenu-item:hover { background: #f5f6f8; color: #c0211f; }
.usermenu-item.danger:hover { background: #fdecea; color: #c0392b; }

@media (max-width: 700px) {
  .topbar .uname { display: none; }                 /* 姓名进菜单，首行只留头像 */
  .topbar .help-entry { padding: 4px 8px; font-size: 12px; }
  .usermenu-btn { padding: 3px 6px 3px 3px; }
  .usermenu-btn .caret { display: none; }
  .usermenu { min-width: 150px; }
}

/* 通知面板：全部已读 */
.notif-acts { display: inline-flex; align-items: center; gap: 8px; }
.notif-markall {
  border: 1px solid #e0e4ea; background: #fff; color: #556; border-radius: 6px;
  padding: 3px 9px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.notif-markall:hover { background: #f5f6f8; color: #c0211f; border-color: #e9b7b3; }
