:root {
  --panel: #ffffff;
  --line: #dbe3ef;
  --text: #1f2d3d;
  --brand: #0e5cad;
  --danger: #a22828;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
}

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

.header-actions {
  display: flex;
  gap: 8px;
}

.token-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

@media (max-width: 920px) {
  .token-bar {
    grid-template-columns: 1fr;
  }
}

h1 {
  margin: 0;
  font-size: 28px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.card h3 {
  margin: 0;
  font-size: 14px;
  color: #5b6e85;
}

.card p {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
}

@media (max-width: 920px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

h2 {
  font-size: 16px;
  margin: 8px 0;
}

form {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

input,
textarea,
button {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 10px;
  font-size: 14px;
}

button {
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
}

button:hover {
  opacity: 0.92;
}

.hint {
  margin: 0 0 10px;
  color: #5b6e85;
  font-size: 13px;
}

.table-wrap {
  max-height: 270px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

thead {
  background: #f6f9ff;
}

.list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}

.list li {
  border-bottom: 1px dashed var(--line);
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.list li .left {
  font-weight: 600;
}

.answer {
  margin: 0;
  white-space: pre-wrap;
  background: #f6f9ff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  min-height: 130px;
}

.warn {
  color: var(--danger);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 28, 43, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(820px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-panel {
  margin-top: 12px;
}

.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-month {
  font-weight: 700;
  color: #30445c;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekday {
  text-align: center;
  font-size: 13px;
  color: #5b6e85;
  padding: 4px 0;
}

.calendar-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  min-height: 64px;
  background: #f9fbff;
}

.calendar-cell.empty {
  background: transparent;
  border: 1px dashed #e6edf7;
}

.calendar-cell.has-tx {
  background: #f4f8ff;
}

.calendar-day {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: #1f2d3d;
}

.calendar-net {
  font-size: 12px;
  font-weight: 600;
  word-break: break-all;
}

.calendar-net.neg {
  color: #0d5d52;
}

.calendar-net.pos {
  color: #1e6cc8;
}

.calendar-net.zero {
  color: #8b9db4;
}
