* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.side-tab,
.mobile-top-tab,
.entry-book-head,
.achievement-item img,
.entry-card {
  user-select: none;
  -webkit-user-drag: none;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fb;
  color: #111827;
  --mobile-safe-bottom: max(28px, env(safe-area-inset-bottom));
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(460px, 100%);
  background: #ffffff;
  border: 1px solid #e6ebf2;
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #2563eb;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand h1 {
  font-size: 24px;
  font-weight: 900;
}

.brand p,
.dash-header p,
.entry-card p {
  color: #64748b;
  margin-top: 6px;
}

.tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 16px;
  padding: 4px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 12px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  color: #64748b;
  transition: 0.2s ease;
}

.tab.active {
  background: white;
  color: #111827;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.form.active {
  display: flex;
}

input {
  width: 100%;
  height: 50px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 15px;
  outline: none;
  background: white;
}

input:focus {
  border-color: #4f83f7;
  box-shadow: 0 0 0 3px rgba(79, 131, 247, 0.12);
}

button {
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: #2563eb;
  color: white;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.captcha-row,
.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.captcha-row input,
.code-row input {
  min-width: 0;
  width: 100%;
}

#captcha-img,
#login-captcha-img,
#reset-captcha-img {
  width: 100%;
  height: 50px;
  max-width: 132px;
  border-radius: 14px;
  object-fit: contain;
  object-position: center;
  border: 1px solid #dbe3ee;
  cursor: pointer;
  display: block;
  background: #f8fafc;
}

#send-code-btn,
#send-reset-code-btn {
  width: 100%;
  height: 50px;
  font-size: 14px;
  white-space: nowrap;
}

.field-tip {
  margin: -6px 0 4px;
  min-height: 16px;
  font-size: 12px;
  line-height: 1.4;
  color: #94a3b8;
  padding-left: 4px;
}

.field-tip.ok {
  color: #16a34a;
}

.field-tip.error {
  color: #ef4444;
}

.account-form .field-tip {
  color: #94a3b8;
  margin: -4px 0 0;
  min-height: 0;
  font-size: 12px;
  line-height: 1.4;
}

.message {
  min-height: 20px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  max-width: calc(100vw - 40px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.14);
  border: 1px solid rgba(226, 232, 240, 0.9);
  z-index: 9999;
  opacity: 0;
  backdrop-filter: blur(12px);
  transition: all 0.32s ease;
}

.toast.show {
  top: 22px;
  opacity: 1;
}

.toast.success {
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(240, 253, 244, 0.96);
}

.toast.error {
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(254, 242, 242, 0.96);
}

.login-extra {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.link-btn {
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.link-btn:hover {
  color: #4f83f7;
  transform: none;
}

.app-body {
  min-height: 100vh;
  background: #eef2f7;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  transition: grid-template-columns 0.2s ease;
}

.app-sidebar {
  min-height: 100vh;
  padding: 22px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  transition: transform 0.24s ease, width 0.2s ease, padding 0.2s ease;
}

.sidebar-collapsed .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar-collapsed .app-sidebar {
  padding: 18px 12px;
}

.sidebar-collapsed .side-brand {
  justify-content: center;
}

.sidebar-collapsed .side-brand > div:last-child,
.sidebar-collapsed .side-tab small,
.sidebar-collapsed .side-logout {
  display: none;
}

.sidebar-collapsed .side-tab {
  min-height: 52px;
  place-items: center;
  padding: 10px;
  text-align: center;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.side-collapse {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.side-brand strong,
.side-brand span {
  display: block;
}

.side-brand strong {
  font-size: 18px;
}

.side-brand span {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 13px;
}

.side-nav {
  display: grid;
  gap: 10px;
}

.side-tab {
  width: 100%;
  height: auto;
  min-height: 70px;
  padding: 14px 16px;
  border-radius: 14px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  display: grid;
  gap: 4px;
}

.side-tab:hover,
.side-tab.active {
  transform: none;
  background: #1d4ed8;
  color: #ffffff;
}

.side-tab span {
  font-size: 16px;
  font-weight: 900;
}

.side-tab small {
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
}

.side-logout {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.app-content {
  min-width: 0;
  padding: 34px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  overflow: auto;
  overscroll-behavior: contain;
}

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

.workspace-active .content-header {
  display: none;
}

.content-header h1 {
  font-size: 30px;
  letter-spacing: 0;
}

.content-header p,
.panel-title p,
.entry-card p {
  color: #64748b;
}

.content-header p,
.panel-title p {
  margin-top: 6px;
}

.content-panel {
  display: none;
}

.content-panel.active {
  display: block;
}

.panel-title {
  margin-bottom: 18px;
}

.panel-title h2 {
  font-size: 22px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.entry-grid.book-list {
  display: block;
  width: 100%;
}

.quiz-search-row {
  margin-bottom: 16px;
}

.quiz-search-row input {
  height: 46px;
  border-radius: 10px;
  background: #ffffff;
}

.entry-card {
  min-height: 210px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  transition: 0.2s ease;
  position: relative;
}

.entry-card:hover {
  transform: translateY(-2px);
  border-color: #2563eb;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.entry-card:focus,
.entry-card:active {
  outline: none;
}

.entry-kicker {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.entry-card h3 {
  font-size: 24px;
  font-weight: 900;
}

.entry-card strong {
  margin-top: auto;
  color: #2563eb;
}

.entry-card.is-mastered {
  border-color: rgba(22, 163, 74, 0.35);
  background: linear-gradient(180deg, #ffffff, #f0fdf4);
}

.entry-card.is-locked {
  border-color: #e5e7eb;
  background: #f8fafc;
}

.entry-card.is-locked:hover,
.entry-card.is-locked:focus,
.entry-card.is-locked:active {
  transform: none;
  border-color: #e5e7eb;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.entry-card.access-denied-pulse {
  pointer-events: none;
}

.access-modal-open .entry-card,
.access-modal-open .side-tab,
.access-modal-open .mobile-top-tab {
  pointer-events: none;
}

.entry-card.is-locked h3,
.entry-card.is-locked p {
  color: #64748b;
}

.entry-card.is-locked strong {
  color: #b91c1c;
}

.entry-status {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 900;
}

.entry-book {
  display: grid;
  gap: 0;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.entry-book.is-recommended {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}

.entry-book + .entry-book {
  margin-top: 22px;
}

.entry-book-head {
  width: 100%;
  min-height: 64px;
  height: auto;
  padding: 16px 18px;
  border-radius: 0;
  background: #ffffff;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  box-shadow: none;
}

.entry-book-head h3 {
  font-size: 18px;
}

.entry-book-head em {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.entry-book-head p {
  color: #64748b;
  font-size: 14px;
}

.entry-book-head small {
  flex: 0 0 auto;
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
}

.entry-book-head::after {
  content: "⌃";
  color: #64748b;
  font-size: 18px;
  line-height: 1;
}

.entry-book.is-collapsed .entry-book-head::after {
  content: "⌄";
}

.entry-book > .entry-grid {
  padding: 16px;
  border-top: 1px solid #e2e8f0;
}

.entry-book.is-collapsed > .entry-grid {
  display: none;
}

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

.mobile-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-top-tabs {
  display: none;
}

.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #dbe3ee;
  box-shadow: none;
}

.icon-btn:hover {
  transform: none;
  border-color: #2563eb;
}

.mobile-only {
  display: none;
}

.launcher-view,
.workspace-view {
  min-height: 0;
}

.workspace-view {
  flex: 1;
  position: relative;
  margin: -34px;
}

.workspace-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.workspace-active .app-content {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.mobile-scrim {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.46);
}

.modal-card {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.account-info-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.account-info-list div {
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.account-info-list dt {
  color: #64748b;
  font-size: 13px;
}

.account-info-list dd {
  margin: 5px 0 0;
  font-weight: 900;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  align-items: stretch;
}

.account-actions button {
  width: 100%;
  margin-top: 0;
}

.ghost-action {
  background: #f1f5f9;
  color: #334155;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.modal-head p {
  margin-top: 5px;
  color: #64748b;
}

.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 0;
}

.account-form {
  display: grid;
  gap: 12px;
}

.logout-danger {
  width: 100%;
  margin-top: 14px;
  background: #fee2e2;
  color: #b91c1c;
}

.achievement-grid {
  display: grid;
  gap: 22px;
  padding-bottom: 34px;
}

.achievement-set {
  display: grid;
  gap: 12px;
}

.achievement-set-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.achievement-set-head p {
  color: #64748b;
}

.achievement-set-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.achievement-item {
  padding: 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 12px;
}

.achievement-item.locked {
  opacity: 0.48;
  filter: grayscale(1);
}

.achievement-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 10px;
}

.achievement-item h3 {
  font-size: 18px;
}

.achievement-item p,
.achievement-item small,
.empty-state {
  color: #64748b;
}

.achievement-item small {
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}

.auth-gate-page {
  background: #eef2f7;
}

.auth-gate {
  width: min(360px, 100%);
  padding: 30px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.gate-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 18px;
  border-radius: 999px;
  border: 4px solid #dbeafe;
  border-top-color: #2563eb;
  animation: spin 0.8s linear infinite;
}

.auth-gate h1 {
  font-size: 24px;
}

.auth-gate p {
  margin-top: 8px;
  color: #64748b;
}

.auth-gate a {
  display: inline-block;
  margin-top: 18px;
  color: #2563eb;
  font-weight: 900;
  text-decoration: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

html,
body {
  margin: 0;
  padding: 0;
}

.page {
  padding: 16px;
}

.auth-card {
  width: min(100%, 440px);
  padding: 22px;
  border-radius: 22px;
}

.captcha-row,
.code-row {
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
}

#captcha-img,
#login-captcha-img,
#reset-captcha-img {
  max-width: 118px;
  height: 50px;
}

#send-code-btn,
#send-reset-code-btn {
  font-size: 13px;
  padding: 0 8px;
}

.app-shell {
  grid-template-columns: 1fr;
}

.app-sidebar {
  display: none;
}

.mobile-menu-open .mobile-scrim {
  display: none;
}

.desktop-only {
  display: none;
}

.mobile-only {
  display: inline-grid;
  place-items: center;
}

.app-content {
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  padding: 16px;
  padding-top: calc(16px + max(64px, calc(52px + env(safe-area-inset-top))));
  padding-bottom: calc(16px + var(--mobile-safe-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.content-header.mobile-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: max(64px, calc(52px + env(safe-area-inset-top)));
  padding-top: env(safe-area-inset-top);
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
  z-index: 12;
  margin: 0;
  background: rgba(245, 247, 251, 0.98);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content-header h1,
.content-header p,
.launcher-view .panel-title {
  display: none;
}

.quiz-search-row {
  margin-bottom: 12px;
}

.mobile-control-group {
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.workspace-active .mobile-control-group {
  justify-content: space-between;
}

.mobile-top-tabs {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mobile-top-tab {
  min-height: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  background: #eef2f7;
  color: #475569;
  text-align: center;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}

.mobile-top-tab.active {
  background: #2563eb;
  color: #ffffff;
}

.mobile-top-tab small,
.workspace-active .mobile-top-tabs {
  display: none;
}

.workspace-active #mobile-back-btn {
  display: inline-grid !important;
}

.entry-grid,
.achievement-grid,
.achievement-set-grid,
.account-actions {
  grid-template-columns: 1fr;
}

.entry-card {
  min-height: 150px;
}

.workspace-view {
  margin: 0 -16px -16px;
  width: auto;
  height: calc(100vh - max(64px, calc(52px + env(safe-area-inset-top))) - 16px);
  position: relative;
}

.workspace-active .app-content {
  padding: 16px;
  padding-top: max(64px, calc(52px + env(safe-area-inset-top)));
  padding-bottom: 16px;
}

.workspace-active .content-header.mobile-top-bar {
  background: rgba(245, 247, 251, 0.98);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.workspace-active .mobile-control-group {
  padding: 0;
  pointer-events: auto;
}

.workspace-active .icon-btn {
  pointer-events: auto;
  background: #ffffff;
  box-shadow: none;
}

.workspace-active .workspace-view {
  margin: 0 -16px -16px;
  width: auto;
  height: calc(100vh - max(64px, calc(52px + env(safe-area-inset-top))) - 16px);
}

.workspace-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.achievement-grid,
#quiz-entry-grid {
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.iphone-app {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: #f7f8fb;
  color: #111827;
  position: relative;
  overflow-x: hidden;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --line: #e5e7eb;
  --muted: #6b7280;
  --text: #111827;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --danger: #dc2626;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.iphone-scroll {
  min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(94px + env(safe-area-inset-bottom));
}

.iphone-app .content-panel:not(.active) {
  display: none;
}

.iphone-header,
.iphone-section-head,
.iphone-user-box,
.iphone-achievement-body,
.iphone-account-profile {
  display: flex;
  align-items: center;
}

.iphone-header,
.iphone-section-head {
  justify-content: space-between;
  gap: 14px;
}

.iphone-header {
  padding: 2px 0 8px;
}

.iphone-user-box,
.iphone-account-profile {
  gap: 12px;
  min-width: 0;
}

.iphone-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #111827;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  flex: 0 0 auto;
  text-transform: uppercase;
}

.iphone-avatar.large {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 24px;
}

.iphone-hello {
  min-width: 0;
}

.iphone-hello span,
.iphone-days,
.iphone-page-head p,
.iphone-account-profile p,
.iphone-achievement-body p,
.iphone-book-row p {
  color: var(--muted);
}

.iphone-hello span {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
}

.iphone-hello h1,
.iphone-page-head h1,
.iphone-account-profile h2 {
  margin: 0;
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0;
}

.iphone-hello h1 {
  font-size: 24px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iphone-bell,
.iphone-back-btn {
  border: 1px solid var(--line);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface);
  color: #374151;
  display: grid;
  place-items: center;
  box-shadow: none;
}

.iphone-progress-card,
.iphone-card,
.iphone-account-card,
.iphone-book-row,
.iphone-book-item,
.iphone-panel .entry-card,
.iphone-panel .achievement-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.iphone-progress-card {
  margin-top: 18px;
  padding: 20px;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(17, 24, 39, 0.16);
}

.iphone-progress-card::after,
.iphone-book-stack {
  display: none;
}

.iphone-progress-title {
  font-size: 15px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.78);
}

.iphone-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  width: 100%;
}

.iphone-stats div {
  min-width: 0;
  padding: 0;
  border: 0;
}

.iphone-stats span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.iphone-stats strong {
  display: block;
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

.iphone-card,
.iphone-account-card {
  margin-top: 14px;
  padding: 18px;
}

.iphone-section-head {
  margin-bottom: 14px;
}

.iphone-section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.iphone-link {
  min-width: 44px;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
}

.iphone-book-list,
.iphone-panel .entry-grid,
.iphone-panel .achievement-set-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.iphone-book-item,
.iphone-book-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 14px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

.iphone-book-name,
.iphone-book-row h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iphone-book-cover,
.iphone-book-chapter {
  display: none;
}

.iphone-book-row p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iphone-progress-line {
  height: 5px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.iphone-progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.iphone-percent,
.iphone-book-progress span {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  text-align: right;
  font-size: 12px;
  font-weight: 800;
}

.iphone-achievement-preview {
  background: var(--surface);
}

.iphone-achievement-body {
  gap: 14px;
  align-items: center;
}

.iphone-medal {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.iphone-achievement-body h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.iphone-achievement-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.iphone-quick-card,
.iphone-quick-grid,
.iphone-quick-item,
.iphone-quick-icon {
  display: none;
}

.iphone-panel {
  min-height: calc(100dvh - 112px);
}

.iphone-page-head {
  padding: 4px 0 18px;
  text-align: left;
}

.iphone-page-head h1 {
  font-size: 28px;
  line-height: 1.1;
}

.iphone-page-head p {
  margin: 8px 0 0;
  font-size: 14px;
}

.iphone-panel .quiz-search-row {
  margin-bottom: 14px;
}

.iphone-panel .quiz-search-row input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
}

.iphone-panel .entry-card {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  text-decoration: none;
}

.iphone-panel .entry-card::after {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid #9ca3af;
  border-right: 2px solid #9ca3af;
  transform: rotate(45deg);
}

.iphone-panel .entry-card .entry-kicker,
.iphone-panel .entry-card .entry-status,
.iphone-panel .entry-card strong {
  display: none;
}

.iphone-panel .entry-card h3,
.iphone-panel .entry-card p {
  grid-column: 1;
}

.iphone-panel .entry-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.iphone-panel .entry-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.iphone-panel .entry-book {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.iphone-panel .entry-book-head,
.iphone-panel .entry-book > .entry-grid {
  display: none;
}

.iphone-panel .achievement-set-head {
  margin-bottom: 12px;
  padding: 18px;
  border-radius: 20px;
  background: #111827;
  color: #ffffff;
}

.iphone-panel .achievement-set-head h3 {
  margin: 0;
  font-size: 17px;
}

.iphone-panel .achievement-set-head p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.66);
}

.iphone-panel .achievement-item {
  padding: 14px;
}

.iphone-account-profile {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.iphone-account-profile h2 {
  font-size: 22px;
}

.iphone-account-profile p {
  margin: 6px 0 0;
  font-size: 14px;
}

.iphone-account-card .account-info-list {
  display: grid;
  gap: 10px;
}

.iphone-account-card .account-info-list > div {
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 14px;
}

.iphone-account-card .account-actions,
.iphone-account-card .account-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}

.iphone-account-card .account-form.hidden {
  display: none;
}

.iphone-account-card .account-actions button,
.iphone-account-card .account-form button,
.iphone-account-card .account-form input {
  min-height: 46px;
  border-radius: 16px;
}

.iphone-workspace-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  background: rgba(247, 248, 251, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.iphone-app .workspace-view {
  margin: 0;
  width: 100%;
  height: 100dvh;
  padding-top: calc(56px + env(safe-area-inset-top));
  background: #ffffff;
}

.iphone-app .workspace-frame {
  display: block;
  width: 100%;
  height: calc(100dvh - 56px - env(safe-area-inset-top));
  border: 0;
  border-radius: 0;
}

.iphone-tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: calc(72px + env(safe-area-inset-bottom));
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  z-index: 20;
  backdrop-filter: blur(14px);
}

.iphone-tab {
  border: 0;
  background: transparent;
  color: #9ca3af;
  font: inherit;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.iphone-tab small {
  font-size: 12px;
  font-weight: 800;
}

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

.workspace-active .iphone-tabbar {
  display: none;
}

.iphone-tab-icon {
  width: 24px;
  height: 24px;
  position: relative;
  display: block;
}

.iphone-tab-icon::before,
.iphone-tab-icon::after {
  content: "";
  position: absolute;
  border-color: currentColor;
}

.iphone-tab-icon.home::before {
  width: 16px;
  height: 12px;
  left: 4px;
  top: 9px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 3px;
}

.iphone-tab-icon.home::after {
  width: 13px;
  height: 13px;
  left: 5px;
  top: 3px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.iphone-tab-icon.quiz::before,
.iphone-tab-icon.survey::before {
  width: 16px;
  height: 18px;
  left: 4px;
  top: 3px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.iphone-tab-icon.quiz::after {
  width: 8px;
  height: 5px;
  left: 8px;
  top: 10px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.iphone-tab-icon.survey::after {
  width: 10px;
  height: 2px;
  left: 8px;
  top: 9px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor;
}

.iphone-tab-icon.trophy::before {
  width: 16px;
  height: 13px;
  left: 4px;
  top: 4px;
  border: 2px solid currentColor;
  border-radius: 5px 5px 8px 8px;
}

.iphone-tab-icon.trophy::after {
  width: 12px;
  height: 6px;
  left: 6px;
  top: 17px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.iphone-tab-icon.user::before {
  width: 9px;
  height: 9px;
  left: 7px;
  top: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.iphone-tab-icon.user::after {
  width: 16px;
  height: 9px;
  left: 4px;
  top: 15px;
  border: 2px solid currentColor;
  border-radius: 12px 12px 4px 4px;
}

@media (max-width: 360px) {
  .iphone-scroll {
    padding-left: 14px;
    padding-right: 14px;
  }

  .iphone-stats strong {
    font-size: 26px;
  }
}

.iphone-panel .iphone-book-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.iphone-book-toggle {
  width: 100%;
  min-height: 82px;
  border: 0;
  background: transparent;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 98px 18px;
  align-items: center;
  gap: 12px;
  color: inherit;
  font: inherit;
  text-align: left;
}

.iphone-book-toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #9ca3af;
  border-bottom: 2px solid #9ca3af;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.iphone-book-card:not(.is-collapsed) .iphone-book-toggle::after {
  transform: rotate(225deg);
}

.iphone-book-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.iphone-book-main strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iphone-book-main em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iphone-book-toggle .iphone-book-progress {
  display: grid;
  gap: 8px;
}

.iphone-book-toggle .iphone-book-progress small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.iphone-chapter-list {
  display: grid;
  gap: 1px;
  padding: 0 12px 12px;
}

.iphone-book-card.is-collapsed .iphone-chapter-list {
  display: none;
}

.iphone-chapter-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  background: #f8fafc;
}

.iphone-chapter-index {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.iphone-chapter-title {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iphone-chapter-row small {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.iphone-chapter-row.is-mastered .iphone-chapter-index {
  background: #dcfce7;
  color: #15803d;
}

.iphone-chapter-row.is-mastered small {
  color: #15803d;
}

.iphone-chapter-row.is-locked {
  opacity: 0.62;
}

.iphone-chapter-row.is-locked small {
  color: #64748b;
}

/* Mobile dashboard rebuilt from the local iPhone UI template. */
body.app-body {
  background: #f5f7fa;
}

.iphone-app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: #f5f7fa;
  color: #2c3e50;
  position: relative;
  overflow-x: hidden;
  --primary-color: #5dade2;
  --primary-light: #85c1e9;
  --primary-dark: #3498db;
  --secondary-color: #aed6f1;
  --accent-color: #2980b9;
  --success-color: #58d68d;
  --warning-color: #f7dc6f;
  --danger-color: #ec7063;
  --bg-color: #f5f7fa;
  --card-bg: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-light: #bdc3c7;
  --border-color: #e8ecf0;
  --shadow: 0 2px 12px rgba(93, 173, 226, 0.15);
  --shadow-light: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.iphone-app button,
.iphone-app a {
  -webkit-tap-highlight-color: transparent;
}

.iphone-app button:hover {
  transform: none;
}

.iphone-app .iphone-scroll {
  min-height: 100dvh;
  padding: 0 0 calc(70px + env(safe-area-inset-bottom));
}

.iphone-app .page.content-panel {
  width: 100%;
  min-height: calc(100dvh - 70px);
  padding: 16px;
  animation: iphoneTemplateFadeIn 0.3s ease;
}

.iphone-app .page.content-panel:not(.active) {
  display: none;
}

.iphone-app .page.content-panel.active {
  display: block;
}

@keyframes iphoneTemplateFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.iphone-app .home-header {
  display: flex;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 16px;
}

.iphone-app .user-avatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  margin-right: 14px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(93, 173, 226, 0.3);
  overflow: hidden;
}

.iphone-app .user-avatar-placeholder {
  font-size: 24px;
  color: #ffffff;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.iphone-app .user-info {
  min-width: 0;
}

.iphone-app .user-info h2 {
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iphone-app .user-info p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.iphone-app .stats-card {
  margin: 0 0 20px;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  box-shadow: 0 6px 20px rgba(93, 173, 226, 0.4);
}

.iphone-app .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.iphone-app .stat-item {
  text-align: center;
  min-width: 0;
}

.iphone-app .stat-value {
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.iphone-app .stat-label {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
}

.iphone-app .feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.iphone-app .feature-item {
  width: auto;
  min-height: 90px;
  height: auto;
  border: 0;
  border-radius: 16px;
  padding: 16px 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.iphone-app .feature-item.side-tab.active {
  background: var(--card-bg);
  color: var(--text-primary);
}

.iphone-app .feature-item:active {
  transform: scale(0.95);
  box-shadow: var(--shadow);
}

.iphone-app .feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iphone-app .feature-icon svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.iphone-app .feature-icon.quiz {
  background: linear-gradient(135deg, #5dade2, #3498db);
}

.iphone-app .feature-icon.survey {
  background: linear-gradient(135deg, #58d68d, #2ecc71);
}

.iphone-app .feature-icon.achievement {
  background: linear-gradient(135deg, #f7dc6f, #f39c12);
}

.iphone-app .feature-icon.account {
  background: linear-gradient(135deg, #bb8fce, #9b59b6);
}

.iphone-app .feature-name {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
}

.iphone-app .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.iphone-app .section-title {
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
}

.iphone-app .section-more {
  width: auto;
  min-height: 0;
  height: auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.iphone-app .section-more.side-tab.active,
.iphone-app .section-more:hover {
  background: transparent;
  color: var(--primary-color);
}

.iphone-app .recent-books-list,
.iphone-app .survey-list,
.iphone-app .quiz-book-list,
.iphone-app .achievement-list {
  display: block;
}

.iphone-app .book-item {
  display: flex;
  align-items: center;
  min-height: 108px;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--card-bg);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-light);
}

.iphone-app .book-item:active {
  transform: scale(0.98);
}

.iphone-app .book-cover {
  width: 60px;
  height: 80px;
  border-radius: 8px;
  margin-right: 14px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.iphone-app .book-cover-placeholder {
  padding: 4px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}

.iphone-app .book-info,
.iphone-app .quiz-list-info {
  flex: 1;
  min-width: 0;
}

.iphone-app .book-title,
.iphone-app .quiz-list-title {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iphone-app .book-author,
.iphone-app .quiz-list-author {
  display: block;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iphone-app .book-progress,
.iphone-app .quiz-list-progress,
.iphone-app .achievement-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.iphone-app .progress-bar {
  flex: 1;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border-color);
  overflow: hidden;
}

.iphone-app .progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transition: width 0.5s ease;
}

.iphone-app .book-progress-text,
.iphone-app .quiz-list-progress-text {
  min-width: 38px;
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.iphone-app .home-achievement-section {
  margin-bottom: 20px;
}

.iphone-app .home-achievement-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.iphone-app .home-achievement-card {
  width: 120px;
  min-width: 120px;
  border-radius: 16px;
  padding: 16px 10px 14px;
  background: var(--card-bg);
  box-shadow: var(--shadow-light);
  text-align: center;
}

.iphone-app .home-achievement-card.locked {
  opacity: 0.72;
}

.iphone-app .home-achievement-card-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iphone-app .home-achievement-card-icon.gold {
  background: linear-gradient(135deg, #f7dc6f, #f39c12);
}

.iphone-app .home-achievement-card-icon.locked {
  background: var(--border-color);
}

.iphone-app .home-achievement-card-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.iphone-app .home-achievement-card-name {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.iphone-app .home-achievement-card-tag {
  display: inline-block;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
}

.iphone-app .home-achievement-card-tag.achieved {
  background: rgba(88, 214, 141, 0.15);
  color: var(--success-color);
}

.iphone-app .home-achievement-card-tag.locked {
  background: var(--border-color);
  color: var(--text-secondary);
}

.iphone-app .page-header {
  padding: 20px 0;
  margin-bottom: 8px;
  text-align: center;
}

.iphone-app .page-header.left {
  padding-top: 8px;
  text-align: left;
}

.iphone-app .page-title {
  margin: 0 0 6px;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 700;
}

.iphone-app .page-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.iphone-app .tab-container {
  display: flex;
  margin-bottom: 16px;
  border-radius: 25px;
  padding: 4px;
  background: var(--border-color);
}

.iphone-app .tab-item {
  flex: 1;
  min-height: 0;
  height: auto;
  border: 0;
  border-radius: 22px;
  padding: 10px 16px;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
}

.iphone-app .tab-item.active {
  background: var(--card-bg);
  color: var(--primary-color);
  box-shadow: var(--shadow-light);
}

.iphone-app .survey-card {
  display: block;
  min-height: 148px;
  margin-bottom: 16px;
  border: 0;
  border-radius: 18px;
  padding: 18px;
  background: var(--card-bg);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-light);
  position: relative;
  overflow: hidden;
}

.iphone-app .survey-card.is-locked {
  opacity: 0.68;
}

.iphone-app .survey-illustration {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 80px;
  height: 80px;
  transform: translateY(-50%);
  opacity: 0.15;
}

.iphone-app .survey-illustration svg {
  width: 100%;
  height: 100%;
  fill: var(--primary-color);
}

.iphone-app .survey-title {
  margin: 0 0 6px;
  padding-right: 80px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.iphone-app .survey-desc {
  margin: 0 0 14px;
  padding-right: 80px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.iphone-app .survey-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.iphone-app .survey-btn.completed {
  background: var(--border-color);
  color: var(--text-secondary);
}

.iphone-app .quiz-search-row {
  margin-bottom: 14px;
}

.iphone-app .quiz-search-row input {
  height: 46px;
  border-radius: 16px;
  background: var(--card-bg);
}

.iphone-app .quiz-list-book {
  display: block;
  margin-bottom: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.iphone-app .quiz-list-card {
  width: 100%;
  min-height: 124px;
  height: auto;
  border: 0;
  border-radius: 16px;
  padding: 16px;
  background: var(--card-bg);
  color: inherit;
  box-shadow: var(--shadow-light);
  display: flex;
  align-items: center;
  text-align: left;
}

.iphone-app .quiz-list-card::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-light);
  border-bottom: 2px solid var(--text-light);
  margin-left: 12px;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.iphone-app .quiz-list-book:not(.is-collapsed) .quiz-list-card::after {
  transform: rotate(225deg);
}

.iphone-app .quiz-list-cover {
  width: 70px;
  height: 95px;
  border-radius: 10px;
  margin-right: 16px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  box-shadow: 0 4px 12px rgba(93, 173, 226, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.iphone-app .quiz-list-cover-text {
  padding: 6px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

.iphone-app .quiz-list-book .chapter-list {
  margin: 10px 0 16px;
}

.iphone-app .quiz-list-book.is-collapsed .chapter-list {
  display: none;
}

.iphone-app .chapter-item {
  display: flex;
  align-items: center;
  min-height: 68px;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  background: var(--card-bg);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-light);
}

.iphone-app .chapter-item.locked {
  opacity: 0.56;
}

.iphone-app .chapter-status {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.iphone-app .chapter-status.completed {
  background: var(--success-color);
}

.iphone-app .chapter-status.in-progress {
  background: var(--primary-color);
}

.iphone-app .chapter-status.locked {
  background: var(--border-color);
}

.iphone-app .chapter-status svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
}

.iphone-app .chapter-status.locked svg {
  fill: var(--text-light);
}

.iphone-app .chapter-content {
  flex: 1;
  min-width: 0;
}

.iphone-app .chapter-title {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.iphone-app .chapter-questions {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.iphone-app .chapter-action {
  margin-left: 10px;
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 700;
}

.iphone-app .chapter-arrow {
  width: 20px;
  height: 20px;
  margin-left: 8px;
  fill: var(--text-light);
  flex: 0 0 auto;
}

.iphone-app .achievement-stats {
  margin-bottom: 20px;
  border-radius: 20px;
  padding: 24px 16px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  box-shadow: 0 6px 20px rgba(93, 173, 226, 0.4);
}

.iphone-app .achievement-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.iphone-app .achievement-stat-item {
  min-width: 0;
  text-align: center;
}

.iphone-app .achievement-stat-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.iphone-app .achievement-stat-icon svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
}

.iphone-app .achievement-stat-value {
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.iphone-app .achievement-stat-label {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
}

.iphone-app .achievement-item {
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card-bg);
  box-shadow: var(--shadow-light);
}

.iphone-app .achievement-item.locked {
  opacity: 0.62;
  filter: none;
}

.iphone-app .achievement-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.iphone-app .achievement-icon.gold {
  background: linear-gradient(135deg, #f7dc6f, #f39c12);
}

.iphone-app .achievement-icon.blue {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.iphone-app .achievement-icon img {
  width: 34px;
  height: 34px;
  aspect-ratio: auto;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.iphone-app .achievement-content {
  flex: 1;
  min-width: 0;
}

.iphone-app .achievement-name {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
}

.iphone-app .achievement-desc {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.iphone-app .achievement-progress-text {
  min-width: 50px;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: right;
}

.iphone-app .achievement-date {
  margin-left: 12px;
  color: var(--success-color);
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
  flex: 0 0 auto;
}

.iphone-app .profile-header {
  padding: 30px 0;
  text-align: center;
}

.iphone-app .profile-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  box-shadow: 0 6px 16px rgba(93, 173, 226, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.iphone-app .profile-avatar-text {
  color: #ffffff;
  font-size: 32px;
  font-weight: 600;
  text-transform: uppercase;
}

.iphone-app .profile-name {
  margin: 0 0 6px;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
}

.iphone-app .profile-level {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--warning-color), #f39c12);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.iphone-app .profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  border-radius: 18px;
  padding: 20px;
  background: var(--card-bg);
  box-shadow: var(--shadow-light);
}

.iphone-app .profile-stat-item {
  text-align: center;
}

.iphone-app .profile-stat-value {
  color: var(--primary-color);
  font-size: 24px;
  font-weight: 700;
}

.iphone-app .profile-stat-label {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.iphone-app .profile-menu {
  margin-bottom: 16px;
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: var(--shadow-light);
  overflow: hidden;
}

.iphone-app .account-panel {
  padding: 18px;
}

.iphone-app .profile-menu-item {
  width: 100%;
  min-height: 72px;
  height: auto;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  padding: 16px 18px;
  background: var(--card-bg);
  color: inherit;
  box-shadow: none;
  display: flex;
  align-items: center;
  text-align: left;
}

.iphone-app .profile-menu-item:last-child {
  border-bottom: 0;
}

.iphone-app .profile-menu-item:active {
  background: var(--bg-color);
}

.iphone-app .profile-menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.iphone-app .profile-menu-icon svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

.iphone-app .profile-menu-icon.blue {
  background: linear-gradient(135deg, #5dade2, #3498db);
}

.iphone-app .profile-menu-icon.green {
  background: linear-gradient(135deg, #58d68d, #2ecc71);
}

.iphone-app .profile-menu-icon.orange {
  background: linear-gradient(135deg, #f7dc6f, #f39c12);
}

.iphone-app .profile-menu-icon.purple {
  background: linear-gradient(135deg, #bb8fce, #9b59b6);
}

.iphone-app .profile-menu-icon.red {
  background: linear-gradient(135deg, #ec7063, #e74c3c);
}

.iphone-app .profile-menu-text {
  flex: 1;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
}

.iphone-app .profile-menu-arrow {
  width: 20px;
  height: 20px;
  fill: var(--text-light);
}

.iphone-app .account-info-list div {
  border-radius: 14px;
  background: #f8fafc;
}

.iphone-app .account-actions,
.iphone-app .account-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.iphone-app .account-form.hidden {
  display: none;
}

.iphone-app .account-actions button,
.iphone-app .account-form button {
  width: 100%;
  border-radius: 14px;
}

.iphone-app .account-form input {
  border-radius: 14px;
}

.iphone-app .bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(70px + env(safe-area-inset-bottom));
  padding: 0 8px env(safe-area-inset-bottom);
  border-radius: 20px 20px 0 0;
  background: var(--card-bg);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
}

.iphone-app .bottom-nav .nav-item {
  width: auto;
  min-width: 58px;
  min-height: 54px;
  height: auto;
  border: 0;
  border-radius: 12px;
  padding: 8px 6px;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.iphone-app .bottom-nav .nav-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.iphone-app .bottom-nav .nav-text {
  color: currentColor;
  font-size: 11px;
  font-weight: 500;
}

.iphone-app .bottom-nav .nav-item.active {
  background: transparent;
  color: var(--primary-color);
}

.iphone-app .bottom-nav .nav-item:active {
  transform: scale(0.95);
}

body.workspace-active .iphone-app .bottom-nav {
  display: none;
}

.iphone-app .iphone-workspace-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 8px;
  background: rgba(245, 247, 250, 0.94);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.iphone-app .iphone-workspace-bar .workspace-title {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iphone-app .iphone-workspace-bar .workspace-title-spacer {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.iphone-app .quiz-back {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  padding: 0;
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.iphone-app .quiz-back svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.iphone-app .workspace-view {
  width: 100%;
  height: 100dvh;
  margin: 0;
  padding-top: calc(56px + env(safe-area-inset-top));
  background: #ffffff;
}

.iphone-app .workspace-frame {
  width: 100%;
  height: calc(100dvh - 56px - env(safe-area-inset-top));
  border: 0;
  border-radius: 0;
  background: #ffffff;
  display: block;
}

.iphone-app .empty-state {
  margin: 0;
  padding: 34px 18px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 14px;
}

.iphone-app .empty-state.compact {
  min-width: 100%;
  padding: 24px 12px;
}

@media (max-width: 360px) {
  .iphone-app .page.content-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .iphone-app .stat-value {
    font-size: 25px;
  }

  .iphone-app .feature-grid {
    gap: 8px;
  }
}

.iphone-app .home-achievement-section,
.iphone-app .home-achievement-section .section-header,
.iphone-app .home-achievement-scroll {
  width: 100%;
  max-width: 100%;
}

.iphone-app .home-achievement-scroll {
  box-sizing: border-box;
}
