/* ============================================================
   components.css — 面板、表单、表格、Toast、登录页、响应式
   ============================================================ */

/* ---------- 通用面板 ---------- */
.panel {
  margin-top: 14px;
  background: var(--panel);
  border: 1px solid #e8ecf1;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* ---------- 表单网格 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.form-grid h3 {
  margin: 0 0 4px;
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #244261;
}

.full { grid-column: 1 / -1; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; }

th, td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 8px;
  vertical-align: top;
}

th { background: #f4f8fd; }

/* ---------- 列表 ---------- */
.list { margin: 0; padding-left: 18px; }
.list li { margin: 8px 0; }
.list .warn { color: var(--danger); }
.list .ok { color: #2e7d32; }

/* ---------- 预警相关 ---------- */
.warn-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  flex-wrap: wrap;
}

.warn-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.warn-status-select {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.warn-opinion-input {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 160px;
}

.warn-process-btn {
  padding: 4px 12px;
  font-size: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.warn-process-btn:hover { background: #0a4a8a; }

/* ---------- 上传提示 ---------- */
.upload-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* ---------- 筛选网格 ---------- */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  align-items: end;
}

/* ---------- 行内操作按钮 ---------- */
.inline-actions { display: flex; gap: 6px; }
.inline-actions button { padding: 4px 8px; font-size: 12px; }

/* ---------- Toast 消息 ---------- */
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-width: 200px;
  max-width: 420px;
  background: #0f1720;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 30;
}

.toast.show { opacity: 0.95; }

/* ---------- 登录遮罩 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: #0a3e70 url("/image/login.jpg") center/cover no-repeat;
  z-index: 20;
  overflow: hidden;
}

.overlay.show { display: flex; }

.login-wrapper {
  position: relative;
  z-index: 1;
  width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-header {
  position: absolute;
  top: 13vh; left: 0;
  width: 100vw;
  text-align: center;
  color: #fff;
  pointer-events: none;
  z-index: 1;
}

.login-header h1 {
  font-family: "Noto Serif SC", "STZhongsong", "SimSun", serif;
  font-size: 64px;
  font-weight: 900;
  line-height: 90px;
  letter-spacing: 16px;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0,0,0,0.5);
  white-space: nowrap;
}

.login-box {
  width: 700px;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  overflow: hidden;
}

.login-card {
  width: 100%;
  background: #fff;
  border-radius: 0 0 4px 4px;
  padding: 25px 25px 30px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.login-card-tip {
  margin: 18px 0 0;
  text-align: center;
  color: #909399;
  font-size: 14px;
  cursor: pointer;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #f3f3f3;
}

.login-tabs button {
  padding: 13px 0;
  font-size: 18px;
  background: #f3f3f3;
  color: #333;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 400;
  line-height: 22px;
}

.login-tabs button:first-child { border-right: 1px solid #dcdfe6; }
.login-tabs button.active { background: #fff; color: #333; font-weight: 500; }

.login-mode { display: none; flex-direction: column; gap: 18px; }
.login-mode.active { display: flex; }

/* ---------- 输入组 ---------- */
.input-group {
  display: flex;
  align-items: center;
  border: 1px solid #d0dbe8;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.input-group:focus-within {
  border-color: #0b5cab;
  box-shadow: 0 0 0 3px rgba(11,92,171,0.08);
}

.input-icon {
  padding: 0 16px;
  font-size: 16px;
  color: #606266;
  background: #f5f7fa;
  line-height: 50px;
  border-right: 1px solid #dcdfe6;
  font-weight: 400;
  min-width: 56px;
  text-align: center;
}

.input-group input {
  flex: 1;
  border: none;
  border-radius: 0;
  padding: 0 15px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #333;
  line-height: 48px;
}

.input-group input[type="password"]::-ms-reveal,
.input-group input[type="password"]::-ms-clear,
.input-group input[type="password"]::-webkit-credentials-auto-fill-button { display: none; }

.input-group input::placeholder { color: #b0bec5; }

.pwd-toggle {
  display: flex; align-items: center;
  padding: 0 14px;
  cursor: pointer;
  line-height: 50px;
  user-select: none;
  transition: opacity 0.2s;
}

.pwd-toggle:hover { opacity: 0.7; }

.login-links { display: flex; justify-content: space-between; align-items: center; }
.login-hint { font-size: 14px; color: #8899aa; }
.forgot-link { font-size: 14px; color: #0b5cab; text-decoration: none; cursor: pointer; }
.forgot-link:hover { text-decoration: underline; }
.sms-hint { margin: 0; font-size: 13px; color: #8899aa; text-align: center; }

.sms-group { gap: 0; }
.sms-group input { flex: 1; }

.sms-btn {
  flex-shrink: 0;
  padding: 12px 14px;
  font-size: 13px;
  background: #0b5cab;
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.sms-btn:hover { background: #0a4e94; }
.sms-btn:disabled { background: #ccc; cursor: not-allowed; }

.login-submit {
  width: 100%;
  padding: 0;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 8px;
  background: #64afd1;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 54px;
  margin-top: 20px;
}

.login-submit:hover { background: #559bc0; }

.login-copyright {
  position: absolute;
  bottom: 40px; left: 0;
  width: 100%;
  text-align: center;
  font-size: 14px;
  z-index: 2;
}

.login-copyright p {
  margin: 0;
  color: rgba(255,255,255,0.8);
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(0,0,0,0.65), 0 0 4px rgba(0,0,0,0.5);
}

/* ---------- 角色禁用态 ---------- */
.role-disabled { opacity: 0.55; pointer-events: none; }

/* ==================== 响应式 ==================== */

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    flex-direction: row; flex-wrap: wrap; gap: 0;
    padding: 4px 0; overflow-x: auto;
  }
  .sidebar-head { display: none; }
  .sidebar .nav-btn {
    width: auto; padding: 8px 12px; font-size: 12px;
    border-left: none; border-bottom: 2px solid transparent; white-space: nowrap;
  }
  .sidebar .nav-btn.active { border-left-color: transparent; border-bottom-color: #4da3ff; }
  .topbar-nav { flex-wrap: wrap; gap: 10px; }
  .oval-btn { padding: 6px 16px; font-size: 13px; }
  .topbar-title-row h1 { font-size: 26px; letter-spacing: 4px; }
  .stat-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid, .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .topbar-row1 { flex-direction: column; gap: 10px; padding: 10px 16px 0; }
  .topbar-title-row h1 { font-size: 20px; letter-spacing: 2px; }
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
