* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
       background: #f4f6f9; color: #24303f; font-size: 14px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: #1f2d3d; color: #cfd8e3; padding: 18px 0;
           flex-shrink: 0; display: flex; flex-direction: column; }
.logo { font-size: 16px; font-weight: 600; color: #fff; padding: 0 18px 10px; }
.who { font-size: 12px; color: #8fa3b8; padding: 0 18px 14px;
       border-bottom: 1px solid #2e4157; margin-bottom: 10px; }
.sidebar .group { font-size: 12px; color: #74889e; padding: 12px 18px 4px; }
.sidebar a { display: block; color: #cfd8e3; text-decoration: none;
             padding: 8px 18px; font-size: 13px; border-left: 3px solid transparent; }
.sidebar a:hover { background: #2a3b4f; }
.sidebar a.active { background: #2a3b4f; border-left-color: #3b82f6; color: #fff; }
.sidebar .logout { margin-top: auto; color: #f87171; }
.main { flex: 1; padding: 24px 28px; overflow-x: auto; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column;
              align-items: center; justify-content: center; }
.login-card { background: #fff; padding: 36px 40px; border-radius: 10px;
              box-shadow: 0 6px 24px rgba(31,45,61,.12); width: 340px; }
.login-card h2 { text-align: center; margin-bottom: 6px; }
.login-card .tip { color: #8a97a6; font-size: 12px; text-align: center;
                   margin-bottom: 20px; }
.login-card input { width: 100%; padding: 10px 12px; margin-bottom: 12px;
                    border: 1px solid #d5dde5; border-radius: 6px; font-size: 14px; }
.login-card button { width: 100%; padding: 10px; background: #2563eb; color: #fff;
                     border: none; border-radius: 6px; font-size: 15px; cursor: pointer; }
.login-card button:hover { background: #1d4ed8; }

/* 通用组件 */
.page-head { display: flex; justify-content: space-between; align-items: center;
             margin-bottom: 16px; }
.page-head h2 { font-size: 18px; }
.btn { display: inline-block; background: #2563eb; color: #fff; border: none;
       border-radius: 6px; padding: 7px 14px; font-size: 13px; cursor: pointer;
       text-decoration: none; }
.btn:hover { background: #1d4ed8; }
.btn.ghost { background: #fff; color: #2563eb; border: 1px solid #bcd0f7; }
.btn.ghost:hover { background: #eef4ff; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }
.btn.sm { padding: 4px 10px; font-size: 12px; }

table { width: 100%; background: #fff; border-collapse: collapse;
        border-radius: 8px; overflow: hidden;
        box-shadow: 0 1px 4px rgba(31,45,61,.08); }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #eef1f5;
         white-space: nowrap; max-width: 320px; overflow: hidden;
         text-overflow: ellipsis; }
th { background: #f8fafc; font-weight: 600; color: #4b5a6b; font-size: 13px; }
tr:hover td { background: #fafcff; }
.dim { color: #97a3b1; font-size: 12px; }
.empty { text-align: center; color: #97a3b1; padding: 32px 0 !important; }
.ops { display: flex; gap: 6px; align-items: center; }
.ops form { display: inline; }

.form-card { background: #fff; padding: 20px 24px; border-radius: 8px;
             box-shadow: 0 1px 4px rgba(31,45,61,.08); margin-bottom: 20px; }
.form-card h3 { font-size: 15px; margin-bottom: 12px; }
.form-card label { display: block; margin-bottom: 12px; }
.form-card label span { display: block; font-size: 13px; color: #4b5a6b;
                        margin-bottom: 4px; }
.form-card label em { color: #dc2626; font-style: normal; }
.form-card input, .form-card select, .form-card textarea {
  width: 100%; max-width: 560px; padding: 8px 10px; border: 1px solid #d5dde5;
  border-radius: 6px; font-size: 13px; font-family: inherit; }
.inline-form { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.inline-form input, .inline-form select { width: auto; min-width: 180px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px;
         font-size: 13px; }
.flash.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.flash.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.tag { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag.ok { background: #d1fae5; color: #047857; }
.tag.off { background: #e5e7eb; color: #6b7280; }
.panic-card { border: 1px solid #fecaca; background: #fffafa; }
.panic-card code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
                   font-size: 12px; }
.ops form.inline { display: inline; }


/* 批量导入 */
.import-form { display: flex; gap: 12px; align-items: center; margin: 10px 0 4px;
               flex-wrap: wrap; }
.import-form input[type=file] { max-width: 420px; padding: 6px;
  border: 1px dashed #c7d2de; border-radius: 6px; background: #fbfdff; }
.rules { margin: 6px 0 12px 18px; font-size: 13px; color: #4b5a6b; line-height: 2; }
.rules code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; }
.stat-row { display: flex; gap: 12px; margin-bottom: 14px; }
.stat { flex: 0 0 140px; background: #fff; border: 1px solid #e6ecf2;
        border-radius: 8px; padding: 12px 16px; }
.stat b { display: block; font-size: 22px; color: #1f2d3d; }
.stat span { font-size: 12px; color: #7c8b9c; }
.stat.ok b { color: #047857; }
.stat.bad b { color: #b91c1c; }
tr.row-bad td { background: #fffafa; }
.err-list { margin: 8px 0 0 16px; font-size: 12px; line-height: 1.9;
            max-height: 220px; overflow: auto; }
.err-list li { color: #b91c1c; }

/* ===== UI 优化：登录页（重做） ===== */
/* 背景加柔和渐变，登录区占满视口并垂直居中（直接设在容器上，兼容性更好） */
.login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2ff 0%, #f4f6f9 45%, #e8f0fe 100%);
}

/* 卡片：更大圆角、更柔和阴影、呼吸感留白 */
.login-card.lp {
  width: 420px; max-width: calc(100vw - 32px);
  padding: 40px 40px 30px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(30,64,120,.14), 0 2px 8px rgba(30,64,120,.06);
  border: 1px solid rgba(255,255,255,.7);
}
/* 品牌区 */
.login-card.lp .lp-brand { text-align: center; margin-bottom: 30px; }
.login-card.lp .lp-logo {
  width: 58px; height: 58px; line-height: 58px; margin: 0 auto 16px;
  font-size: 28px; border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 8px 18px rgba(37,99,235,.28);
}
.login-card.lp .lp-brand h2 {
  font-size: 20px; font-weight: 700; color: #1e293b;
  line-height: 1.45; margin-bottom: 8px;
}
.login-card.lp .lp-brand p {
  color: #8a97a6; font-size: 13px; margin-bottom: 0;
}
/* 字段 */
.login-card.lp .lp-field { margin-bottom: 18px; }
.login-card.lp .lp-field label {
  display: block; font-size: 13px; color: #475569;
  font-weight: 600; margin-bottom: 7px;
}
/* 输入框容器：相对定位，供眼睛按钮绝对定位 */
.login-card.lp .lp-input-wrap { position: relative; }
.login-card.lp .lp-ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 15px; color: #9aa7b8; line-height: 1; pointer-events: none;
}
.login-card.lp .lp-input-wrap input {
  width: 100%; height: 44px; margin: 0;
  padding: 0 44px 0 42px;
  border: 1px solid #d5dde5; border-radius: 9px;
  font-size: 14px; background: #fff; color: #24303f;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
.login-card.lp .lp-input-wrap input:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
/* 眼睛按钮：高特异性覆盖全局 .login-card button，垂直居中于密码框右侧 */
.login-card.lp .lp-input-wrap .lp-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; padding: 0; margin: 0;
  background: transparent; color: #9aa7b8;
  border: none; border-radius: 7px;
  font-size: 16px; line-height: 34px; text-align: center;
  cursor: pointer; box-shadow: none;
}
.login-card.lp .lp-input-wrap .lp-eye:hover { background: #f1f5f9; color: #2563eb; }
/* 登录按钮 */
.login-card.lp .lp-submit {
  width: 100%; height: 46px; margin-top: 6px; padding: 0;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; border: none; border-radius: 9px;
  font-size: 16px; font-weight: 600; letter-spacing: 4px;
  cursor: pointer; box-shadow: 0 6px 16px rgba(37,99,235,.28);
  transition: opacity .15s, transform .1s;
}
.login-card.lp .lp-submit:hover { opacity: .92; }
.login-card.lp .lp-submit:active { transform: translateY(1px); }
/* 底部帮助区 */
.login-card.lp .lp-foot {
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid #eef1f5;
  text-align: center; font-size: 12px; line-height: 2; color: #8a97a6;
}
.login-card.lp .lp-foot a { color: #2563eb; text-decoration: none; }
.login-card.lp .lp-foot a:hover { text-decoration: underline; }

/* ===== UI 优化：表单分组 ===== */
.form-group { border: 1px solid #e2e8f0; border-radius: 8px;
              padding: 14px 18px 4px; margin: 0 0 16px; }
.form-group legend { font-size: 14px; font-weight: 600; color: #2563eb;
                     padding: 0 8px; }
.form-group label { margin-bottom: 10px; }

/* ===== UI 优化：分页 ===== */
.pager { display: flex; justify-content: space-between; align-items: center;
         margin-top: 14px; flex-wrap: wrap; gap: 10px; }
.pager-btns { display: flex; gap: 6px; align-items: center; }
.pager-cur { display: inline-block; min-width: 30px; text-align: center;
             padding: 4px 8px; background: #2563eb; color: #fff;
             border-radius: 6px; font-size: 12px; }

/* ===== Beta-0.1.0：列表查询栏 ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end;
              background: #fff; border: 1px solid #e6ecf2; border-radius: 8px;
              padding: 14px 18px; margin-bottom: 16px;
              box-shadow: 0 1px 4px rgba(31,45,61,.06); }
.filter-bar label { display: flex; flex-direction: column; gap: 5px; }
.filter-bar label > span:first-child { font-size: 12px; color: #4b5a6b; font-weight: 600; }
.filter-bar input, .filter-bar select { padding: 7px 10px; border: 1px solid #d5dde5;
              border-radius: 6px; font-size: 13px; font-family: inherit;
              background: #fff; color: #24303f; height: 34px; }
.filter-bar input[type=text] { min-width: 200px; }
.filter-bar input[type=number] { width: 110px; }
.filter-bar input:focus, .filter-bar select:focus { outline: none;
              border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.filter-bar .range { display: inline-flex; align-items: center; gap: 6px; color: #97a3b1; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; align-self: flex-end; }
.filter-note { margin: -6px 0 12px; }
.filter-note b { color: #2563eb; }

/* 版本号标识 */
.ver-tag { margin-top: auto; padding: 10px 18px 0; border-top: 1px solid #2e4157;
           font-size: 11px; color: #64798f; user-select: none; }

/* Beta-0.2.0：用户编辑表单 */
.edit-user-form label { max-width: 560px; }
.edit-user-form label[hidden] { display: none; }
.edit-user-form select, .edit-user-form input { max-width: 560px; }

/* Beta-0.2.1：宽表格横向滚动（操作列按钮不再被裁） */
.table-scroll { overflow-x: auto; margin-bottom: 4px;
                scrollbar-color: #b8c4d1 #eef1f5; scrollbar-width: thin; }
.table-scroll table { width: max-content; min-width: 100%; overflow: visible; }
.table-scroll td, .table-scroll th { max-width: none; }
.table-scroll td.ops { white-space: nowrap; }
.table-scroll::-webkit-scrollbar { height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: #eef1f5; border-radius: 5px; }
.table-scroll::-webkit-scrollbar-thumb { background: #b8c4d1; border-radius: 5px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #8fa3b8; }
