:root {
  --primary: #409eff;
  --primary-hover: #66b1ff;
  --sidebar: #304156;
  --sidebar-active: #409eff;
  --header-h: 50px;
  --footer-h: 48px;
  --text: #303133;
  --muted: #909399;
  --border: #ebeef5;
  --page-bg: #f0f2f5;
  --danger: #f56c6c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--page-bg);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== 公共页脚 ===== */
.site-footer {
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #909399;
  font-size: 13px;
  background: transparent;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-split {
  color: #c0c4cc;
}

.site-footer a {
  color: #606266;
}

/* ===== 登录页 ===== */
.login-body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 45%, #1c7ed6 100%);
  position: relative;
  overflow: hidden;
}

.login-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08) 0, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0, transparent 35%);
  pointer-events: none;
}

.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 24px 16px 0;
}

.login-card {
  width: 400px;
  max-width: 100%;
  background: #fff;
  border-radius: 8px;
  padding: 36px 32px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 28px;
  letter-spacing: 1px;
}

.form-item {
  margin-bottom: 18px;
}

.input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  height: 42px;
  padding: 0 12px;
  background: #fff;
  transition: border-color 0.2s;
}

.input-wrap:focus-within {
  border-color: var(--primary);
}

.input-wrap .icon {
  color: #c0c4cc;
  margin-right: 8px;
  flex-shrink: 0;
}

.input-wrap input {
  flex: 1;
  border: 0;
  outline: none;
  height: 100%;
  font-size: 14px;
  color: var(--text);
  background: transparent;
}

.btn-login {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
}

.btn-login:hover {
  background: var(--primary-hover);
}

.login-tip {
  min-height: 22px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--danger);
  text-align: center;
}

.login-body .site-footer {
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  z-index: 1;
}

.login-body .site-footer a {
  color: rgba(255, 255, 255, 0.92);
}

/* ===== 后台布局 ===== */
.app-layout {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: #606266;
}

.btn-text {
  border: 0;
  background: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
}

.app-main {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 210px;
  background: var(--sidebar);
  color: #bfcbd9;
  padding: 12px 0;
  flex-shrink: 0;
}

.menu-group {
  padding: 8px 20px 6px;
  font-size: 12px;
  color: #909399;
}

.menu-item {
  display: block;
  padding: 12px 20px;
  color: #bfcbd9;
  font-size: 14px;
}

.menu-item:hover,
.menu-item.active {
  color: #fff;
  background: #263445;
  text-decoration: none;
}

.menu-item.active {
  border-left: 3px solid var(--sidebar-active);
  padding-left: 17px;
}

.content {
  flex: 1;
  padding: 16px;
  min-width: 0;
}

.page-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  padding: 16px 20px 20px;
}

.crumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.crumb strong {
  color: var(--text);
  font-weight: 500;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.tab-btn {
  border: 0;
  background: none;
  padding: 10px 18px;
  cursor: pointer;
  color: #606266;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.profile-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  max-width: 860px;
}

.avatar-box {
  text-align: center;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #409eff, #1e3c72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 10px;
}

.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.form-row label {
  width: 90px;
  color: #606266;
  font-size: 14px;
  flex-shrink: 0;
}

.form-row input,
.form-row select {
  flex: 1;
  height: 36px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}

.form-row input:focus,
.form-row select:focus {
  border-color: var(--primary);
}

.btn-primary {
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar input,
.toolbar select {
  height: 32px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 0 10px;
  font-size: 13px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #fafafa;
  color: #606266;
  font-weight: 600;
  white-space: nowrap;
}

.data-table tr:hover td {
  background: #f5f7fa;
}

.tag {
  display: inline-block;
  padding: 0 8px;
  height: 22px;
  line-height: 22px;
  border-radius: 3px;
  font-size: 12px;
}

.tag-yes {
  background: #f0f9eb;
  color: #67c23a;
}

.tag-no {
  background: #f4f4f5;
  color: #909399;
}

.muted {
  color: var(--muted);
}

.table-tip {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  display: none;
  z-index: 99;
}

.app-layout .site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
  .sidebar {
    display: none;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 28px 20px 22px;
  }
}
