/* ============================================================
   FFGS 反馈工单系统 - Element 风格（参考 mc-football）
   主色 #409eff，背景 #f8f9fa
   ============================================================ */

:root {
  --primary: #409eff;
  --primary-dark: #337ecc;
  --primary-light: #66b1ff;
  --primary-disabled: #a0cfff;
  --primary-bg: #ecf5ff;
  --border: #dcdfe6;
  --border-light: #ebeef5;
  --text-main: #303133;
  --text-normal: #606266;
  --text-secondary: #909399;
  --text-placeholder: #c0c4cc;
  --bg: #f8f9fa;
  --card: #ffffff;
  --success: #67c23a;
  --warning: #e6a23c;
  --danger: #f56c6c;
  --shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.7;
  font-size: 14.5px;
}

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

.container { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶栏 ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--border-light); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; color: var(--text-main); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px;
  overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand small { color: var(--text-secondary); font-weight: 400; font-size: 12px; margin-left: 6px; }
.topbar-actions a { color: var(--text-normal); font-size: 13.5px; margin-left: 18px; }
.topbar-actions a:hover { color: var(--primary); }

/* ---------- 页头 ---------- */
.page-head { padding: 24px 0 6px; }
.page-head h1 { font-size: 23px; color: var(--text-main); font-weight: 600; }
.page-head .sub { font-size: 13.5px; color: #303133; margin-top: 3px; }
.page-head .meta { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.head-chip {
  font-size: 12.5px; color: #111; background: #fff;
  border: 1px solid var(--border-light); border-radius: 4px; padding: 3px 12px;
}
.head-chip b { color: var(--primary); font-weight: 600; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 20px 22px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 16px; margin-bottom: 14px; color: var(--text-main); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card h2 .bar { width: 4px; height: 16px; border-radius: 2px; background: var(--primary); }

/* ---------- 区块标题 ---------- */
.section-title {
  font-size: 17px; font-weight: 600; color: var(--text-main); margin: 26px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px; height: 16px; border-radius: 2px; background: var(--primary);
  flex-shrink: 0;
}

/* ---------- 公告条 ---------- */
.notice {
  background: #fdf6ec; border: 1px solid #faecd8; border-left: 4px solid var(--warning);
  padding: 10px 14px; font-size: 13.5px; color: #8a6d3b; margin-bottom: 16px;
  border-radius: 4px;
}

/* ---------- 统计条 ---------- */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--border-light); border-radius: 4px;
  padding: 12px 22px; text-align: center; min-width: 110px; flex: 1;
  box-shadow: var(--shadow);
}
.stat .num { font-size: 24px; font-weight: 600; color: var(--primary); }
.stat .lbl { font-size: 12px; color: var(--text-secondary); }
.stat.ok .num { color: var(--success); }
.stat.warn .num { color: var(--warning); }

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-normal); margin-bottom: 5px; }
.form-row label .req { color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 4px; background: #fff;
  color: var(--text-main); font-family: inherit; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--text-placeholder); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2); }
select.input option { background: #fff; }
.hint { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 8px 18px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 4px; background: #fff;
  color: var(--text-normal); cursor: pointer; font-family: inherit;
  transition: all .2s; line-height: 1.5;
}
.btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-bg); }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-primary:disabled { background: var(--primary-disabled); border-color: var(--primary-disabled); cursor: not-allowed; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: #fef0f0; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 3px; }
.btn-block { width: 100%; text-align: center; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border-light); border-radius: 4px; box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border-light); text-align: left; vertical-align: top; }
.tbl th { background: #f5f7fa; font-weight: 600; color: var(--text-normal); font-size: 13px; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fafafa; }
.tbl .actions { white-space: nowrap; }
.tbl .actions .btn { margin-right: 4px; }

/* ---------- 状态徽章 ---------- */
.badge {
  display: inline-block; font-size: 12px; padding: 1px 9px; border-radius: 3px;
  white-space: nowrap;
}
.badge.pending    { background: #f4f4f5; color: #909399; }
.badge.processing { background: #ecf5ff; color: #409eff; }
.badge.resolved   { background: #f0f9eb; color: #67c23a; }
.badge.closed     { background: #f4f4f5; color: #606266; }

/* ---------- 群成员核验 ---------- */
.verify-ok   { color: var(--success); font-weight: 600; }
.verify-fail { color: var(--warning); font-weight: 600; }
.verify-none { color: var(--text-secondary); }
.verify-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ---------- 工单详情 ---------- */
.ticket-id { font-weight: 600; color: var(--primary); white-space: nowrap; }
.ticket-title { font-weight: 600; color: var(--text-main); }
.ticket-content {
  white-space: pre-wrap; word-break: break-word;
  background: #fafafa; border: 1px solid var(--border-light);
  border-radius: 4px; padding: 8px 10px; font-size: 13px; margin-top: 6px;
}
details.ticket-detail summary { cursor: pointer; color: var(--primary); font-size: 12.5px; user-select: none; }
details.ticket-detail summary:hover { color: var(--primary-dark); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: #909399; padding: 26px 0; font-size: 13.5px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 68px; right: 16px; z-index: 999; }
.toast {
  background: #fff; color: var(--text-main); padding: 10px 16px; border-radius: 4px;
  font-size: 13.5px; margin-bottom: 8px; border: 1px solid var(--border-light);
  box-shadow: var(--shadow); animation: fadeIn .2s;
}
.toast.ok { border-left: 3px solid var(--success); }
.toast.err { border-left: 3px solid var(--danger); color: var(--danger); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; } }

/* ---------- 登录 ---------- */
.auth-box {
  max-width: 400px; margin: 60px auto; background: #fff;
  border: 1px solid var(--border-light); border-radius: 8px; padding: 26px 30px;
  box-shadow: var(--shadow);
}
.auth-title { font-size: 17px; font-weight: 600; text-align: center; margin-bottom: 18px; }

/* ---------- 筛选栏 ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar .input { width: auto; min-width: 180px; flex: 1; }
.filter-bar select.input { width: auto; }

/* ---------- 成功页 ---------- */
.success-box { text-align: center; padding: 30px 0 10px; }
.success-box .icon { font-size: 52px; }
.success-box h2 { margin: 12px 0 8px; font-size: 19px; }
.success-box .tno {
  display: inline-block; background: var(--primary-bg); color: var(--primary);
  font-weight: 700; font-size: 15px; padding: 4px 18px; border-radius: 4px; margin: 6px 0;
}

/* ---------- 页脚 ---------- */
.footer {
  text-align: center; color: var(--text-secondary); font-size: 12.5px; padding: 24px 16px 32px;
  border-top: 1px solid var(--border-light); margin-top: 24px;
}
