:root { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: #2e251f; background: #f6f3ed; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #ffd13c; outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .62; }
.hidden { display: none !important; }
.login-view { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 15%, #fff7ad, transparent 28%), linear-gradient(145deg, #244b4a, #102f34); }
.login-card { width: min(420px, calc(100% - 36px)); padding: 40px; border-radius: 22px; background: #fffdf5; box-shadow: 0 28px 80px #061b1f66; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: #744821; font-size: 25px; }
.login-card h1 { margin: 20px 0 8px; }
.login-card p { margin: 0 0 28px; color: #7a6b61; }
.login-card label, .form-grid label { display: grid; gap: 8px; margin: 15px 0; color: #65584f; font-weight: 700; }
.login-card input, .form-grid input, .form-grid select { width: 100%; height: 44px; padding: 0 13px; border: 1px solid #d8cabb; border-radius: 10px; background: #fff; }
.login-card button, .primary { width: 100%; height: 46px; margin-top: 14px; border: 0; border-radius: 10px; color: #fff; background: #744821; font-weight: 800; cursor: pointer; }
.error { min-height: 22px; margin-top: 14px; color: #c13a34; line-height: 1.45; }
.app-view { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; background: #173f40; color: #fff; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 25px; font-size: 20px; }
.side-brand span { color: #ffd13c; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav button, .logout { height: 43px; padding: 0 15px; border: 0; border-radius: 9px; color: #dcebea; background: transparent; text-align: left; cursor: pointer; }
.sidebar nav button:hover, .sidebar nav button.active { color: #173f40; background: #fff3a8; font-weight: 800; }
.logout { margin-top: auto; border: 1px solid #ffffff33; }
.main-area { min-width: 0; }
.main-area header { height: 92px; padding: 0 32px; border-bottom: 1px solid #ded7cd; background: #fff; display: flex; align-items: center; justify-content: space-between; }
.main-area h2 { margin: 0 0 6px; }
.main-area header p { margin: 0; color: #8b8178; }
.admin-tools { display: flex; align-items: center; gap: 10px; }
.admin-tools > button { padding: 8px 12px; border: 1px solid #d8cabb; border-radius: 9px; color: #744821; background: #fff; cursor: pointer; }
.admin-name { padding: 9px 14px; border-radius: 20px; background: #f1eee8; }
.content { padding: 28px 32px; }
.notice { margin: 20px 32px 0; padding: 12px 16px; border-radius: 10px; background: #fff3a8; color: #684715; cursor: pointer; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 18px; }
.metric { padding: 24px; border-radius: 16px; background: #fff; box-shadow: 0 8px 30px #402e1d0d; }
.metric span { color: #8b8178; }
.metric strong { display: block; margin-top: 12px; font-size: 34px; color: #744821; }
.panel { border-radius: 16px; background: #fff; box-shadow: 0 8px 30px #402e1d0d; overflow: hidden; }
.panel-head { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eee8df; }
.panel-head h3 { margin: 0; }
.panel-head button { padding: 10px 16px; border: 0; border-radius: 9px; color: #fff; background: #744821; cursor: pointer; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 14px 20px; border-top: 1px solid #eee8df; color: #766a61; }
.pager button { padding: 7px 14px; border: 1px solid #ccb9a5; border-radius: 8px; color: #744821; background: #fff; cursor: pointer; }
.pager button:disabled { cursor: not-allowed; opacity: .5; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 13px 16px; border-bottom: 1px solid #eee8df; text-align: left; font-size: 14px; }
th { color: #766a61; background: #faf8f4; }
.badge { display: inline-block; padding: 4px 9px; border-radius: 20px; background: #e9f5dd; color: #3a6c24; }
.badge.disabled { background: #fbe2df; color: #a52c25; }
.action-button { padding: 6px 10px; border: 1px solid #ccb9a5; border-radius: 7px; color: #744821; background: #fff; cursor: pointer; }
.level-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 18px; }
.level-card { padding: 20px; border-radius: 15px; background: #fff; box-shadow: 0 8px 30px #402e1d0d; }
.level-card h3 { margin: 0 0 6px; }
.level-card ul { padding-left: 20px; color: #65584f; line-height: 1.8; }
dialog { width: min(760px, calc(100% - 30px)); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 30px 90px #0005; }
dialog::backdrop { background: #10232699; }
.dialog-head { padding: 18px 22px; border-bottom: 1px solid #eee8df; display: flex; justify-content: space-between; }
.dialog-head h3 { margin: 0; }
.dialog-head button { border: 0; background: transparent; font-size: 25px; }
.form-grid { padding: 20px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid label { margin: 7px 0; }
.full { grid-column: 1 / -1; }
.codes { max-height: 260px; margin: 0 22px 22px; padding: 16px; overflow: auto; border-radius: 10px; background: #173f40; color: #fff3a8; white-space: pre-wrap; }

@media (max-width: 900px) {
  .app-view { grid-template-columns: 190px 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .level-grid { grid-template-columns: 1fr; }
  .content { padding: 20px; }
  .main-area header { padding: 0 20px; }
}

@media (max-width: 600px) {
  .app-view { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 10; width: 100%; height: auto; padding: 10px; display: block; }
  .side-brand { display: none; }
  .sidebar nav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
  .sidebar nav button { height: 44px; min-width: max-content; padding: 0 14px; font-size: 14px; white-space: nowrap; }
  .logout { width: auto; height: 44px; margin-top: 8px; padding: 0 14px; }
  .main-area header { height: auto; min-height: 92px; padding: 16px 18px; gap: 12px; flex-wrap: wrap; }
  .admin-tools { width: 100%; justify-content: space-between; }
  .content { padding: 16px; }
  .notice { margin: 14px 16px 0; }
  .metric-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .panel-head { gap: 12px; flex-wrap: wrap; }
  dialog { max-height: calc(100vh - 24px); overflow: auto; }
}

.grant-editor h4{margin:12px 0}.grant-help{color:#65584f;line-height:1.6}.grant-row{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;padding:14px;margin:12px 0;border:1px solid #d8cabb;border-radius:12px}.grant-row button{align-self:end;height:44px}.grant-row input:disabled{background:#eee8df}@media(max-width:600px){.grant-row{grid-template-columns:1fr}}

.level-card fieldset{border:1px solid #e0e6ee;border-radius:8px;margin:10px 0;padding:10px;display:grid;gap:7px}.level-card input[type="number"]{width:100%;box-sizing:border-box}.level-card small{color:#64748b}
