/* Reusable controls, cards, forms and account menu. */
.primary {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:10px 20px;
  background:var(--green);
  color:#fffdf3;
  border:1px solid var(--green);
  border-radius:10px;
  font-weight:600;
  line-height:1.5;
  cursor:pointer;
}
.primary:hover {
  background:#234b3b;
  color:white;
}
.paper {
  padding:28px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.content-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
  gap:20px;
  margin:24px 0 40px;
}
.record {
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
  height:540px;
  transition:transform .18s,box-shadow .18s;
}
.record:hover {
  transform:translateY(-3px);
  box-shadow:0 12px 30px #29493310;
}
.record h3 {
  margin:0 0 14px;
  overflow-wrap:anywhere;
}
.record h3 a:hover {
  text-decoration:underline;
  text-underline-offset:4px;
}
.record>p:not(.eyebrow) {
  color:#64705e;
  line-height:1.85;
  font-size:15px;
  overflow-wrap:anywhere;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.record .eyebrow {
  font-size:11px;
  letter-spacing:0;
  margin-bottom:8px;
}
.record>small {
  margin-top:auto;
  color:var(--muted);
  padding-top:8px;
}
.record-actions {
  display:flex;
  align-items:center;
  gap:14px;
  border-top:1px solid #e8e8d8;
  margin-top:12px;
  padding-top:8px;
  font-size:14px;
}
.record-actions a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
}
.record-actions .read-more {
  margin-right:auto;
  font-weight:650;
}
.cover-preview {
  margin:0 0 12px;
}
.cover-image {
  display:block;
  width:100%;
  aspect-ratio:16 / 9;
  overflow:hidden;
  border-radius:10px;
  background:#e8e8d8;
}
.cover {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.cover-image:focus-visible {
  outline:3px solid var(--green);
  outline-offset:3px;
}
.cover-preview figcaption {
  margin-top:8px;
  font-size:13px;
}
.cover-preview figcaption a {
  color:var(--muted);
  text-decoration:underline;
  text-underline-offset:3px;
}
.empty {
  grid-column:1/-1;
  padding:44px 24px;
  text-align:center;
  border:1px dashed #c4cdb6;
  border-radius:var(--radius);
  background:#f0f2e7;
  color:var(--muted);
}
.empty>span {
  font-size:36px;
  color:#819166;
}
.empty h2,.empty h3 {
  font-size:22px;
  margin:8px 0;
  color:var(--ink);
}
.empty p {
  margin:0;
}
.notice {
  padding:18px 22px;
  background:#edf1df;
  border:1px solid #d1dbbb;
  border-radius:12px;
  margin:22px 0;
  overflow-wrap:anywhere;
}
.notice p:last-child {
  margin-bottom:0;
}
.account {
  position:relative;
  font-size:14px;
  flex-shrink:0;
}
.account summary {
  display:flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  list-style:none;
}
.account summary::-webkit-details-marker {
  display:none;
}
.account summary::after {
  content:'⌄';
  margin-left:3px;
}
.account[open] summary {
  background:var(--soft);
}
.account-menu {
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  z-index:40;
  width:220px;
  padding:8px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 14px 40px #203a3424;
}
.account-menu a,.account-menu button {
  display:block;
  width:100%;
  padding:10px 12px;
  min-height:44px;
  text-align:left;
  border:0;
  background:transparent;
  border-radius:6px;
  color:var(--ink);
}
.account-menu a:hover,.account-menu button:hover {
  background:var(--soft);
}
.account-menu form {
  border-top:1px solid var(--line);
  margin-top:5px;
}
.account-avatar {
  width:26px;
  height:26px;
  object-fit:cover;
  border-radius:50%;
}
.music-toggle {
  position:fixed;
  right:22px;
  bottom:max(18px,env(safe-area-inset-bottom));
  z-index:30;
  border:1px solid #a6b18d;
  border-radius:24px;
  padding:10px 17px;
  min-height:44px;
  background:#fffcf1f5;
  color:var(--ink);
  box-shadow:0 4px 16px #25402c18;
  font-size:13px;
}
.music-toggle[aria-pressed=true] {
  background:#eaf0d9;
}
.context-actions {
  display:flex;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
  padding-top:26px;
  font-size:14px;
}
.context-actions>a {
  min-height:44px;
  display:inline-flex;
  align-items:center;
}
.stage-chip {
  display:inline-block;
  padding:7px 12px;
  background:var(--soft);
  color:#49653a;
  border-radius:8px;
  font-size:13px;
  white-space:nowrap;
}
form p {
  margin:20px 0;
}
label {
  display:block;
  font-weight:650;
  margin-bottom:8px;
}
input:not([type=checkbox]):not([type=hidden]),select,textarea {
  width:100%;
  min-width:0;
  padding:12px 14px;
  border:1px solid #bac5b1;
  border-radius:9px;
  background:#fffef9;
  color:var(--ink);
  min-height:48px;
}
input[type=checkbox] {
  width:18px;
  height:18px;
  accent-color:var(--green);
}
textarea {
  resize:vertical;
  min-height:120px;
}
.helptext {
  display:block;
  color:var(--muted);
  font-size:13px;
  line-height:1.7;
  margin-top:8px;
}
.helptext ul {
  padding-left:20px;
}
.errorlist {
  color:#9c3529;
  padding:12px 18px;
  background:#fff0e9;
  border-radius:8px;
  list-style:none;
}
.search {
  display:flex;
  gap:10px;
  max-width:640px;
  margin:24px 0 18px;
}
.search .primary {
  flex-shrink:0;
}
.search-summary {
  font-size:14px;
  overflow-wrap:anywhere;
}
.search-summary a {
  display:inline-block;
  margin-left:16px;
  padding:8px 0;
  text-decoration:underline;
  text-underline-offset:4px;
}
.collection-tabs {
  display:flex;
  gap:6px;
  margin:24px 0 20px;
  border-bottom:1px solid var(--line);
  padding-bottom:12px;
}
.collection-tabs a {
  min-height:44px;
  padding:9px 18px;
  border-radius:8px;
}
.collection-tabs a[aria-current=page] {
  background:var(--soft);
  font-weight:700;
}
.members {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.members>span {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  background:#f0efdf;
  border-radius:24px;
  font-size:14px;
}
.member-chip img {
  width:26px;
  height:26px;
  object-fit:cover;
  border-radius:50%;
}
.avatar,.profile-avatar {
  width:80px;
  height:80px;
  object-fit:cover;
  border-radius:18px;
}
.avatar {
  float:right;
  margin:0 0 18px 18px;
}
code {
  overflow-wrap:anywhere;
}
/* Bilibili-style course work cards */
.content-grid {
  grid-template-columns:repeat(4,minmax(0,1fr));
  align-items:start;
  gap:26px 18px;
  margin:14px 0 30px;
}
.paper.record {
  display:block;
  height:auto;
  min-height:0;
  padding:0;
  overflow:visible;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
}
.record:hover {
  transform:none;
  box-shadow:none;
}
.record .cover-preview {
  position:relative;
  width:100%;
  aspect-ratio:16 / 9;
  margin:0 0 10px;
  overflow:hidden;
  border-radius:9px;
  background:#d9c6a4;
}
.record .cover-image {
  display:block;
  width:100%;
  height:100%;
  aspect-ratio:auto;
  border-radius:inherit;
}
.record .cover {
  border-radius:inherit;
  transition:transform .2s ease;
}
.record .cover-image:hover .cover {
  transform:scale(1.025);
}
.record .cover-preview figcaption {
  position:absolute;
  right:8px;
  bottom:7px;
  margin:0;
  font-size:11px;
  line-height:1;
}
.record .cover-preview figcaption a {
  display:block;
  padding:5px 6px;
  color:#fff;
  text-decoration:none;
  border-radius:4px;
  background:#00000080;
}
.record .default-cover .cover-image {
  display:flex;
  align-items:flex-end;
  padding:12px;
  color:#fff8e8;
  background:linear-gradient(135deg,#4e3227,#b27028 58%,#e0b262);
}
.record .default-cover .cover-image span {
  padding:5px 7px;
  font-size:12px;
  border-radius:4px;
  background:#00000066;
}
.record .eyebrow,
.record > p:not(.eyebrow) {
  display:none;
}
.record h3 {
  display:-webkit-box;
  margin:0 0 5px;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  font-size:16px;
  font-weight:650;
  line-height:1.42;
}
.record h3 a {
  color:var(--ink);
  text-decoration:none;
}
.record h3 a:hover {
  text-decoration:underline;
  text-underline-offset:3px;
}
.record > small {
  display:block;
  margin:0;
  padding:0;
  overflow:hidden;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.record-actions {
  justify-content:flex-end;
  gap:0;
  min-height:0;
  margin:3px 0 0;
  padding:0;
  border:0;
  font-size:12px;
}
.record-actions .read-more { display:none; }
.record-actions a {
  min-height:0;
  color:var(--muted);
  text-decoration:underline;
  text-underline-offset:3px;
}
.attachment-panel {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:22px 0;
  padding:14px 16px;
  border:1px solid var(--line);
  background:var(--soft);
  border-radius:10px;
}
.attachment-panel .eyebrow { margin:0 0 5px; }
.attachment-panel strong { display:block; overflow-wrap:anywhere; }
.attachment-panel p:last-child { margin:5px 0 0; color:var(--muted); }
.attachment-panel .primary { min-height:38px; padding:7px 13px; flex-shrink:0; }
@media(max-width:1600px) {
  .content-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media(max-width:1280px) {
  .content-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:850px) {
  .content-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:560px) {
  .content-grid {
    grid-template-columns:1fr;
    gap:22px;
    margin:16px 0 28px;
  }
  .attachment-panel { align-items:flex-start; flex-direction:column; }
  .paper {
    padding:22px;
  }
  .account summary {
    font-size:12px;
    padding:8px;
  }
  .music-toggle {
    right:14px;
  }
  .search {
    gap:8px;
  }
  .search .primary {
    padding:10px 18px;
  }
  .context-actions {
    gap:8px 16px;
  }
  .empty {
    padding:32px 20px;
  }
}
