:root {
  --app-bg: #f3f5f7;
  --app-surface: #ffffff;
  --app-surface-soft: #f7f9fa;
  --app-border: #dce3e7;
  --app-border-strong: #c7d1d7;
  --app-text: #17212b;
  --app-muted: #647381;
  --app-primary: #176f69;
  --app-primary-strong: #105b57;
  --app-primary-soft: #e8f3f1;
  --app-gold: #b28a43;
  --app-gold-soft: #f6f0e5;
  --app-danger: #b83b36;
  --app-warning: #a76518;
  --app-success: #176f69;
  --app-shadow: 0 12px 32px rgba(27, 43, 53, 0.08);
  --app-shadow-soft: 0 4px 14px rgba(27, 43, 53, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--app-text);
  background: var(--app-bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: var(--app-primary-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head h2 {
  margin: 0;
  color: var(--app-text);
  font-size: 26px;
  font-weight: 720;
  letter-spacing: 0;
}

.page-head p {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--app-muted);
  font-size: 14px;
  line-height: 1.6;
}

.panel,
.el-card.panel,
.el-card.stat {
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
}

.panel + .panel {
  margin-top: 18px;
}

.panel .el-card__body {
  padding: 22px;
}

.panel-head,
.form-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-head h3,
.form-section-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.panel-head p,
.form-section-head p {
  margin: 5px 0 0;
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.55;
}

.el-card {
  --el-card-border-color: var(--app-border);
  --el-card-border-radius: 7px;
}

.el-button {
  --el-button-border-radius: 6px;
  min-height: 38px;
  padding-right: 16px;
  padding-left: 16px;
  font-weight: 600;
}

.el-button--small {
  min-height: 30px;
  padding-right: 11px;
  padding-left: 11px;
}

.el-button--primary {
  --el-button-bg-color: var(--app-primary);
  --el-button-border-color: var(--app-primary);
  --el-button-hover-bg-color: var(--app-primary-strong);
  --el-button-hover-border-color: var(--app-primary-strong);
  --el-button-active-bg-color: var(--app-primary-strong);
  --el-button-active-border-color: var(--app-primary-strong);
}

.el-input__wrapper,
.el-select__wrapper,
.el-textarea__inner {
  min-height: 40px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--app-border) inset;
}

.el-input__wrapper:hover,
.el-select__wrapper:hover,
.el-textarea__inner:hover {
  box-shadow: 0 0 0 1px var(--app-border-strong) inset;
}

.el-input__wrapper.is-focus,
.el-select__wrapper.is-focused,
.el-textarea__inner:focus {
  box-shadow: 0 0 0 1px var(--app-primary) inset, 0 0 0 3px rgba(23, 111, 105, 0.1);
}

.el-form-item__label {
  color: #3f505e;
  font-weight: 650;
}

.el-table {
  --el-table-border-color: #e3e9ec;
  --el-table-header-bg-color: #f5f7f8;
  --el-table-header-text-color: #536572;
  --el-table-row-hover-bg-color: #f6faf9;
  border-radius: 6px;
  overflow: hidden;
}

.el-table th.el-table__cell {
  height: 44px;
  font-weight: 700;
}

.el-table td.el-table__cell {
  height: 48px;
}

.el-tag {
  border-radius: 999px;
  font-weight: 650;
}

.el-dialog {
  border-radius: 8px;
  box-shadow: 0 28px 72px rgba(20, 35, 45, 0.2);
}

.el-dialog__header {
  padding: 22px 24px 14px;
  margin: 0;
  border-bottom: 1px solid #edf1f3;
}

.el-dialog__body {
  padding: 20px 24px 24px;
}

.el-dialog__footer {
  padding: 14px 24px 20px;
  border-top: 1px solid #edf1f3;
}

.el-dialog__title {
  color: var(--app-text);
  font-size: 19px;
  font-weight: 720;
}

.el-segmented {
  --el-segmented-item-selected-bg-color: #ffffff;
  --el-segmented-item-selected-color: var(--app-primary-strong);
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: #eef2f3;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
}

.form-grid .el-form-item {
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid #edf1f3;
}

.toolbar,
.filters {
  align-items: center;
}

.pager {
  border-top: 1px solid #edf1f3;
  padding-top: 12px;
}

.stats {
  align-items: stretch;
}

.stat {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.stat:hover {
  border-color: var(--app-border-strong);
  box-shadow: var(--app-shadow);
  transform: translateY(-1px);
}

@media (max-width: 1100px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-head {
    display: grid;
    align-items: start;
  }

  .page-head h2 {
    font-size: 23px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .form-actions .el-button {
    width: 100%;
    margin: 0;
  }

  .el-dialog {
    width: calc(100% - 24px) !important;
  }
}
