* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #3a2f35;
  background: #f6f4f5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #c43c63;
  text-decoration: none;
}

.hide {
  display: none !important;
}

/* ============ 登录 ============ */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(249, 139, 167, 0.22), transparent 60%),
    radial-gradient(800px 500px at 92% 92%, rgba(201, 167, 216, 0.22), transparent 60%),
    #fbf7f9;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 18px;
  padding: 34px 32px 24px;
  box-shadow: 0 24px 70px rgba(120, 60, 80, 0.13);
}

.brand {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  color: #3a2f35;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f98ba7, #de4f74);
  margin-right: 9px;
}

.brand-sub {
  margin-left: 6px;
  font-weight: 400;
  font-size: 12px;
  color: #b3a2aa;
}

.login-card h1 {
  font-size: 24px;
  margin: 22px 0 6px;
}

.sub {
  color: #9c8b93;
  font-size: 13px;
  margin: 0 0 22px;
  line-height: 1.6;
}

.login-card label,
.form-field {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: #7c6a73;
}

.login-card input,
.form-field input,
.form-field select,
.form-field textarea,
.server-box input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #e9dfe4;
  border-radius: 9px;
  font-size: 14px;
  color: #3a2f35;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card input:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.server-box input:focus {
  border-color: #e58ba5;
  box-shadow: 0 0 0 3px rgba(222, 79, 116, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border: 1px solid #e9dfe4;
  border-radius: 9px;
  background: #fff;
  color: #4b3b43;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn:hover {
  border-color: #d9c6cf;
  background: #fdfbfc;
}

.btn.primary {
  background: linear-gradient(135deg, #f2708f, #d9446c);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(222, 79, 116, 0.22);
}

.btn.primary:hover {
  filter: brightness(1.03);
}

.btn.block {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
}

.btn.danger {
  color: #d93f3f;
  border-color: #f3d2d2;
  background: #fff7f7;
}

.btn.small {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 7px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.err {
  min-height: 18px;
  color: #d93f3f;
  font-size: 12.5px;
  margin: 10px 0 0;
}

.login-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #f4ecf0;
  font-size: 12px;
  color: #b3a2aa;
}

.login-foot a {
  font-size: 12px;
}

.server-box {
  margin-top: 10px;
  padding: 12px;
  background: #fbf7f9;
  border-radius: 10px;
}

.server-box input {
  margin: 0 0 8px;
  font-size: 12.5px;
}

/* ============ 框架 ============ */
.app {
  display: flex;
  min-height: 100vh;
}

.side {
  width: 218px;
  flex: 0 0 218px;
  background: #2b2227;
  color: #cdbfc6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  padding: 24px 22px 22px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.logo span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #8f7d86;
  margin-top: 5px;
  letter-spacing: 1.5px;
}

nav {
  padding: 4px 10px;
  flex: 1;
  overflow: auto;
}

.nav-item {
  display: block;
  padding: 11px 14px;
  margin-bottom: 3px;
  border-radius: 9px;
  color: #c8bac0;
  font-size: 13.5px;
  transition: all 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(242, 112, 143, 0.95), rgba(217, 68, 108, 0.95));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.side-foot {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
}

.side-user {
  color: #fff;
  margin-bottom: 8px;
  font-size: 13px;
}

.side-user em {
  display: block;
  font-style: normal;
  color: #8f7d86;
  font-size: 11.5px;
  margin-top: 3px;
}

.side-foot a {
  color: #a7949d;
}

.side-foot a:hover {
  color: #fff;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 26px 30px 50px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.top h2 {
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.3px;
}

.top p {
  margin: 6px 0 0;
  color: #9c8b93;
  font-size: 12.5px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  background: #f6edf1;
  color: #a85b74;
}

/* ============ 卡片与表格 ============ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.card {
  background: #fff;
  border-radius: 13px;
  padding: 18px 20px;
  box-shadow: 0 6px 22px rgba(120, 80, 95, 0.055);
}

.card-label {
  font-size: 12.5px;
  color: #9c8b93;
}

.card-num {
  font-size: 30px;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.card-sub {
  font-size: 11.5px;
  color: #b3a2aa;
  margin-top: 6px;
}

.panel {
  background: #fff;
  border-radius: 13px;
  padding: 20px 22px;
  box-shadow: 0 6px 22px rgba(120, 80, 95, 0.055);
  margin-bottom: 18px;
}

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-hd h3 {
  margin: 0;
  font-size: 15px;
}

.panel-hd .muted {
  font-size: 12px;
}

/* ============ 重要提醒 ============ */
.remind-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border-radius: 10px;
  background: #fbf8f9;
  border-left: 3px solid #d9cdd2;
  margin-bottom: 10px;
}

.remind-item:last-child {
  margin-bottom: 0;
}

.remind-item.urgent,
.remind-item.over {
  background: #fdf1f4;
  border-left-color: #de4f74;
}

.remind-item.near {
  background: #fdf7ef;
  border-left-color: #e0a24a;
}

.remind-item.ok {
  border-left-color: #57a773;
}

.remind-title {
  font-weight: 600;
  font-size: 13.5px;
}

.remind-tip {
  font-size: 12px;
  color: #9c8b93;
  margin-top: 4px;
  line-height: 1.5;
}

.remind-right {
  text-align: right;
  white-space: nowrap;
}

.remind-days {
  font-size: 14px;
  font-weight: 700;
  color: #6b5a62;
}

.remind-item.urgent .remind-days,
.remind-item.over .remind-days {
  color: #c43c63;
}

.remind-item.near .remind-days {
  color: #b9791f;
}

.remind-date {
  font-size: 11.5px;
  color: #b3a2aa;
  margin-top: 3px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar .grow {
  flex: 1;
}

.toolbar input.search {
  width: 260px;
  max-width: 100%;
  padding: 9px 13px;
  border: 1px solid #e9dfe4;
  border-radius: 9px;
  outline: none;
  font-size: 13px;
  font-family: inherit;
}

.toolbar input.search:focus {
  border-color: #e58ba5;
}

.tabs {
  display: inline-flex;
  background: #f4eef1;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}

.tabs a {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  color: #7c6a73;
}

.tabs a.on {
  background: #fff;
  color: #c43c63;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(120, 80, 95, 0.1);
}

.tbl-wrap {
  overflow-x: auto;
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th {
  text-align: left;
  font-weight: 500;
  color: #9c8b93;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  padding: 10px 12px;
  background: #fbf8fa;
  border-bottom: 1px solid #f1e8ec;
  white-space: nowrap;
}

.tbl td {
  padding: 12px;
  border-bottom: 1px solid #f6eff2;
  color: #4b3b43;
  vertical-align: middle;
}

.tbl tr:last-child td {
  border-bottom: none;
}

.tbl tr:hover td {
  background: #fdfafb;
}

.tbl .actions {
  white-space: nowrap;
}

.tbl .actions .btn {
  margin-right: 6px;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.3px;
}

.st {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
}

.st.green {
  background: #e9f8f0;
  color: #1d8f5c;
}

.st.red {
  background: #fdecec;
  color: #cf3a3a;
}

.st.amber {
  background: #fef4e2;
  color: #ab6a09;
}

.st.grey {
  background: #f2f1f3;
  color: #85777e;
}

.st.blue {
  background: #edf2ff;
  color: #3562c9;
}

.muted {
  color: #9c8b93;
}

.empty {
  padding: 46px 10px;
  text-align: center;
  color: #b3a2aa;
  font-size: 13px;
}

.loading {
  padding: 50px 10px;
  text-align: center;
  color: #b3a2aa;
  font-size: 13px;
}

/* 趋势图 */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 168px;
  padding: 10px 4px 0;
}

.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.bar-v {
  width: 100%;
  max-width: 46px;
  min-height: 3px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #f79ab2, #de4f74);
  transition: height 0.3s;
}

.bar-n {
  font-size: 11.5px;
  color: #7c6a73;
  margin-bottom: 5px;
}

.bar-l {
  font-size: 11px;
  color: #b3a2aa;
  margin-top: 7px;
}

/* ============ 弹窗 ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(43, 34, 39, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-box {
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 30px 80px rgba(50, 25, 35, 0.3);
}

.modal-box > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 14px;
}

.modal-box h3 {
  margin: 0;
  font-size: 17px;
}

.modal-box header a {
  font-size: 24px;
  color: #b3a2aa;
  line-height: 1;
}

#modalBody {
  padding: 4px 22px 8px;
}

#modalFoot {
  padding: 14px 22px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-field {
  flex: 1;
}

.form-field textarea {
  min-height: 88px;
  resize: vertical;
}

.form-field select {
  background: #fff;
}

.form-tip {
  font-size: 12px;
  color: #b3a2aa;
  line-height: 1.6;
  margin: -4px 0 12px;
}

.code-list {
  width: 100%;
  min-height: 130px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.9;
  border: 1px solid #e9dfe4;
  border-radius: 9px;
  padding: 12px;
  background: #fbf8fa;
  resize: vertical;
}

/* ============ 提示 ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 38px;
  transform: translate(-50%, 20px);
  background: #3a2f35;
  color: #fff;
  padding: 11px 20px;
  border-radius: 9px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s;
  z-index: 99;
  max-width: 80vw;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.err {
  background: #c93b3b;
  color: #fff;
}

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  .app {
    display: block;
  }

  .side {
    width: auto;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 8px 14px;
    overflow-x: auto;
  }

  .logo {
    padding: 0 14px 0 0;
    white-space: nowrap;
    font-size: 14px;
  }

  .logo span {
    display: none;
  }

  nav {
    display: flex;
    padding: 0;
    gap: 4px;
    overflow: visible;
  }

  .nav-item {
    white-space: nowrap;
    padding: 8px 12px;
    margin: 0;
  }

  .side-foot {
    border: none;
    padding: 0 0 0 10px;
    white-space: nowrap;
  }

  .side-user {
    display: none;
  }

  .main {
    padding: 18px 16px 40px;
  }

  .top {
    align-items: flex-start;
    gap: 10px;
  }

  .top h2 {
    font-size: 19px;
  }

  .toolbar input.search {
    width: 100%;
  }
}
