:root {
  --user-card-bg: #fff;
  --user-soft-bg: #f4ffff;
  --user-line: #cfeceb;
  --user-ink: #10232b;
  --user-muted: #71858c;
  --user-brand: #0ea99d;
  --user-brand-dark: #00796f;
  --user-orange: #ff7048;
  --user-shadow: 0 18px 40px rgba(5, 108, 100, .08);
}

.user-page main {
  min-height: 600px;
}

.account-main {
  padding: 34px 0 42px;
}

.account-page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.account-page-title h1 {
  margin: 0;
  color: var(--user-ink);
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0;
}

.account-page-title p {
  margin: 8px 0 0;
  color: var(--user-muted);
  font-size: 15px;
}

.auth-shell {
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}

.auth-visual {
  min-height: 486px;
  padding: 34px;
  color: #fff;
  border-radius: 10px;
  box-shadow: var(--user-shadow);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(0deg, rgba(0, 54, 48, .74), rgba(0, 54, 48, .46)),
    url("/assets/topic-hot-adventure.png") center / cover;
}

.auth-register .auth-visual {
  background-image:
    linear-gradient(0deg, rgba(0, 54, 48, .72), rgba(0, 54, 48, .42)),
    url("/assets/topic-romance-ancient.png");
}

.auth-visual h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 34px;
  line-height: 1.16;
  letter-spacing: 0;
}

.auth-visual p {
  max-width: 320px;
  margin: 0;
  color: rgba(235, 255, 253, .9);
  font-size: 17px;
  line-height: 1.9;
}

.auth-benefits {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 34px;
  display: grid;
  gap: 12px;
}

.auth-benefit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: rgba(0, 39, 36, .52);
}

.auth-benefit span {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--user-brand);
  color: #fff;
  font-weight: 950;
}

.auth-benefit strong {
  font-size: 16px;
}

.auth-card,
.account-card,
.account-panel,
.account-side-card,
.settings-nav,
.form-panel {
  border: 1px solid var(--user-line);
  border-radius: 10px;
  background: var(--user-card-bg);
  box-shadow: var(--user-shadow);
}

.auth-card {
  min-height: 486px;
  padding: 38px 42px;
}

.auth-card h1,
.form-panel h1 {
  margin: 0 0 8px;
  color: var(--user-ink);
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-card .hint,
.form-panel .sub {
  margin: 0 0 28px;
  color: var(--user-muted);
}

.account-field {
  margin-bottom: 18px;
}

.account-field label {
  display: block;
  margin-bottom: 9px;
  color: #33545c;
  font-weight: 850;
}

.account-input,
.account-select,
.account-textarea {
  width: 100%;
  border: 1px solid var(--user-line);
  border-radius: 6px;
  outline: 0;
  color: #173239;
  background: #fbffff;
}

.account-input,
.account-select {
  height: 48px;
  padding: 0 14px;
}

.account-textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 24px;
  color: #61757d;
  font-size: 14px;
}

.form-row a {
  color: var(--user-brand-dark);
  font-weight: 900;
}

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

.account-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--user-line);
  border-radius: 6px;
  color: var(--user-brand-dark);
  background: #fff;
  font-weight: 950;
  cursor: pointer;
}

.account-btn.primary {
  border-color: var(--user-brand);
  color: #fff;
  background: var(--user-brand);
}

.account-btn.danger {
  border-color: #ffd8d0;
  color: var(--user-orange);
  background: #fff7f5;
}

.auth-switch {
  margin: 22px 0 0;
  color: #60737a;
  text-align: center;
}

.auth-switch a {
  color: var(--user-brand-dark);
  font-weight: 900;
}

.center-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 24px;
  margin-bottom: 24px;
}

.profile-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 24px;
  padding: 28px;
  align-items: center;
  border: 1px solid var(--user-line);
  border-radius: 10px;
  background: linear-gradient(135deg, #f2fffe, #fff);
  box-shadow: var(--user-shadow);
}

.avatar {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #00b6a7, #00665e);
  font-size: 42px;
  font-weight: 950;
}

.profile-card h1 {
  margin: 0 0 7px;
  color: var(--user-ink);
  font-size: 32px;
  line-height: 1.1;
}

.profile-card p {
  margin: 0 0 7px;
  color: #60737a;
  font-size: 16px;
}

.profile-card .member-line {
  margin-bottom: 14px;
}

.profile-card em {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--user-brand-dark);
  background: #eafbfa;
  font-style: normal;
  font-weight: 850;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.profile-stat {
  display: block;
  min-height: 86px;
  padding: 17px;
  border: 1px solid var(--user-line);
  border-radius: 8px;
  background: #fff;
}

.profile-stat span {
  display: block;
  color: #789097;
  font-size: 14px;
}

.profile-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--user-brand);
  font-size: 28px;
  line-height: 1;
}

.account-side-card {
  padding: 22px;
}

.account-side-card h2,
.account-panel h2 {
  margin: 0;
  color: var(--user-ink);
  font-size: 24px;
  line-height: 1.1;
}

.account-lines {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  color: #60737a;
}

.account-lines div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e6f4f3;
  padding-bottom: 10px;
}

.quick-links {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-links a {
  min-height: 68px;
  padding: 14px;
  border: 1px solid var(--user-line);
  border-radius: 8px;
  color: var(--user-brand-dark);
  background: #fbffff;
  font-weight: 900;
}

.dash-grid,
.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 24px;
}

.account-panel {
  padding: 24px;
  margin-bottom: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid #dff1f0;
}

.panel-head a {
  color: var(--user-brand-dark);
  font-weight: 850;
}

.reading-list {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.reading-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 120px;
  gap: 18px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid #edf6f5;
}

.cover {
  overflow: hidden;
  border-radius: 7px;
  background: linear-gradient(135deg, #57d6cc, #12383f);
  color: #fff;
  font-weight: 950;
  display: grid;
  place-items: end start;
  padding: 10px;
  line-height: 1.2;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover.image-cover {
  padding: 0;
  place-items: stretch;
  background: #e9f8f7;
}

.cover.image-cover img {
  display: block;
}

.reading-item .cover {
  width: 84px;
  height: 112px;
}

.reading-item h3 {
  margin: 0 0 8px;
  font-size: 21px;
}

.reading-item p {
  margin: 0 0 12px;
  color: #60737a;
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dff1f0;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--user-brand);
}

.shelf-preview,
.book-grid {
  display: grid;
  gap: 18px;
}

.shelf-preview {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 22px;
}

.mini-book .cover {
  height: 168px;
  margin-bottom: 10px;
}

.mini-book strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.mini-book span {
  display: block;
  margin-top: 5px;
  color: #71858c;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--user-line);
  border-radius: 10px;
  background: #f9ffff;
  margin-bottom: 22px;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tabs button {
  height: 38px;
  min-width: 78px;
  display: grid;
  place-items: center;
  border: 1px solid var(--user-line);
  border-radius: 6px;
  color: #33545c;
  font-weight: 850;
  background: #fff;
  cursor: pointer;
}

.tabs button.active {
  border-color: var(--user-brand);
  background: var(--user-brand);
  color: #fff;
}

.toolbar .account-input {
  height: 38px;
  max-width: 260px;
  margin-left: auto;
}

.toolbar .account-select {
  height: 38px;
  width: auto;
}

.book-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 22px;
}

.book-card {
  border: 1px solid var(--user-line);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--user-shadow);
}

.book-card .cover {
  height: 238px;
  border-radius: 0;
}

.book-body {
  padding: 14px;
}

.book-body h3 {
  display: -webkit-box;
  min-height: 48px;
  margin: 0 0 8px;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.book-body p {
  margin: 0 0 12px;
  color: #71858c;
  line-height: 1.6;
}

.book-actions {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 8px;
}

.small-btn {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--user-line);
  border-radius: 5px;
  color: var(--user-brand-dark);
  font-weight: 850;
  background: #fff;
  cursor: pointer;
}

.small-btn.primary {
  background: var(--user-brand);
  color: #fff;
  border-color: var(--user-brand);
}

.timeline {
  display: grid;
  gap: 22px;
}

.day-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--user-brand-dark);
  font-weight: 950;
  font-size: 20px;
  margin-bottom: 12px;
}

.day-title:before {
  content: "";
  width: 4px;
  height: 22px;
  border-radius: 4px;
  background: var(--user-brand);
}

.history-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 120px;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--user-line);
  border-radius: 9px;
  background: #fff;
  margin-bottom: 12px;
}

.history-item .cover {
  width: 76px;
  height: 96px;
}

.history-item h3 {
  margin: 0 0 7px;
  font-size: 20px;
}

.history-item p {
  margin: 0 0 9px;
  color: #60737a;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  color: #8aa0a6;
  font-size: 14px;
}

.summary-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--user-line);
  border-radius: 7px;
  background: #fbffff;
  color: #60737a;
}

.settings-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}

.settings-nav {
  align-self: start;
  padding: 18px;
  background: var(--user-soft-bg);
}

.settings-nav .avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  font-size: 30px;
}

.settings-nav h2 {
  margin: 0;
  text-align: center;
  font-size: 22px;
}

.settings-nav p {
  margin: 7px 0 18px;
  color: #71858c;
  text-align: center;
}

.settings-menu {
  display: grid;
  gap: 10px;
}

.settings-menu a {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--user-line);
  border-radius: 7px;
  color: #33545c;
  background: #fff;
  font-weight: 850;
}

.settings-menu a.active {
  color: #fff;
  border-color: var(--user-brand);
  background: var(--user-brand);
}

.form-panel {
  padding: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--user-line);
  border-radius: 8px;
  background: #fbffff;
}

.avatar-upload .avatar {
  width: 76px;
  height: 76px;
  font-size: 32px;
}

.security-card {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #f0dfcc;
  border-radius: 8px;
  color: #6d5b3d;
  background: #fffaf1;
  line-height: 1.8;
}

.session-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.session-list div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--user-line);
  border-radius: 7px;
  background: #fbffff;
  color: #60737a;
}

.account-empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 36px 24px;
  border: 1px dashed var(--user-line);
  border-radius: 7px;
  color: #71858c;
  background: #fbffff;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  min-width: 220px;
  padding: 13px 18px;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 88, 80, .94);
  box-shadow: 0 16px 32px rgba(0, 64, 58, .2);
  text-align: center;
  font-weight: 850;
  transition: opacity .18s ease, transform .18s ease;
}

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

.c1 { background: linear-gradient(135deg, #10232b, #0ea99d); }
.c2 { background: linear-gradient(135deg, #5b2437, #ff7048); }
.c3 { background: linear-gradient(135deg, #203b75, #7cdad3); }
.c4 { background: linear-gradient(135deg, #49256f, #f8a6d8); }
.c5 { background: linear-gradient(135deg, #1e4250, #e5c46a); }
.c6 { background: linear-gradient(135deg, #003c37, #88d8d0); }

@media (max-width: 900px) {
  .auth-shell,
  .center-hero,
  .dash-grid,
  .history-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 300px;
  }

  .profile-card,
  .reading-item,
  .history-item {
    grid-template-columns: 1fr;
  }

  .profile-stats,
  .shelf-preview,
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .toolbar .account-input {
    margin-left: 0;
    max-width: none;
  }
}
