/* ==========================================================================
   乌叶MC · 许愿池 /ideas — page-scoped styles
   Only loaded by public/ideas.html (body.page-ideas). Nothing here touches
   the shared design system used by index.html / polls.html.
   ========================================================================== */

body.page-ideas {
  --ideas-gap: 16px;
}

body.page-ideas [hidden] {
  display: none !important;
}

/* ---------------- page head ---------------- */

.page-ideas .page-head-inner {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
}

.page-ideas .page-head-copy {
  min-width: 0;
}

.page-ideas .page-head-copy .lead {
  max-width: 640px;
}

.page-ideas .page-stats {
  flex: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.page-ideas .page-stat {
  position: relative;
  min-width: 116px;
  padding: 15px 18px;
  text-align: right;
  background: linear-gradient(160deg, rgba(16, 28, 46, 0.9), rgba(8, 13, 22, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.page-ideas .page-stat::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 6px;
  height: 6px;
  background: var(--cyan);
  transform: rotate(45deg);
  opacity: 0.55;
}

.page-ideas .page-stat b {
  display: block;
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.page-ideas .page-stat span {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
}

/* ---------------- submit section ---------------- */

.page-ideas .submit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 0.78fr);
  gap: 22px;
  align-items: start;
}

.page-ideas .idea-form {
  position: relative;
  padding: 30px;
  overflow: hidden;
}

.page-ideas .idea-form::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), rgba(88, 230, 230, 0.25) 45%, transparent 78%);
}

.page-ideas .form-head {
  margin-bottom: 24px;
}

.page-ideas .form-head h2 {
  margin-top: 10px;
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.page-ideas .form-head .sub {
  max-width: 540px;
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--muted);
}

.page-ideas .idea-form .field {
  margin-bottom: 18px;
}

.page-ideas .idea-form .form-row,
.page-ideas .idea-form .form-row .field {
  margin-bottom: 0;
}

.page-ideas .idea-form .error-text {
  min-height: 0;
  margin: 0;
  line-height: 1.55;
}

.page-ideas .idea-form .error-text:not(:empty) {
  margin-top: 2px;
}

.page-ideas .field.has-error .input,
.page-ideas .field.has-error .textarea {
  border-color: rgba(255, 107, 129, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.09);
}

.page-ideas .category-picker {
  gap: 8px;
}

.page-ideas .category-picker .chip {
  height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
}

.page-ideas .category-picker .chip.is-active {
  box-shadow: 0 0 18px -6px rgba(88, 230, 230, 0.8);
}

/* Honeypot: off-screen instead of display:none so bots still fill it. */
.page-ideas .honeypot-wrap {
  position: absolute;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.page-ideas .honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.page-ideas .form-error {
  margin: 16px 0 0;
  padding: 10px 13px;
  border: 1px solid rgba(255, 107, 129, 0.36);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  background: rgba(255, 107, 129, 0.08);
  color: #ffb9c2;
  font-size: 12.5px;
  line-height: 1.65;
}

.page-ideas .form-error b {
  color: #ffd5da;
}

.page-ideas .form-success {
  margin: 16px 0 0;
  padding: 10px 13px;
  border: 1px solid rgba(94, 230, 143, 0.36);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  background: rgba(94, 230, 143, 0.07);
  color: #b6f2ca;
  font-size: 12.5px;
  line-height: 1.65;
}

.page-ideas #desc-count.is-warn {
  color: var(--gold);
}

.page-ideas .form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.page-ideas .form-foot .hint {
  max-width: 380px;
}

.page-ideas .form-foot .btn {
  flex: none;
  min-width: 136px;
}

.page-ideas .btn.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.page-ideas .btn.is-success {
  background: rgba(94, 230, 143, 0.12);
  border-color: rgba(94, 230, 143, 0.4);
  color: var(--green);
}

/* ---------------- submit sidebar ---------------- */

.page-ideas .submit-side {
  display: grid;
  gap: 14px;
}

.page-ideas .side-card {
  position: relative;
  background: linear-gradient(170deg, rgba(13, 22, 37, 0.9), rgba(7, 11, 19, 0.92));
}

.page-ideas .side-card h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.page-ideas .side-card p {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--muted);
}

.page-ideas .side-card p + p {
  margin-top: 8px;
}

.page-ideas .side-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.page-ideas .side-list li {
  position: relative;
  padding-left: 17px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
}

.page-ideas .side-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 10px;
  color: var(--cyan);
  opacity: 0.85;
}

.page-ideas .side-card .link-arrow {
  margin-top: 14px;
}

/* ---------------- filter bar ---------------- */

.page-ideas .filter-bar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(9, 15, 26, 0.74);
}

.page-ideas .filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-ideas .seg {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.page-ideas .seg-btn {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.page-ideas .seg-btn:hover {
  color: var(--text);
}

.page-ideas .seg-btn.is-active {
  background: var(--cyan);
  color: #04161a;
  box-shadow: 0 0 18px -7px rgba(88, 230, 230, 0.9);
}

.page-ideas .filter-search {
  position: relative;
  flex: 1 1 220px;
  min-width: 170px;
}

.page-ideas .filter-search::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border: 1.5px solid var(--muted-2);
  border-radius: 50%;
  pointer-events: none;
}

.page-ideas .filter-search::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 50%;
  width: 5px;
  height: 1.5px;
  margin-top: 2px;
  background: var(--muted-2);
  transform: rotate(45deg);
  transform-origin: left center;
  pointer-events: none;
}

.page-ideas .filter-search .input {
  height: 40px;
  min-height: 40px;
  padding-left: 33px;
  font-size: 13px;
}

.page-ideas .filter-search .input::-webkit-search-cancel-button {
  filter: invert(0.6);
}

.page-ideas .filter-select {
  flex: none;
}

.page-ideas .filter-select .select {
  width: 132px;
  height: 40px;
  min-height: 40px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
}

.page-ideas .filter-row > .btn {
  flex: none;
}

.page-ideas .filter-chips {
  gap: 8px;
}

.page-ideas .filter-chips .chip {
  height: 30px;
  padding: 0 12px;
  font-size: 11.5px;
}

/* ---------------- idea grid ---------------- */

.page-ideas .ideas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 140px;
}

.page-ideas .idea-card {
  scroll-margin-top: 110px;
}

.page-ideas .idea-card .badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.page-ideas .idea-card .idea-card-head {
  align-items: flex-start;
}

.page-ideas .idea-card .desc {
  word-break: break-word;
}

.page-ideas .idea-card-foot {
  gap: 10px;
  flex-wrap: wrap;
}

.page-ideas .idea-card-foot .idea-vote {
  flex: none;
}

.page-ideas .idea-author {
  flex: 1 1 auto;
}

.page-ideas .idea-author time {
  color: var(--muted-2);
}

.page-ideas .idea-card.is-highlight {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.5), 0 0 42px -10px rgba(255, 209, 102, 0.55);
  animation: idea-pop 0.5s ease;
}

.page-ideas .idea-card.is-new {
  border-color: rgba(255, 209, 102, 0.45);
  background: linear-gradient(170deg, rgba(30, 26, 14, 0.92), rgba(9, 13, 21, 0.94));
}

.page-ideas .idea-card.is-deeplink {
  border-color: rgba(255, 209, 102, 0.3);
}

@keyframes idea-pop {
  0% { transform: scale(0.985); }
  60% { transform: scale(1.004); }
  100% { transform: none; }
}

/* skeleton cards */

.page-ideas .idea-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 202px;
}

.page-ideas .idea-skeleton:hover {
  transform: none;
  border-color: var(--line);
}

.page-ideas .sk-line {
  height: 12px;
  border-radius: 4px;
}

.page-ideas .sk-w40 { width: 40%; }
.page-ideas .sk-w60 { width: 60%; }
.page-ideas .sk-w80 { width: 80%; }
.page-ideas .sk-w100 { width: 100%; }

.page-ideas .sk-foot {
  width: 100%;
  height: 38px;
  min-height: 38px;
  margin-top: auto;
}

/* empty / error states */

.page-ideas .list-state,
.page-ideas .empty {
  grid-column: 1 / -1;
}

.page-ideas .empty {
  border-radius: var(--radius);
}

.page-ideas .empty p {
  max-width: 440px;
  margin: 6px auto 0;
  font-size: 13px;
  line-height: 1.8;
}

.page-ideas .empty .empty-icon {
  font-family: var(--mono);
}

.page-ideas .empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

/* ---------------- list foot / pagination ---------------- */

.page-ideas .list-end {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

.page-ideas .list-end b {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.page-ideas .pagination {
  margin-top: 22px;
  flex-direction: column;
  gap: 10px;
}

.page-ideas #load-more {
  min-width: 210px;
}

.page-ideas #load-more:disabled {
  opacity: 0.6;
}

/* focus rings (shared system mostly relies on defaults) */

.page-ideas .seg-btn:focus-visible,
.page-ideas .chip:focus-visible,
.page-ideas .idea-vote:focus-visible,
.page-ideas .idea-card h3 a:focus-visible,
.page-ideas #load-more:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------------- responsive ---------------- */

@media (max-width: 1000px) {
  .page-ideas .page-head-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .page-ideas .page-stats {
    width: 100%;
    max-width: 380px;
  }

  .page-ideas .submit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-ideas .submit-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .page-ideas .ideas-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-ideas .filter-search {
    flex: 1 1 100%;
  }

  .page-ideas .filter-select {
    flex: 1 1 140px;
  }

  .page-ideas .filter-select .select {
    width: 100%;
  }

  .page-ideas .submit-side {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .page-ideas .page-head {
    padding: 36px 0 26px;
  }

  .page-ideas .page-stats {
    max-width: none;
    gap: 10px;
  }

  .page-ideas .page-stat {
    min-width: 0;
    padding: 12px 13px;
  }

  .page-ideas .page-stat b {
    font-size: 21px;
  }

  .page-ideas .page-stat::after {
    display: none;
  }

  .page-ideas .idea-form {
    padding: 22px 16px;
  }

  .page-ideas .form-head {
    margin-bottom: 20px;
  }

  .page-ideas .form-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .page-ideas .form-foot .btn {
    width: 100%;
  }

  .page-ideas .filter-bar {
    padding: 12px;
  }

  .page-ideas .seg {
    width: 100%;
  }

  .page-ideas .seg-btn {
    flex: 1;
  }

  .page-ideas .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .page-ideas .filter-chips::-webkit-scrollbar {
    display: none;
  }

  .page-ideas .filter-chips .chip {
    flex: none;
  }

  .page-ideas .idea-card {
    padding: 16px;
  }

  .page-ideas .idea-card h3 {
    font-size: 16px;
  }

  .page-ideas .idea-card-foot {
    gap: 8px;
  }

  .page-ideas .idea-vote {
    height: 34px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .page-ideas .empty {
    padding: 40px 16px;
  }

  .page-ideas #load-more {
    width: 100%;
    min-width: 0;
  }
}
