:root {
  --primary: #6377ff;
  --primary-dark: #7045a8;
  --text: #111827;
  --muted: #7b8190;
  --bg: #f3f3f4;
  --card: #ffffff;
  --line: #e6e8ef;
  --danger: #b42318;
  --shadow: 0 10px 26px rgba(36, 45, 72, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 119, 255, 0.14);
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #6178e8 0%, #7b43a4 100%);
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 28px 22px;
  box-shadow: 0 18px 42px rgba(22, 28, 45, 0.18);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
  text-align: center;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  text-align: center;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.primary-btn {
  height: 44px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.ghost-btn {
  height: 42px;
  border-radius: 10px;
  background: #f4f6ff;
  color: var(--primary);
  border: 1px solid #dfe4ff;
}

.message {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef4ff;
  color: #2659c7;
  font-size: 14px;
}

.message.error {
  background: #fff1f0;
  color: var(--danger);
}

.mobile-shell {
  width: min(100%, 640px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: 78px;
}

.page-header {
  height: 54px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  padding: 0 10px;
  background: linear-gradient(135deg, #6178e8 0%, #7b43a4 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.page-header h1 {
  margin: 0;
  font-size: 18px;
  text-align: center;
  font-weight: 700;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.home-hero {
  min-height: 190px;
  padding: 20px 15px 0;
  background: linear-gradient(135deg, #6178e8 0%, #7b43a4 100%);
  color: #fff;
  text-align: center;
}

.avatar {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.avatar svg,
.card-icon svg,
.tab-icon svg {
  display: block;
}

.user-name {
  font-size: 16px;
  margin-bottom: 6px;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
}

.stats-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: -18px 15px 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stats-card.compact {
  grid-template-columns: repeat(2, 1fr);
}

.stat-item {
  min-height: 78px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
}

.stat-item + .stat-item {
  border-left: 1px solid var(--line);
}

.stat-item strong {
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
}

.stat-item span {
  color: var(--muted);
  font-size: 13px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  padding: 45px 30px 18px;
}

.action-card {
  min-height: 114px;
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.06);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.card-icon {
  color: var(--primary);
}

.panel {
  margin: 18px 15px;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.06);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #f4f6ff;
  color: var(--primary);
  font-size: 12px;
}

.meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 26px 0;
}

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 640px);
  height: 68px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(31, 41, 55, 0.08);
}

.tab-btn {
  background: #fff;
  color: #9ca3af;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  font-size: 13px;
}

.tab-btn.active {
  color: var(--primary);
}

@media (max-width: 430px) {
  .action-grid {
    padding-left: 30px;
    padding-right: 30px;
    gap: 15px;
  }
}

@media (max-width: 360px) {
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
    padding-left: 18px;
    padding-right: 18px;
  }

  .stats-card {
    margin-left: 10px;
    margin-right: 10px;
  }
}
