/* 鸿掣数字化门户 · 企业工作台规范 */

:root {
  --brand: #C8102E;
  --brand-dark: #A30D25;
  --brand-weak: #F8E8EA;
  --navy: #1A2332;
  --navy-2: #243044;
  --bg: #F0F2F5;
  --surface: #FFFFFF;
  --border: #E5E6EB;
  --border-strong: #D4D6DB;
  --text: #1D2129;
  --text-2: #4E5969;
  --text-3: #86909C;
  --r: 6px;
  --r-sm: 4px;
  --shadow: 0 1px 2px rgba(26, 35, 50, .06);
  --shadow-md: 0 4px 16px rgba(26, 35, 50, .08);
  --header-h: 56px;
  --max: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ===== 登录 ===== */
.login-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; background: #0B1017;
  transition: opacity .4s ease, visibility .4s;
}
.login-mask.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.login-brand {
  flex: 1; display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 64px 56px; color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(900px 500px at -10% 110%, rgba(200,16,46,.28), transparent 55%),
    radial-gradient(700px 420px at 110% -10%, rgba(212,160,23,.16), transparent 50%),
    linear-gradient(165deg, #101821 0%, #0B1017 58%, #161016 100%);
}
.login-brand::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.brand-mark { position: relative; display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 48px; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.brand-logo img,
.logo img {
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  object-fit: contain; object-position: center; display: block;
}
.brand-logo img { height: 20px; width: auto; }
.brand-name {
  font-size: 12px; letter-spacing: 2.4px; color: rgba(255,255,255,.55); font-weight: 600;
}
.brand-copy { position: relative; max-width: 440px; margin: 48px 0 auto; }
.brand-kicker {
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: #D4A017; margin-bottom: 14px; font-weight: 600;
}
.login-brand h1 {
  font-size: 40px; font-weight: 650; letter-spacing: .5px; line-height: 1.2; margin-bottom: 16px;
}
.brand-desc { font-size: 15px; color: rgba(255,255,255,.56); max-width: 360px; line-height: 1.75; }
.login-brand .brand-meta {
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; max-width: 420px;
}
.login-brand .brand-meta div {
  padding: 14px 0 0; border-top: 1px solid rgba(255,255,255,.1);
}
.login-brand .brand-meta b { display: block; font-size: 22px; font-weight: 650; color: #fff; }
.login-brand .brand-meta span { font-size: 12px; color: rgba(255,255,255,.4); }

.login-panel {
  width: 520px; max-width: 46vw;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 48px; background: #EDEFF3;
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 18px;
  padding: 36px 36px 22px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, .08), 0 0 0 1px rgba(16, 24, 40, .04);
}
.login-card h2 { font-size: 24px; font-weight: 650; letter-spacing: .2px; margin-bottom: 6px; }
.login-card .sub,
.bind-title { font-size: 13px; color: var(--text-3); margin-bottom: 22px; line-height: 1.6; }
.login-seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 22px;
  background: #F1F3F6; border-radius: 10px;
}
.login-tab {
  height: 36px; font-size: 13px; color: var(--text-3); font-weight: 600;
  border-radius: 8px; transition: background .2s, color .2s, box-shadow .2s;
}
.login-tab.active {
  background: #fff; color: var(--text);
  box-shadow: 0 1px 3px rgba(16,24,40,.08);
}
.login-panel-body { display: none; }
.login-panel-body.active { display: block; animation: loginIn .28s ease; }
.login-auth[hidden],
.device-bind[hidden] { display: none !important; }
.device-bind { animation: loginIn .28s ease; }
.device-bind h2 { margin-bottom: 8px; }
@keyframes loginIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.field { position: relative; display: block; margin-bottom: 14px; }
.field .login-field {
  width: 100%; height: 52px; margin: 0;
  padding: 20px 14px 6px;
  border: 1px solid transparent; border-radius: 10px;
  font-size: 15px; color: var(--text); background: #F4F6F8;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field .login-field:focus {
  outline: none; background: #fff; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(200,16,46,.1);
}
.field span {
  position: absolute; left: 14px; top: 16px;
  font-size: 14px; color: var(--text-3); pointer-events: none;
  transition: transform .18s ease, font-size .18s ease, color .18s;
}
.field .login-field:focus + span,
.field .login-field:not(:placeholder-shown) + span {
  transform: translateY(-9px); font-size: 11px; color: var(--text-3);
}
.field:has(.field-toggle) .login-field { padding-right: 48px; }
.field-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--text-3); font-weight: 600; padding: 4px 6px;
}
.field-toggle:hover { color: var(--brand); }
.login-field::placeholder { color: transparent; }
.login-btn {
  width: 100%; height: 48px; margin-top: 8px;
  background: var(--brand); color: #fff; border-radius: 10px;
  font-size: 15px; font-weight: 650; letter-spacing: .3px;
  box-shadow: 0 8px 18px rgba(200,16,46,.22);
  transition: background .2s, transform .2s, box-shadow .2s;
}
.login-btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.login-btn:active { transform: none; }
.login-btn:disabled { opacity: .7; transform: none; box-shadow: none; cursor: wait; }
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  user-select: none;
}
.login-remember input { width: 14px; height: 14px; margin: 0; cursor: pointer; }
.login-err { min-height: 18px; margin-top: 10px; font-size: 12px; color: #C8102E; }
.login-status { margin-top: 18px; padding-top: 14px; border-top: 1px solid #F0F1F4; }
.login-api { font-size: 11px; color: var(--text-3); line-height: 1.55; }
.login-api.ok { color: #3C8A55; }
.login-api.bad { color: #C8102E; }
.bind-back {
  font-size: 13px; color: var(--text-3); font-weight: 600; margin-bottom: 16px;
}
.bind-back:hover { color: var(--text); }
.sms-row { display: flex; gap: 10px; align-items: flex-start; }
.sms-row .field { flex: 1; margin-bottom: 14px; }
.sms-btn {
  height: 52px; padding: 0 14px; margin-top: 0; flex-shrink: 0;
  border: 1px solid #E8D0D4; color: var(--brand); background: var(--brand-weak);
  border-radius: 10px; font-size: 13px; font-weight: 650;
  transition: background .2s, border-color .2s;
}
.sms-btn:hover:not(:disabled) { background: #F3DCE0; }
.sms-btn:disabled {
  color: var(--text-3); border-color: var(--border); background: #F2F3F5; cursor: not-allowed;
}
.bind-hint { margin-top: 4px; font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* ===== 顶栏 ===== */
.header {
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: var(--max); margin: 0 auto; height: 100%;
  padding: 0 24px; display: flex; align-items: center; gap: 28px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo img { height: 22px; width: auto; max-width: 40px; }
.logo-text .t1 { font-size: 15px; font-weight: 700; letter-spacing: .4px; line-height: 1.2; }
.logo-text .t2 { font-size: 10px; color: var(--text-3); letter-spacing: 1.4px; margin-top: 1px; }

.nav { display: flex; gap: 2px; flex: 1; }
.nav button {
  height: 32px; padding: 0 14px; font-size: 14px; color: var(--text-2); font-weight: 500;
  border-bottom: 2px solid transparent; border-radius: 0;
}
.nav button:hover { color: var(--text); }
.nav button.active { color: var(--brand); border-bottom-color: var(--brand); }

.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.search-box { position: relative; }
.search-box svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.search-box input {
  width: 220px; height: 34px; padding: 0 12px 0 32px;
  background: var(--bg); border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: 13px; color: var(--text);
}
.search-box input:focus { outline: none; background: #fff; border-color: var(--brand); }
.search-box input::placeholder { color: var(--text-3); }

.user { display: none; align-items: center; gap: 8px; position: relative; cursor: pointer; }
.user-avatar {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.user-name { font-size: 13px; color: var(--text-2); }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-md); padding: 4px; min-width: 148px; display: none; z-index: 20;
}
.user-menu.open { display: block; }
.user-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--text-2); text-align: left;
}
.user-menu button:hover { background: var(--bg); color: var(--text); }
.user-menu button.danger { color: var(--brand); }

/* ===== 页面 ===== */
.page { max-width: var(--max); margin: 0 auto; padding: 24px 24px 80px; }
.welcome {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 20px; gap: 16px;
}
.welcome h1 { font-size: 22px; font-weight: 700; letter-spacing: .2px; }
.welcome h1 em { font-style: normal; color: var(--brand); }
.welcome p { margin-top: 4px; font-size: 13px; color: var(--text-3); }
.welcome-date { font-size: 13px; color: var(--text-2); text-align: right; }
.welcome-date b { display: block; font-size: 15px; color: var(--text); font-weight: 600; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .label { font-size: 12px; color: var(--text-3); }
.stat .value { font-size: 26px; font-weight: 700; line-height: 1.2; margin-top: 4px; letter-spacing: -0.5px; }
.stat .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.panel-head {
  min-height: 48px; padding: 10px 18px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.page-search { display: none; width: 100%; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 13px; }
.panel-head h2 { font-size: 15px; font-weight: 600; }
.panel-head .count {
  font-size: 12px; color: var(--text-3); background: var(--bg);
  padding: 1px 7px; border-radius: var(--r-sm);
}
.panel-head .grow { flex: 1; }
.panel-hint { margin-left: 8px; font-size: 12px; color: var(--text-3); font-weight: 400; }

.quick-flow { display: flex; flex-direction: column; gap: 16px; }
.flow-group + .flow-group { padding-top: 4px; }
.flow-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.flow-name { font-size: 13px; font-weight: 600; color: var(--text); }
.flow-hint { font-size: 12px; color: var(--text-3); }
.qstep {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--qc, var(--brand)); background: var(--brand-weak, #fde8ea);
}
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs button {
  height: 28px; padding: 0 10px; font-size: 13px; color: var(--text-2); border-radius: var(--r-sm);
}
.tabs button:hover { background: var(--bg); color: var(--text); }
.tabs button.active { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.panel-body { padding: 16px 18px; }

/* 常用应用：横向条，不是居中圆图标 */
.quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.quick-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r);
  background: #fff; text-align: left; min-height: 68px;
  transition: border-color .15s, box-shadow .15s;
}
.quick-item:hover { border-color: var(--qc, var(--brand)); box-shadow: var(--shadow); }
.qicon {
  width: 36px; height: 36px; border-radius: var(--r-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.qmeta { min-width: 0; }
.qname { font-size: 14px; font-weight: 600; }
.qsub { font-size: 12px; color: var(--text-3); margin-top: 1px; }

/* 系统卡片：左对齐信息卡 */
.sys-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.sys-card {
  border: 1px solid var(--border); border-radius: var(--r); background: #fff;
  display: flex; flex-direction: column; position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.sys-card:hover { border-color: var(--sc, var(--border-strong)); box-shadow: var(--shadow); }
.sys-card.hidden { display: none; }
.sys-main {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; text-align: left; flex: 1;
}
.sys-top { display: flex; align-items: center; gap: 10px; }
.sys-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sname {
  font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.ssub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.sdesc {
  font-size: 13px; color: var(--text-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sfoot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-3);
}
.sfoot .go { color: var(--sc, var(--brand)); font-weight: 500; }
.sbadge {
  font-size: 10px; padding: 0 5px; height: 16px; line-height: 16px;
  border-radius: 2px; font-weight: 700; letter-spacing: .3px;
}
.badge-ai { background: #EDE9FE; color: #5B21B6; }
.badge-3d { background: #FEF3C7; color: #B45309; }
.badge-new { background: #DCFCE7; color: #15803D; }
.badge-hot { background: #FEE2E2; color: #B91C1C; }

.sys-ends {
  display: none; border-top: 1px solid var(--border); padding: 6px;
  background: #FAFBFC;
}
.sys-card.open .sys-ends { display: block; }
.sys-ends a,
.sys-ends button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--text-2); text-align: left;
}
.sys-ends a:hover,
.sys-ends button:hover { background: #fff; color: var(--text); }

.empty {
  display: none; text-align: center; padding: 36px 12px; color: var(--text-3); font-size: 13px;
}
.empty.show { display: block; }

.footer {
  max-width: var(--max); margin: 0 auto; padding: 8px 24px 32px;
  text-align: center; color: var(--text-3); font-size: 12px;
}
.footer .links { display: flex; justify-content: center; gap: 20px; margin-bottom: 8px; }

/* 知识库弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(26, 35, 50, .45); z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.modal-mask.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--r); width: 90vw; max-width: 880px;
  height: 82vh; max-height: 760px; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 16px 48px rgba(26, 35, 50, .2);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 52px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-title small { font-size: 11px; color: var(--text-3); font-weight: 400; }
.modal-close {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  color: var(--text-3); font-size: 18px;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { flex: 1; position: relative; background: #F7F8FA; }
.modal-body iframe { width: 100%; height: 100%; border: 0; }
.modal-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; color: var(--text-3); font-size: 13px;
}
.spinner {
  width: 28px; height: 28px; border: 2px solid var(--border);
  border-top-color: var(--brand); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.modal-foot {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-3); background: #FAFBFC;
}
.modal-foot a { color: var(--brand); }

/* 鸿声提需求：右下角悬浮入口，点击跳转鸿声系统 */
.issue-dock {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  height: 44px; padding: 0 16px;
  background: linear-gradient(135deg, #5B4B8A 0%, #4A3D72 100%); color: #fff;
  border: none; border-radius: 10px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 18px rgba(91, 75, 138, .35); font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.issue-dock:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(91, 75, 138, .45); }
.issue-dock .tag {
  font-size: 10px; background: rgba(255, 255, 255, .22); padding: 1px 6px; border-radius: 4px; font-weight: 700;
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 1100px) {
  .quick-grid, .sys-grid { grid-template-columns: repeat(2, 1fr); }
  .login-brand { padding: 36px 40px; }
  .login-brand h1 { font-size: 32px; }
  .login-panel { width: 440px; max-width: 48vw; padding: 28px; }
  .login-card { padding: 28px 24px 18px; }
}
@media (max-width: 800px) {
  .login-mask { flex-direction: column; }
  .login-brand { flex: none; padding: 28px 20px 24px; }
  .login-brand h1 { font-size: 26px; }
  .brand-copy { margin: 28px 0 24px; }
  .login-brand .brand-meta { margin-top: 0; }
  .login-panel { width: 100%; max-width: none; padding: 16px 16px 28px; align-items: flex-start; }
  .header-inner { padding: 0 14px; gap: 12px; }
  .nav { overflow-x: auto; }
  .nav button { white-space: nowrap; }
  .search-box { display: none; }
  .page-search { display: block; margin-bottom: 4px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .logo-text .t2, .user-name { display: none; }
  .page { padding: 16px 14px 88px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .welcome { flex-direction: column; align-items: flex-start; }
  .welcome-date { text-align: left; }
  .sys-grid { grid-template-columns: 1fr; }
  .tabs { width: 100%; overflow-x: auto; }
  .modal { width: 100vw; height: 100vh; max-height: none; border-radius: 0; }
}
@media (max-width: 360px) {
  .stats { grid-template-columns: 1fr; }
  .logo-text .t1 { display: none; }
}
