:root {
  --bg: #f4f4f0;
  --surface: #fff;
  --surface-2: #f8f8f5;
  --ink: #151714;
  --muted: #777b72;
  --line: #e4e5df;
  --accent: #d8ff3e;
  --accent-deep: #a5cd0b;
  --easy: #1c9f6e;
  --medium: #d99018;
  --hard: #d84f45;
  --shadow: 0 18px 60px rgba(23, 25, 19, .09);
}

body.dark {
  --bg: #11130f;
  --surface: #191c17;
  --surface-2: #20231e;
  --ink: #f1f3eb;
  --muted: #969c8e;
  --line: #30352b;
  --shadow: 0 18px 60px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  transition: background .25s, color .25s;
}
button, input, select { font: inherit; }
button { color: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
  background: #171916;
  color: #f4f5ee;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 0 9px 34px; color: inherit; text-decoration: none;
  font-size: 20px; font-weight: 800; letter-spacing: -.6px;
}
.brand > span:last-child span { color: var(--accent); }
.brand-mark {
  display: grid; place-items: center; width: 37px; height: 37px;
  background: var(--accent); color: #161814; border-radius: 9px;
  font: 700 14px "DM Mono", monospace; transform: rotate(-3deg);
}
.nav { display: grid; gap: 5px; }
.nav-item {
  display: flex; align-items: center; gap: 13px; padding: 11px 13px;
  border-radius: 8px; color: #9da197; text-decoration: none; font-size: 14px;
}
.nav-item:hover, .nav-item.active { background: #292c26; color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 var(--accent); }
.nav-icon { width: 20px; text-align: center; font: 16px "DM Mono"; }
.sidebar-card {
  margin-top: auto; margin-bottom: 22px; padding: 17px;
  border: 1px solid #34382f; border-radius: 11px; background: #20231e;
}
.sidebar-card-label { color: #8f9588; font-size: 12px; margin-bottom: 12px; }
.mini-progress { height: 4px; background: #3c4037; border-radius: 5px; overflow: hidden; }
.mini-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .3s; }
.sidebar-card-row { display: flex; justify-content: space-between; align-items: end; margin-top: 10px; }
.sidebar-card-row strong { font: 600 14px "DM Mono"; }
.sidebar-card-row span { font-size: 10px; color: #858b7d; }
.sidebar-card-row b { color: var(--accent); }
.sidebar-foot {
  display: flex; align-items: center; gap: 8px; color: #858a80;
  font: 10px "DM Mono"; letter-spacing: 1px;
}
.sidebar-foot kbd { margin-left: auto; border: 1px solid #3d4138; padding: 3px 6px; border-radius: 4px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }

main { grid-column: 2; min-width: 0; }
.topbar {
  height: 70px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 42px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 87%, transparent);
  backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10;
}
.breadcrumb { color: var(--ink); font-size: 13px; font-weight: 600; }
.breadcrumb span, .breadcrumb i { color: var(--muted); font-style: normal; margin-right: 9px; }
.breadcrumb a { color: var(--muted); margin-right: 9px; text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 15px; }
.top-membership-button {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  gap: 7px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #ff8a00;
  cursor: pointer;
  white-space: nowrap;
}
.top-membership-button span { font-size: 17px; line-height: 1; }
.top-membership-button strong { font-size: 13px; font-weight: 700; }
.top-membership-button:hover { color: #f27600; }
.top-membership-button[data-active="true"] { color: #e98500; }
.top-membership-button:focus-visible { outline: 2px solid #ffb34f; outline-offset: 5px; border-radius: 3px; }
.icon-button, .mobile-menu {
  width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); cursor: pointer;
}
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--bg); font: 600 11px "DM Mono"; }
.auth-button { width: auto; min-width: 52px; padding: 0 14px; border: 0; border-radius: 18px; cursor: pointer; }
.auth-button.signed-in { background: var(--accent); color: #172014; }
.account-control { position: relative; }
.user-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgb(19 29 16 / 18%);
}
.user-menu-profile { display: flex; align-items: center; gap: 11px; padding: 15px; border-bottom: 1px solid var(--line); }
.user-menu-profile > div { min-width: 0; }
.user-menu-profile strong, .user-menu-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-profile strong { font-size: 13px; }
.user-menu-profile small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.user-menu-avatar { display: grid; flex: 0 0 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--accent); color: #172014; font-weight: 800; }
.user-menu > button, .user-menu > a { width: 100%; padding: 12px 15px; border: 0; background: transparent; cursor: pointer; text-align: left; font-size: 12px; }
.user-menu > a { display: block; color: var(--ink); text-decoration: none; }
.user-menu > a[hidden] { display: none; }
.user-menu > button:hover, .user-menu > a:hover { background: var(--surface-2); }
.user-menu .admin-menu-action { color: var(--accent-deep); border-bottom: 1px solid var(--line); }
.user-menu .logout-menu-action { color: var(--hard); }
#membershipMenuBadge[data-active="true"] { color: var(--accent-deep); font-weight: 700; }
.mobile-menu { display: none; }
.content { max-width: 1240px; margin: auto; padding: 50px 42px 70px; }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 500 10px "DM Mono"; letter-spacing: 1.7px; }
.eyebrow span { width: 25px; height: 2px; background: var(--accent-deep); }
h1 { margin: 12px 0 10px; font-size: clamp(33px, 4vw, 52px); letter-spacing: -2.4px; line-height: 1.1; }
h1 em { position: relative; z-index: 0; font-style: normal; }
h1 em::after { content: ""; position: absolute; z-index: -1; height: 14px; background: var(--accent); left: -2px; right: -3px; bottom: 3px; transform: rotate(-1deg); }
.hero p { margin: 0; color: var(--muted); font-size: 14px; }
.collection-source-link { display: inline-block; margin-top: 13px; color: var(--accent-deep); font-size: 12px; font-weight: 700; text-decoration: none; }
.collection-source-link:hover { text-decoration: underline; }
.hero-stats { display: flex; align-items: center; gap: 26px; padding: 7px 4px; }
.ring {
  --progress: 0deg; width: 100px; height: 100px; padding: 8px; border-radius: 50%;
  background: conic-gradient(var(--accent-deep) var(--progress), var(--line) 0);
}
.ring > div { width: 100%; height: 100%; display: grid; place-content: center; text-align: center; border-radius: 50%; background: var(--bg); }
.ring strong { font: 600 19px "DM Mono"; }
.ring span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.stat-lines { width: 120px; display: grid; gap: 10px; }
.stat-lines div { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.stat-lines b { color: var(--ink); font: 500 11px "DM Mono"; }
.stat-lines i { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; }
.easy-dot { background: var(--easy); } .medium-dot { background: var(--medium); } .hard-dot { background: var(--hard); }

.toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) 140px 140px; gap: 10px; margin-bottom: 18px; }
.search-wrap { position: relative; }
.search-wrap > span { position: absolute; left: 15px; top: 9px; font-size: 20px; color: var(--muted); }
.search-wrap input, select {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); outline: none;
}
.search-wrap input { padding: 0 55px 0 43px; }
.search-wrap input:focus, select:focus { border-color: var(--accent-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.search-wrap kbd { position: absolute; right: 11px; top: 10px; border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); padding: 3px 6px; border-radius: 4px; font-size: 10px; }
select { appearance: none; padding: 0 32px 0 13px; color: var(--muted); font-size: 12px; background-image: linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position: calc(100% - 15px) 17px,calc(100% - 11px) 17px;background-size:4px 4px;background-repeat:no-repeat; }
.category-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 11px; scrollbar-width: none; }
.category-tabs button {
  flex: none; border: 0; border-radius: 6px; background: transparent; padding: 8px 11px;
  color: var(--muted); cursor: pointer; font-size: 12px;
}
.category-tabs button:hover, .category-tabs button.active { background: var(--ink); color: var(--bg); }
.category-tabs span { margin-left: 4px; opacity: .55; font: 10px "DM Mono"; }

.problem-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 2px 0 rgba(0,0,0,.02); }
.table-head, .problem-row { display: grid; grid-template-columns: 65px minmax(260px, 1.5fr) 100px minmax(160px, .8fr) 86px; align-items: center; }
.table-head { min-height: 42px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 10px; letter-spacing: .4px; }
.problem-row { min-height: 67px; padding: 0 18px; border-bottom: 1px solid var(--line); transition: background .15s; }
.problem-row:hover { background: var(--surface-2); }
.check {
  width: 20px; height: 20px; border: 1.5px solid #c7cac2; border-radius: 50%; background: transparent; cursor: pointer;
}
.check.done { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.problem-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.problem-number { color: #a3a79e; font: 400 11px "DM Mono"; }
.problem-title button { overflow: hidden; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; text-align: left; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.problem-title button:hover { text-decoration: underline; text-decoration-color: var(--accent-deep); text-underline-offset: 4px; }
.difficulty { width: fit-content; padding: 4px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.difficulty.easy { color: var(--easy); background: color-mix(in srgb, var(--easy) 10%, transparent); }
.difficulty.medium { color: var(--medium); background: color-mix(in srgb, var(--medium) 11%, transparent); }
.difficulty.hard { color: var(--hard); background: color-mix(in srgb, var(--hard) 10%, transparent); }
.tags { display: flex; gap: 5px; overflow: hidden; }
.tag { flex: none; padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 9px; background: var(--surface-2); }
.tag.pending { border-color: color-mix(in srgb, var(--medium) 35%, var(--line)); color: var(--medium); }
.tag.ready { border-color: color-mix(in srgb, var(--easy) 35%, var(--line)); color: var(--easy); }
.tag.verified { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); }
.row-actions { display: flex; gap: 5px; justify-content: end; }
.row-actions button { border: 0; background: transparent; color: #a7aaa2; cursor: pointer; font-size: 16px; }
.row-actions button:hover, .row-actions button.starred { color: var(--medium); }
.empty-state { display: none; padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state span { font: 30px "DM Mono"; }
.empty-state h3 { margin: 10px 0 3px; color: var(--ink); font-size: 14px; }
.empty-state p { margin: 0; font-size: 11px; }
.panel-footer { display: flex; justify-content: space-between; padding: 13px 18px; color: var(--muted); font-size: 10px; }
.panel-footer button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 10px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(9,10,8,.45); opacity: 0; pointer-events: none; transition: opacity .25s; }
.problem-drawer { position: fixed; z-index: 40; top: 0; right: 0; width: min(580px, 94vw); height: 100vh; overflow-y: auto; padding: 48px 45px; background: var(--surface); box-shadow: var(--shadow); transform: translateX(102%); transition: transform .3s ease; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
body.drawer-open .problem-drawer { transform: translateX(0); }
.drawer-close { position: absolute; top: 18px; right: 22px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); cursor: pointer; font-size: 20px; }
.drawer-kicker { color: var(--muted); font: 10px "DM Mono"; letter-spacing: 1.3px; }
.drawer-title { margin: 10px 0 14px; font-size: 28px; line-height: 1.3; }
.drawer-tags { display: flex; gap: 6px; margin-bottom: 30px; }
.drawer-section { margin: 27px 0; }
.drawer-section h3 { margin-bottom: 10px; font-size: 13px; }
.drawer-section p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.code-block { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #171916; color: #dce3d4; font: 12px/1.7 "DM Mono"; white-space: pre-wrap; }
.drawer-action { width: 100%; height: 45px; margin-top: 8px; border: 0; border-radius: 7px; background: var(--accent); color: #171916; cursor: pointer; font-weight: 700; }
.drawer-action.external-action { display: grid; place-items: center; text-decoration: none; }
.drawer-action.secondary { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.premium-problem-badge { display: inline-flex; min-height: 22px; align-items: center; padding: 0 8px; border: 1px solid #ffc56f; border-radius: 999px; background: #fff6e7; color: #d87900; font-size: 10px; font-weight: 700; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; padding: 10px 16px; border-radius: 7px; background: var(--ink); color: var(--bg); font-size: 12px; opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.login-open { overflow: hidden; }
.login-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(18 27 16 / 46%);
  backdrop-filter: blur(4px);
}
.login-modal[hidden], [hidden] { display: none !important; }
.login-card {
  width: min(410px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgb(19 29 16 / 24%);
}
.login-card > header { display: flex; align-items: center; justify-content: space-between; }
.login-card h2 { margin: 0; font-size: 22px; }
.login-card > header button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 25px; }
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 22px 0; padding: 5px; border-radius: 10px; background: var(--surface-2); }
.login-tabs button { min-height: 40px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 700; }
.login-tabs button.active { background: #2798ef; color: white; box-shadow: 0 5px 14px rgb(39 152 239 / 25%); }
.login-field { display: grid; gap: 9px; color: var(--muted); font-size: 13px; }
.login-field input { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); outline: none; }
.login-field input:focus { border-color: #2798ef; box-shadow: 0 0 0 3px rgb(39 152 239 / 12%); }
.login-primary, .development-confirm {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  border: 0;
  border-radius: 9px;
  background: #2798ef;
  color: white;
  cursor: pointer;
  font-weight: 700;
}
.login-primary:disabled { opacity: .55; cursor: wait; }
.wechat-qr-stage { text-align: center; }
.wechat-qr-stage > p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.wechat-qr-frame { width: 244px; height: 244px; margin: auto; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.wechat-qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.development-confirm { min-height: 38px; margin: 13px auto 0; background: var(--surface-3); color: var(--ink); font-size: 12px; }
.wechat-login-status { min-height: 22px; margin: 14px 0 4px; text-align: center; color: var(--muted); font-size: 13px; }
.wechat-login-status[data-state="success"] { color: var(--easy); font-weight: 700; }
.wechat-login-status[data-state="expired"] { color: var(--hard); }
.login-card > small { display: block; margin-top: 8px; color: var(--muted); text-align: center; line-height: 1.6; }
.membership-modal {
  position: fixed;
  z-index: 105;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(18 27 16 / 52%);
  backdrop-filter: blur(6px);
}
.membership-modal[hidden] { display: none !important; }
.membership-card {
  width: min(470px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgb(14 23 12 / 32%);
}
.membership-card > header { display: flex; align-items: flex-start; justify-content: space-between; }
.membership-card > header span { color: var(--accent-deep); font: 600 9px "DM Mono"; letter-spacing: 1.6px; }
.membership-card > header h2 { margin: 4px 0 0; font-size: 25px; }
.membership-card > header button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 26px; }
.membership-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 18px;
  padding: 18px;
  border-radius: 13px;
  background: linear-gradient(135deg, #192018, #2e3b28);
  color: white;
}
.membership-price-row strong { font: 700 36px "DM Mono"; }
.membership-price-row span { display: block; margin-top: 3px; color: #aeb9aa; font-size: 10px; }
.membership-price-row b { padding: 6px 10px; border-radius: 16px; background: var(--accent); color: #172014; font-size: 11px; }
.membership-benefits { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.membership-benefits li { display: flex; align-items: center; gap: 11px; }
.membership-benefits li > span { display: grid; flex: 0 0 24px; height: 24px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-deep); font-weight: 800; }
.membership-benefits strong, .membership-benefits small { display: block; }
.membership-benefits strong { font-size: 12px; }
.membership-benefits small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.membership-lifetime-note { margin: 18px 0 12px; padding: 10px 12px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 10px; line-height: 1.6; }
.membership-agreement { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.membership-primary {
  width: 100%;
  min-height: 46px;
  margin-top: 15px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #172014;
  cursor: pointer;
  font-weight: 800;
}
.membership-primary:disabled { opacity: .58; cursor: default; }
.membership-payment-stage { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; text-align: center; }
.membership-payment-stage strong { display: block; margin-bottom: 9px; font-size: 12px; }
.membership-payment-stage button { width: 100%; min-height: 38px; border: 0; border-radius: 7px; background: #2798ef; color: white; cursor: pointer; font-weight: 700; }
.membership-status { min-height: 20px; margin: 11px 0 0; color: var(--muted); text-align: center; font-size: 11px; }
.membership-status[data-state="success"] { color: var(--easy); font-weight: 700; }
.membership-status[data-state="error"] { color: var(--hard); }
.membership-security { display: block; margin-top: 6px; color: var(--muted); text-align: center; font-size: 9px; }

@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  body.menu-open .sidebar { transform: translateX(0); }
  main { display: block; }
  .mobile-menu { display: block; }
  .topbar { padding: 0 20px; }
  .content { padding: 35px 20px 60px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-stats { width: 100%; justify-content: flex-start; }
}
@media (max-width: 680px) {
  .top-actions { gap: 9px; }
  .top-membership-button strong { display: none; }
  .top-membership-button { padding: 0 3px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-wrap { grid-column: 1 / -1; }
  .table-head { display: none; }
  .problem-row { grid-template-columns: 36px 1fr auto; grid-template-areas: "status title action" ". meta action"; padding: 13px; min-height: 78px; }
  .problem-row > :nth-child(1) { grid-area: status; }
  .problem-row > :nth-child(2) { grid-area: title; }
  .problem-row > :nth-child(3) { grid-area: meta; margin-top: 7px; }
  .problem-row > :nth-child(4) { grid-area: meta; margin: 7px 0 0 72px; }
  .problem-row > :nth-child(5) { grid-area: action; }
  .problem-drawer { padding: 46px 23px; }
  .breadcrumb { display: none; }
}

/* Grouped study-plan layout */
.list-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--line);
}
.list-tabs button {
  height: 48px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}
.list-tabs button.active { border-color: var(--accent-deep); color: var(--ink); }
.toolbar { grid-template-columns: minmax(240px, 1fr) 140px 140px auto; }
.tag-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.tag-toggle input { width: 17px; height: 17px; accent-color: var(--accent-deep); }
.grouped-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
.topic-card {
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 7px 24px rgba(23, 25, 19, .05);
}
.topic-card-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.topic-heading { display: flex; align-items: center; gap: 11px; }
.topic-heading h2 { margin: 0; font-size: 17px; }
.topic-heading > span:last-child { color: var(--muted); font-size: 12px; }
.topic-book { color: var(--accent-deep); font-size: 25px; transform: rotate(90deg); }
.topic-progress { width: min(38%, 390px); display: flex; align-items: center; gap: 14px; }
.topic-progress > div { flex: 1; height: 8px; overflow: hidden; border-radius: 10px; background: var(--line); }
.topic-progress > div span { display: block; height: 100%; border-radius: inherit; background: #38bd1e; transition: width .3s; }
.topic-progress b { min-width: 42px; color: var(--muted); font: 500 12px "DM Mono"; }
.topic-problem-row {
  min-height: 72px;
  grid-template-columns: 30px minmax(240px, 1fr) 88px 32px;
  gap: 14px;
  padding: 0 28px;
}
.topic-problem-row:last-child { border-bottom: 0; }
.topic-problem-row .check {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border-color: #d7dad3;
}
.topic-problem-row .check.done { border-color: #35bd18; background: #35bd18; color: white; }
.topic-problem-row .problem-title { flex-wrap: wrap; gap: 9px; }
.topic-problem-row .problem-number { color: var(--ink); font-weight: 600; }
.topic-problem-row .difficulty {
  justify-self: end;
  border: 1px solid currentColor;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
}
.topic-problem-row .row-actions { justify-self: end; }
.row-tags { width: 100%; display: flex; gap: 5px; }
.grouped-panel .panel-footer {
  padding: 8px 2px 24px;
  background: transparent;
}
.site-record-footer {
  display: flex;
  justify-content: center;
  padding: 18px 24px 24px;
  color: var(--muted);
  font-size: 11px;
}
.site-record-footer a {
  color: inherit;
  text-decoration: none;
}
.site-record-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}
@media (max-width: 760px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-wrap { grid-column: 1 / -1; }
  .tag-toggle { min-height: 42px; padding: 0; }
  .topic-card-header { align-items: flex-start; flex-direction: column; gap: 12px; padding: 16px; }
  .topic-progress { width: 100%; }
  .topic-problem-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas: "status title difficulty";
    min-height: 72px;
    padding: 12px 16px;
  }
  .topic-problem-row > .check { grid-area: status; }
  .topic-problem-row > .problem-title { grid-area: title; }
  .topic-problem-row > .difficulty { grid-area: difficulty; }
  .topic-problem-row > .row-actions { display: none; }
}
