:root {
  color-scheme: dark;
  --page: #111118;
  --dark: #1e1e28;
  --card: #2a2a3c;
  --card-deep: #232332;
  --gold: #ffb400;
  --orange: #ff7e00;
  --pink: #ff1493;
  --green: #22c55e;
  --muted: #a8a8b5;
  --text: #f6f6fa;
  --shell-width: 480px;
  --header-height: 170px;
  --bottom-height: 62px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Arial, sans-serif;
}

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

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 180, 0, .08), transparent 28rem),
    var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.site-shell {
  position: relative;
  width: min(100%, var(--shell-width));
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--dark);
  box-shadow: 0 0 48px rgba(0, 0, 0, .42);
}

.header-fixed {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 50%;
  width: min(100%, var(--shell-width));
  min-height: var(--header-height);
  transform: translateX(-50%);
  background: rgba(30, 30, 40, .97);
  border-bottom: 1px solid rgba(255, 255, 255, .035);
  backdrop-filter: blur(14px);
}

.notice-bar {
  height: 32px;
  overflow: hidden;
  background: linear-gradient(135deg, #17172a, #292949);
  border-bottom: 1px solid rgba(255, 180, 0, .22);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .3);
}

.notice-track {
  display: flex;
  width: max-content;
  line-height: 32px;
  white-space: nowrap;
  animation: marquee 18s linear infinite;
}

.notice-track span {
  flex: none;
  padding: 0 42px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

.category-nav {
  padding: 5px 8px 3px;
}

.category-nav ul {
  display: flex;
  gap: 6px;
  list-style: none;
  /* 分类多于一行能容下的数量时横向滑动，而不是挤压/裁掉最后一个。 */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-nav ul::-webkit-scrollbar {
  display: none;
}

.category-button {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1.5px solid rgba(255, 180, 0, .27);
  border-radius: 20px;
  background: rgba(255, 180, 0, .07);
  color: #cacace;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.category-button .category-icon {
  margin-right: 3px;
  font-size: 16px;
}

.category-button.is-active {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--orange), #ffaa00);
  color: #fff;
  box-shadow: 0 4px 18px rgba(255, 126, 0, .25), 0 0 22px rgba(255, 180, 0, .18);
}

.category-button:active {
  transform: scale(.94);
}

.search-box {
  padding: 7px 12px 4px;
}

.search-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.search-inner input {
  width: 100%;
  height: 43px;
  padding: 0 76px 0 42px;
  border: 1px solid #d4d4d8;
  border-radius: 24px;
  background: #fff;
  color: #17171f;
  font-size: 14px;
  outline: none;
}

.search-inner input::placeholder {
  color: #73737c;
}

.search-inner input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 180, 0, .16);
}

.search-icon {
  position: absolute;
  z-index: 1;
  left: 15px;
  width: 17px;
  height: 17px;
  border: 2px solid #555563;
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  transform: rotate(45deg);
  border-radius: 1px;
  background: #555563;
  content: "";
}

.search-button {
  position: absolute;
  right: 5px;
  height: 33px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--orange), #ffaa00);
  box-shadow: 0 3px 9px rgba(255, 126, 0, .25);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.search-button:active {
  transform: scale(.94);
}

.search-limit-bar {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: #e53935;
  box-shadow: 0 4px 16px rgba(229, 57, 53, .36);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  animation: slide-down .3s ease;
}

.search-limit-bar strong {
  flex: none;
  padding: 3px 10px;
  border-radius: 20px;
  background: #fff;
  color: #e53935;
}

@keyframes slide-down {
  from { transform: translateY(-8px); opacity: 0; }
}

.online-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 12px 6px;
  padding: 4px 14px;
  border: 1px solid rgba(255, 180, 0, .24);
  border-radius: 60px;
  background: rgba(0, 0, 0, .28);
  color: #ffe6c7;
  font-size: 13px;
}

.online-icon {
  margin-right: 7px;
  font-size: 17px;
}

.online-count {
  min-width: 46px;
  color: var(--gold);
  font: 800 17px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
  text-shadow: 0 0 8px rgba(255, 180, 0, .44);
}

.live-dot {
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
  animation: live-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes live-pulse {
  to { transform: scale(1.35); opacity: .55; }
}

.page-main {
  min-height: 100vh;
  padding: var(--header-height) 0 calc(var(--bottom-height) + 18px);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px 9px;
}

.section-header h1 {
  position: relative;
  padding-left: 12px;
  font-size: 16px;
  line-height: 25px;
}

.section-header h1::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  border-radius: 3px;
  background: var(--gold);
  content: "";
}

.section-header span {
  color: var(--muted);
  font-size: 12px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 10px;
  padding: 2px 12px 10px;
}

.resource-grid[data-layout="two"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resource-grid[data-layout="three"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resource-grid[data-layout="four"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.resource-grid[data-layout="three"],
.resource-grid[data-layout="four"] {
  gap: 12px 8px;
}

.resource-grid[data-layout="three"] .card-cover {
  aspect-ratio: 1 / 1.04;
}

.resource-grid[data-layout="four"] .card-cover {
  aspect-ratio: 1 / 1;
}

.resource-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .035);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .15);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.resource-card:active {
  transform: scale(.97);
  border-color: rgba(255, 180, 0, .48);
  box-shadow: 0 0 0 2px rgba(255, 180, 0, .13);
}

.card-cover {
  position: relative;
  aspect-ratio: 1.48 / 1;
  overflow: hidden;
  background: var(--card-deep);
}

.card-cover::after {
  position: absolute;
  inset: 50% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .76));
  content: "";
  pointer-events: none;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.resource-card:hover .card-cover img {
  transform: scale(1.035);
}

.free-badge {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  padding: 3px 9px 3px 7px;
  border-radius: 0 0 10px;
  background: linear-gradient(135deg, #ff416c, #ff6b6b 55%, #ffa502);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .38);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.card-play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 50%;
  background: rgba(15, 15, 24, .4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .34);
  backdrop-filter: blur(4px);
}

.card-play::before {
  width: 0;
  height: 0;
  transform: translateX(2px);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid rgba(255, 255, 255, .94);
  content: "";
}

.card-meta {
  position: absolute;
  z-index: 2;
  right: 7px;
  bottom: 6px;
  left: 7px;
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-size: 10px;
}

.resource-grid[data-layout="two"] .card-meta {
  font-size: 11px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, .94);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .75);
}

.view-icon,
.time-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 11px;
  flex: none;
  opacity: .92;
}

/* 标准白色眼睛（Feather "eye" 描边形状）：SVG data-URI 做 mask，
   颜色交给 background 控制，换主题色不用改图形。 */
.view-icon {
  background: rgba(255, 255, 255, .92);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.time-icon {
  width: 12px;
  height: 12px;
  border: 1.35px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
}

.time-icon::before {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 1.3px;
  height: 4px;
  transform-origin: 50% 100%;
  transform: rotate(-35deg);
  border-radius: 2px;
  background: rgba(255, 255, 255, .92);
  content: "";
}

.card-body {
  padding: 7px 9px 9px;
}

.card-title {
  overflow: hidden;
  margin-bottom: 6px;
  color: #fff;
  /* 三/四列紧凑版式用 11px；两列大图卡片宽，小字显得空，下方覆盖到 13px。 */
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-grid[data-layout="two"] .card-title {
  font-size: 13px;
}

.card-action {
  width: 100%;
  padding: 4px 0;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--orange), #ffaa00);
  box-shadow: 0 2px 8px rgba(255, 126, 0, .27);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.resource-card[data-category="resources"] .card-action,
.resource-card[data-category="games"] .card-action,
.resource-card[data-category="software"] .card-action {
  background: linear-gradient(135deg, #00a881, #00c8c3);
  box-shadow: 0 2px 8px rgba(0, 184, 148, .28);
}

.resource-grid[data-layout="three"] .card-body,
.resource-grid[data-layout="four"] .card-body {
  padding: 6px 7px 8px;
}

.resource-grid[data-layout="four"] .free-badge {
  padding: 2px 6px 2px 5px;
  border-radius: 0 0 8px;
  font-size: 9px;
}

.feed-footer {
  padding: 5px 12px 22px;
}

.feed-load-trigger {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: #9b9baa;
  font-size: 12px;
  cursor: pointer;
}

.feed-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: feed-spin .8s linear infinite;
}

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

.feed-unlock-card {
  display: grid;
  width: 100%;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid rgba(255, 180, 0, .32);
  border-radius: 17px;
  background:
    linear-gradient(135deg, rgba(255, 126, 0, .16), rgba(255, 180, 0, .07)),
    #282838;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22), inset 0 1px rgba(255, 255, 255, .04);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.feed-unlock-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--orange), var(--gold));
  box-shadow: 0 7px 16px rgba(255, 126, 0, .24);
  font-size: 22px;
}

.feed-unlock-copy {
  display: grid;
  gap: 3px;
}

.feed-unlock-copy strong {
  font-size: 15px;
}

.feed-unlock-copy small {
  color: #b5b5c1;
  font-size: 11px;
  line-height: 1.4;
}

.feed-unlock-arrow {
  color: var(--gold);
  font-size: 28px;
  text-align: right;
}

.feed-end-message {
  padding: 10px 0 3px;
  color: #777784;
  font-size: 12px;
  text-align: center;
}

.empty-state {
  min-height: 48vh;
  padding: 48px 24px;
  text-align: center;
}

.empty-folder {
  margin-bottom: 12px;
  font-size: 58px;
}

.empty-state h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.empty-state p {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state button {
  padding: 9px 22px;
  border: 1px solid rgba(255, 180, 0, .42);
  border-radius: 20px;
  background: rgba(255, 180, 0, .1);
  color: var(--gold);
  cursor: pointer;
}

.fallback-result {
  min-height: 54vh;
  padding: 18px 24px 54px;
  text-align: center;
}

.fallback-folder-button {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  padding: 22px 12px 18px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.fallback-folder-button:hover,
.fallback-folder-button:focus-visible {
  background: rgba(255, 255, 255, .035);
}

.fallback-folder-icon {
  display: block;
  margin-bottom: 14px;
  filter: grayscale(.5) drop-shadow(0 10px 15px rgba(0, 0, 0, .24));
  font-size: 82px;
  line-height: 1;
}

.fallback-folder-button strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--gold);
  font-size: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fallback-folder-button > span:last-child {
  margin-top: 18px;
  color: #858591;
  font-size: 15px;
}

.fallback-back-button {
  margin-top: 4px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px dashed #696974;
  background: transparent;
  color: #82828d;
  font-size: 14px;
  cursor: pointer;
}

.fallback-back-button:hover,
.fallback-back-button:focus-visible {
  color: var(--gold);
}

.bottom-nav {
  position: fixed;
  z-index: 50;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(100%, var(--shell-width));
  height: var(--bottom-height);
  grid-template-columns: repeat(4, 1fr);
  transform: translateX(-50%);
  border-top: 1px solid rgba(255, 180, 0, .15);
  background: rgba(30, 30, 40, .97);
  backdrop-filter: blur(14px);
}

.bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #8d8d99;
  font-size: 11px;
  cursor: pointer;
}

.bottom-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  font-size: 22px;
  line-height: 1;
}

.bottom-item.is-active {
  color: var(--gold);
}

.bottom-item.is-active .bottom-icon {
  background: rgba(255, 180, 0, .12);
  box-shadow: 0 0 14px rgba(255, 180, 0, .12);
}

/* 弹窗层：矮屏（含软键盘弹起）和内容超高时都必须滚得到。
   两个坑：
   1. 不能用 place-items: center / align-items: center 居中——内容比视口高时，
      溢出量会被上下均分，顶部（标题、关闭按钮）永远滚不到。用卡片上的
      margin: auto：有剩余空间时居中，没空间时归零，卡片从顶部开始排。
   2. 不写 inset: 0 —— 它要 Chrome 87+ / Safari 14.1+，老安卓内嵌浏览器上整条
      声明静默失效，弹窗失去定位和全屏遮罩。四个长写属性到处都能用。 */
.modal-layer {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(5px);
  animation: fade-in .25s ease;
}

.modal-card {
  width: min(100%, 390px);
  margin: auto;
  animation: modal-in .35s cubic-bezier(.2, .8, .2, 1);
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes modal-in {
  from { transform: translateY(16px) scale(.94); opacity: 0; }
}

.welcome-card {
  padding: 27px 24px 25px;
  border: 1px solid rgba(255, 180, 0, .15);
  border-radius: 24px;
  background: linear-gradient(145deg, #2b2b3f, #1e1e28);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .66);
}

.welcome-card h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--gold);
  font-size: 24px;
}

.welcome-card h2 span {
  font-size: 29px;
}

.welcome-lines {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.welcome-lines p {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #e8e8f0;
  font-size: 14px;
  line-height: 1.55;
}

.welcome-lines p > span:first-child {
  width: 23px;
  flex: none;
  text-align: center;
}

.welcome-lines strong,
.welcome-search {
  color: var(--gold);
}

.primary-button {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--orange), #ffaa00);
  box-shadow: 0 5px 20px rgba(255, 126, 0, .33);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.resource-modal-card {
  width: min(100%, 434px);
  padding: 14px 18px 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 85px rgba(0, 0, 0, .62);
  color: #171723;
  color-scheme: light;
}

.modal-topbar {
  display: flex;
  justify-content: flex-end;
  height: 28px;
}

.close-button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #b8b8bd;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.resource-modal-card h2,
.resource-modal-card h3 {
  text-align: center;
}

.resource-modal-card h2 {
  margin-top: 4px;
  font-size: clamp(19px, 5.4vw, 23px);
  line-height: 1.1;
}

.resource-modal-card h3 {
  margin: 3px 0 14px;
  font-size: clamp(19px, 5.4vw, 23px);
  line-height: 1.1;
}

.modal-resource-preview {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 7px;
  border: 1px solid #e9e9ef;
  border-radius: 14px;
  background: #f7f7fa;
  box-shadow: 0 5px 18px rgba(23, 23, 35, .07);
}

.modal-resource-preview img {
  width: 96px;
  height: 62px;
  border-radius: 10px;
  background: #e8e8ee;
  object-fit: cover;
}

.modal-resource-copy {
  min-width: 0;
}

.modal-resource-copy span {
  display: block;
  margin-bottom: 5px;
  color: #9999a2;
  font-size: 12px;
}

.modal-resource-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #23232d;
  font-size: 16px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.unlock-option {
  display: flex;
  width: 100%;
  min-height: 60px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  cursor: pointer;
}

.unlock-option strong {
  font-size: clamp(18px, 5.2vw, 22px);
  line-height: 1.15;
}

.unlock-option span {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  opacity: .9;
}

.unlock-option:disabled {
  cursor: wait;
  opacity: .72;
}

.free-option {
  background: linear-gradient(135deg, #ff1493, #ff0f91);
  box-shadow: 0 8px 24px rgba(255, 20, 147, .3);
}

.password-row {
  display: flex;
  gap: 10px;
}

.password-row input {
  min-width: 0;
  height: 50px;
  flex: 1;
  padding: 0 14px;
  border: 3px solid #ff9500;
  border-radius: 14px;
  background: #fff;
  color: #222;
  font-size: 16px;
  outline: 0;
  box-shadow: 0 0 0 5px rgba(255, 149, 0, .08);
  /* 软键盘弹起时浏览器会把这个输入框滚进可视区，留点落点余量，
     免得输入框紧贴键盘上沿、下面那行错误提示被压住。 */
  scroll-margin-bottom: 24px;
}

.password-row input::placeholder {
  color: #a9a9af;
}

.password-row button {
  min-width: 84px;
  height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #4a7bff, #8a2be2);
  box-shadow: 0 8px 20px rgba(91, 75, 235, .23);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

/* 等待后端验证的那一瞬间会禁用按钮，否则连点两下会发两轮请求。 */
.password-row button:disabled {
  opacity: .6;
  cursor: default;
  box-shadow: none;
}

.modal-error {
  min-height: 20px;
  padding-top: 4px;
  color: #e53935;
  font-size: 12px;
  text-align: center;
}

.modal-error.is-shaking {
  animation: shake .34s ease;
}

@keyframes shake {
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.modal-success-count {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed #dedee3;
  color: #9c9ca3;
  font-size: 13px;
  text-align: center;
}

.modal-success-count strong {
  font-weight: 500;
}

@media (max-width: 380px) {
  .resource-modal-card {
    padding-inline: 16px;
  }

  .modal-resource-preview {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .modal-resource-preview img {
    width: 88px;
    height: 58px;
  }

  .password-row button {
    min-width: 82px;
    padding-inline: 15px;
  }
}

/* 矮屏：iPhone SE 在 Safari 地址栏展开时只剩约 505px，抖音/微信 webview 更矮。
   再降一档，让弹窗在这些机器上根本不需要滚动。
   放在窄屏那档之后：360×600 这类机器两档同时命中，高度才是硬约束。
   这里不隐藏任何元素，真装不下由 .modal-layer 的滚动兜住。 */
@media (max-height: 620px) {
  .resource-modal-card {
    padding: 12px 16px 14px;
  }

  .resource-modal-card h2,
  .resource-modal-card h3 {
    font-size: 20px;
  }

  .resource-modal-card h3 {
    margin-bottom: 10px;
  }

  .unlock-option {
    min-height: 54px;
  }

  .password-row input,
  .password-row button {
    height: 46px;
  }

  .modal-resource-preview img {
    height: 54px;
  }

  .modal-error {
    padding-top: 2px;
  }
}

.toast {
  position: fixed;
  z-index: 200;
  bottom: 90px;
  left: 50%;
  max-width: min(86vw, 400px);
  padding: 9px 20px;
  transform: translate(-50%, 16px);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 24px;
  background: rgba(0, 0, 0, .87);
  color: #fff;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  backdrop-filter: blur(6px);
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 380px) {
  :root { --header-height: 166px; }
  .category-button { font-size: 12px; }
  .category-button .category-icon { font-size: 14px; }
  .notice-track span { padding: 0 30px; }
  .resource-grid { gap: 10px 8px; padding-inline: 9px; }
  .welcome-card { padding-inline: 18px; }
}

@media (hover: hover) {
  .category-button:hover:not(.is-active) {
    border-color: rgba(255, 180, 0, .5);
    background: rgba(255, 180, 0, .13);
  }

  .resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 11px 24px rgba(0, 0, 0, .24);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
