.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== 按钮 ===== */
.btn { display: inline-block; padding: 12px 28px; border-radius: 8px; font-size: 15px; cursor: pointer; border: none; transition: all .2s; }
.btn-primary { background: var(--cta); color: #fff; box-shadow: 0 4px 14px rgba(255,138,0,.35); }
.btn-primary:hover { background: #f07c00; color: #fff; transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.25); color: #fff; }
.btn-lg { padding: 14px 40px; font-size: 16px; }

/* ===== 头部 ===== */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 20px; font-weight: 700; color: var(--brand-dark); letter-spacing: .5px; }
.logo:hover { color: var(--brand); }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { color: var(--text-body); font-size: 14px; }
.nav a:hover { color: var(--brand); }
.nav .btn-cta { background: var(--cta); color: #fff; padding: 8px 20px; border-radius: 8px; font-weight: 600; }
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--brand-dark); }

/* ===== 登录入口（测试账号常驻下方） ===== */
.nav-login { display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.nav-login .nl-main { font-size: 14px; color: var(--text-body); }
.nav-login .nl-main:hover { color: var(--brand); }
.nav-login .nl-test { font-size: 11px; color: var(--brand); background: #eef4ff; padding: 1px 8px; border-radius: 10px; line-height: 1.6; white-space: nowrap; }
.nav-login .nl-test:hover { background: #dbe7ff; color: var(--brand); }

/* ===== 页脚 ===== */
.site-footer { background: var(--brand-dark); color: #cbd5e1; padding: 48px 0; margin-top: 0; text-align: center; }
.site-footer a { color: #cbd5e1; }
.footer-name { font-size: 17px; color: #fff; font-weight: 600; }
.footer-copy, .footer-beian, .footer-phone { font-size: 13px; margin: 6px 0; opacity: .8; }

/* ===== Hero ===== */
.hero { background: linear-gradient(135deg, #0A2A52 0%, #1356C2 60%, #1b6bd6 100%); color: #fff; padding: 90px 0 70px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -100px; right: -100px; width: 400px; height: 400px; border-radius: 50%; background: rgba(0,180,216,.12); }
.hero::after { content: ''; position: absolute; bottom: -150px; left: -100px; width: 400px; height: 400px; border-radius: 50%; background: rgba(255,255,255,.05); }
.hero .container { position: relative; z-index: 1; }
.hero-tag { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); padding: 6px 18px; border-radius: 20px; font-size: 13px; margin-bottom: 20px; }
.hero h1 { color: #fff; font-size: 42px; line-height: 1.3; margin: 0 0 16px; font-weight: 700; }
.hero-sub { font-size: 17px; opacity: .9; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; margin-bottom: 50px; }
.hero-stats { display: flex; justify-content: center; gap: 60px; flex-wrap: wrap; }
.hstat b { display: block; font-size: 30px; font-weight: 700; color: #fff; }
.hstat span { font-size: 13px; opacity: .8; }

/* ===== 区块通用 ===== */
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: 30px; margin: 0 0 10px; }
.section-head p { color: var(--text-muted); font-size: 15px; margin: 0; }

/* ===== 服务 ===== */
.services { padding: 70px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card { background: #fff; border-radius: 14px; padding: 32px 28px; box-shadow: 0 2px 12px rgba(0,0,0,.06); transition: all .25s; }
.service-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(19,86,194,.15); }
.s-icon { font-size: 34px; margin-bottom: 16px; }
.service-card h3 { font-size: 18px; margin: 0 0 8px; }
.service-card p { color: var(--text-muted); font-size: 14px; margin: 0; line-height: 1.7; }

/* ===== 优势 ===== */
.feature { padding: 70px 0; background: var(--bg-page); }
.feature-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 50px; align-items: center; }
.feature-text h2 { font-size: 30px; margin: 0 0 24px; }
.feature-text ul { list-style: none; padding: 0; margin: 0 0 28px; }
.feature-text li { padding: 10px 0; font-size: 15px; color: var(--text-body); }
.feature-text li b { color: var(--text-title); }
.feature-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fcard { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.fcard b { display: block; font-size: 16px; color: var(--brand); margin-bottom: 6px; }
.fcard p { color: var(--text-muted); font-size: 13px; margin: 0; }

/* ===== 流程 ===== */
.process { padding: 70px 0; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { text-align: center; padding: 28px 20px; }
.step-num { width: 56px; height: 56px; line-height: 56px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 22px; font-weight: 700; margin: 0 auto 16px; }
.step h3 { font-size: 17px; margin: 0 0 8px; }
.step p { color: var(--text-muted); font-size: 13px; margin: 0; }

/* ===== CTA ===== */
.cta { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; text-align: center; padding: 70px 0; }
.cta h2 { color: #fff; font-size: 30px; margin: 0 0 12px; }
.cta p { opacity: .85; margin: 0 0 28px; font-size: 15px; }

/* ===== 登录/注册 ===== */
.auth-wrap { display: flex; justify-content: center; padding: 60px 16px; min-height: 70vh; align-items: flex-start; }
.auth-card { background: #fff; width: 100%; max-width: 410px; border-radius: 14px; padding: 36px; box-shadow: 0 10px 40px rgba(0,0,0,.1); }
.auth-card h2 { text-align: center; margin: 0 0 28px; font-size: 22px; }
.auth-link { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.code-row { display: flex; gap: 8px; }
.code-row .layui-input { flex: 1; }
.code-row .layui-btn { white-space: nowrap; }
.captcha-row { display: flex; gap: 8px; }
.captcha-row .layui-input { flex: 1; }
.captcha-row img { height: 38px; border-radius: 4px; cursor: pointer; border: 1px solid #e5e7eb; }

/* ===== 门户 ===== */
.portal, .admin { display: flex; min-height: 100vh; }
.sidebar, .admin-sidebar { width: 210px; background: var(--brand-dark); color: #cbd5e1; flex-shrink: 0; }
.sidebar-sales { background: #103a5c; }
.sidebar-logo { padding: 18px 18px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.logo-text { font-size: 16px; font-weight: 700; color: #fff; }
.logo-img { height: 36px; display: block; }
.sidebar-logo-img { height: 34px; max-width: 140px; object-fit: contain; display: block; }
.sidebar-nav { display: flex; flex-direction: column; padding: 8px 0; }
.sidebar-nav a { color: #cbd5e1; padding: 12px 20px; font-size: 14px; display: flex; align-items: center; gap: 10px; position: relative; transition: all .15s; }
.sidebar-nav a .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.sidebar-nav a.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--cta); }
.portal-main, .admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #fff; height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-title); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-info { line-height: 1.25; }
.topbar-name { font-size: 14px; font-weight: 600; color: var(--text-title); }
.topbar-role { font-size: 12px; color: var(--text-muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: #fff; flex-shrink: 0; }
.avatar-admin { background: linear-gradient(135deg, #1356C2, #0A2A52); }
.avatar-sales { background: linear-gradient(135deg, #FF8A00, #e87800); }
.avatar-user { background: linear-gradient(135deg, #00B4D8, #1356C2); }
.btn-logout { padding: 7px 16px; border-radius: 8px; font-size: 13px; border: 1px solid var(--border); color: var(--text-body); background: #fff; cursor: pointer; transition: all .2s; }
.btn-logout:hover { color: var(--danger); border-color: var(--danger); background: #fef2f2; }
.portal-content, .admin-content { padding: 22px; flex: 1; }
.admin-sidebar { background: var(--brand-dark); }

/* ===== 统计卡 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.05); display: flex; align-items: center; gap: 14px; transition: all .2s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-body { min-width: 0; }
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--text-title); line-height: 1.2; }
.stat-card .label { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.c-blue { background: #eef4ff; color: #1356C2; }
.c-purple { background: #f3eeff; color: #7c3aed; }
.c-cyan { background: #e6f9fd; color: #0891b2; }
.c-amber { background: #fff7e6; color: #d97706; }
.c-green { background: #ecfdf3; color: #16a34a; }
.c-orange { background: #fff1e6; color: #ea580c; }
.c-pink { background: #fdeef4; color: #db2777; }
.c-indigo { background: #eef2ff; color: #4f46e5; }

/* ===== 欢迎区 + 快捷操作 ===== */
.welcome { background: linear-gradient(135deg, #fff, #f0f5ff); border-radius: 14px; padding: 22px 26px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.04); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.welcome-text h2 { font-size: 20px; margin: 0 0 4px; }
.welcome-text p { color: var(--text-muted); margin: 0; font-size: 13px; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-actions a { padding: 9px 16px; border-radius: 8px; font-size: 13px; background: var(--brand); color: #fff; transition: all .2s; }
.quick-actions a:hover { background: #0f4aa8; color: #fff; transform: translateY(-1px); }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.tag-green { background: #ecfdf3; color: #16a34a; }
.tag-amber { background: #fff7e6; color: #d97706; }
.tag-red { background: #fef2f2; color: #dc2626; }
.tag-gray { background: #f3f4f6; color: #6b7280; }
.tag-blue { background: #eef4ff; color: #1356C2; }

/* ===== Layui 组件全局美化（应用到所有子页面） ===== */
.layui-card { border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.05); border: none; margin-bottom: 16px; }
.layui-card-header { border-radius: 12px 12px 0 0; }
.layui-card-header { background: #fff; font-weight: 600; font-size: 15px; color: var(--text-title); border-bottom: 1px solid var(--border); height: auto; line-height: 1.5; padding: 14px 20px; }
.layui-card-body { padding: 20px; }
.layui-table { border-radius: 8px; }
.layui-table th { background: #f8fafc; color: var(--text-title); font-weight: 600; }
.layui-table tr:hover td { background: #fafbfc; }
.layui-btn { border-radius: 6px; }
.layui-form-item { margin-bottom: 18px; }
.layui-input, .layui-textarea { border-radius: 6px; }
.layui-input:focus, .layui-textarea:focus { border-color: var(--brand) !important; }
.layui-layer { border-radius: 12px; }
.form-group-title { font-size: 13px; font-weight: 700; color: var(--brand); padding: 12px 0 8px; border-bottom: 1px solid #eef0f3; margin: 6px 0 16px; }

/* 表单输入框宽度（按内容调整，避免统一等宽） */
.input-w-xs { max-width: 110px; }
.input-w-sm { max-width: 200px; }
.input-w-md { max-width: 320px; }
.input-w-lg { max-width: 520px; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.7; }
.field-hint a { color: var(--brand); }
.field-hint .hint-tag { display: inline-block; background: #eef4ff; color: #1356C2; border-radius: 3px; padding: 0 6px; font-size: 11px; margin-right: 6px; }
.field-tip { background: #f6f8fb; border-left: 3px solid var(--brand); border-radius: 4px; padding: 10px 14px; font-size: 12px; color: var(--text-body); line-height: 1.7; margin-bottom: 16px; }

/* 配置页表单：加宽标签列，避免标签换行（把空间让到右边输入区） */
.form-config .layui-form-label { width: 160px; }
.form-config .layui-input-block { margin-left: 190px; }
.form-config .layui-form-select { width: 190px; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); padding: 14px 20px; gap: 14px; box-shadow: 0 8px 20px rgba(0,0,0,.1); }
  .nav.open { display: flex; }
  .nav-login { align-items: flex-start; }
  .nav-login .nl-test { margin-top: 2px; }
  .grid-3 { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .sidebar, .admin-sidebar { width: 100%; }
  .portal, .admin { flex-direction: column; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .hero h1 { font-size: 28px; }
  .hero-stats { gap: 28px; }
}

/* ============================================================
   全局移动端响应式适配（PC + 手机自动兼容）
   ============================================================ */
@media (max-width: 768px) {
  /* layer 弹窗宽度自适应 */
  .layui-layer-page,
  .layui-layer-iframe {
    width: 94% !important;
    max-width: 94vw !important;
    margin-left: -47% !important;
    border-radius: 12px;
  }
  .layui-layer-page .layui-layer-content { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 按钮触控尺寸加大 */
  .layui-btn { min-height: 42px; padding: 0 18px; font-size: 14px; }
  .layui-btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }

  /* 顶部栏 */
  .topbar { padding: 0 14px; height: 56px; }
  .topbar-title { font-size: 15px; }

  /* 内容区内边距 */
  .portal-content, .admin-content { padding: 14px; }

  /* 统计卡间距 */
  .stat-cards { gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .num { font-size: 20px; }

  /* 欢迎区与快捷操作 */
  .welcome { padding: 16px; }
  .welcome-text h2 { font-size: 17px; }
  .quick-actions a { padding: 10px 14px; font-size: 12px; }

  /* 侧边栏移动端紧凑 */
  .sidebar-logo, .admin-sidebar .sidebar-logo { padding: 12px 16px; }
  .sidebar-nav a { padding: 10px 14px; font-size: 13px; }
  .sidebar-nav { padding: 6px 0; }
  .sidebar-nav a { flex: 0 0 auto; white-space: nowrap; }

  /* layui 表格容器圆角/阴影保留，横向滚动依赖 .layui-table 容器 */
  .layui-table-view { border-radius: 8px; }

  /* 弹窗内按钮铺满（可选，便于触控） */
  .layui-layer-page .layui-layer-btn a { min-height: 40px; line-height: 40px; padding: 0 18px; }

  /* layui 表单 label 改纵向（手机端上下布局） */
  .layui-form-item .layui-form-label {
    float: none !important;
    display: block !important;
    width: auto !important;
    text-align: left !important;
    padding: 0 0 6px !important;
    line-height: 1.4 !important;
  }
  .layui-form-item .layui-input-block,
  .layui-form-item .layui-input-inline {
    margin-left: 0 !important;
  }
  .layui-form-item .layui-input-inline {
    display: block;
    width: 100% !important;
    margin-bottom: 8px;
  }
  .form-config .layui-form-label { width: auto !important; }
  .form-config .layui-input-block { margin-left: 0 !important; }

  /* 内联固定宽度 input 移动端全宽（搜索/筛选栏等） */
  .layui-input[style*="inline-block"],
  .layui-input[style*="width:"] {
    display: block !important;
    width: 100% !important;
    margin-bottom: 8px;
    box-sizing: border-box;
  }
}

/* ============================================================
   内联表单（员工管理添加行等）
   ============================================================ */
.staff-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.staff-add .layui-input { width: 150px; flex: 0 0 auto; }
@media (max-width: 768px) {
  .staff-add .layui-input { width: 100%; flex: 1 1 100%; }
  .staff-add .layui-btn { width: 100%; }
}

/* ============================================================
   通用两栏栅格（财务总览等，移动端自动单列）
   ============================================================ */
.fin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.fin-grid-16 { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 768px) {
  .fin-grid, .fin-grid-16 { grid-template-columns: 1fr; }
}
