:root {
  --bg: #f4ede4;
  --bg-soft: #ede3d6;
  --surface: #fffaf4;
  --surface-2: #f5ebdf;
  --surface-3: #fffcf7;
  --surface-dark: #342821;
  --surface-dark-2: #281e18;
  --line: rgba(117, 92, 68, 0.18);
  --line-strong: rgba(130, 101, 74, 0.3);
  --ink: #1f1814;
  --ink-soft: #5b4d42;
  --muted: #75695f;
  --muted-2: #9b8d82;
  --accent: #a66443;
  --accent-strong: #8b5236;
  --accent-soft: rgba(166, 100, 67, 0.12);
  --jade: #688b84;
  --jade-strong: #4c6d67;
  --gold: #b69a6c;
  --shadow-soft: 0 16px 34px rgba(58, 40, 25, 0.08);
  --shadow-card: 0 22px 48px rgba(58, 40, 25, 0.12);
  --shadow-panel: 0 28px 64px rgba(58, 40, 25, 0.12);
  --radius-xs: 14px;
  --radius-sm: 20px;
  --radius-md: 28px;
  --radius-lg: 38px;
  --transition: 220ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(166, 100, 67, 0.12), transparent 24%),
    radial-gradient(circle at 84% 10%, rgba(104, 139, 132, 0.16), transparent 18%),
    linear-gradient(180deg, #f7efe5 0%, #efe4d6 100%);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button,
input,
select,
textarea {
  transition:
    transform var(--transition),
    background-color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    color var(--transition),
    opacity var(--transition);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(29, 112, 104, 0.18);
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.04;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 48px);
  line-height: 1.06;
}

h3 {
  line-height: 1.15;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(14, 11, 9, 0.74), rgba(14, 11, 9, 0.82)),
    linear-gradient(135deg, rgba(182, 78, 44, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(29, 112, 104, 0.16), transparent 38%),
    url("assets/card-03.svg") center / min(54vw, 620px) no-repeat;
  backdrop-filter: blur(14px);
}

.access-gate.is-open {
  opacity: 0;
  pointer-events: none;
}

.gate-panel {
  position: relative;
  overflow: hidden;
  width: min(600px, 100%);
  padding: 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(150deg, rgba(255, 248, 240, 0.95), rgba(248, 239, 226, 0.92)),
    repeating-linear-gradient(90deg, rgba(23, 19, 17, 0.02) 0, rgba(23, 19, 17, 0.02) 1px, transparent 1px, transparent 128px);
  box-shadow: var(--shadow-panel);
}

.gate-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--jade) 100%);
}

.gate-orb {
  position: absolute;
  inset: -120px -80px auto auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(182, 78, 44, 0.22) 0%, rgba(182, 78, 44, 0) 70%);
  pointer-events: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--jade));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 18px 34px rgba(23, 19, 17, 0.22);
  font-size: 30px;
  font-weight: 800;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  margin: 0;
  border-radius: 14px;
  font-size: 20px;
}

.gate-copy,
.hint,
.card-meta,
.detail-meta,
.recent-item p,
#resultCount,
.queue-hint,
.image-panel-note,
.detail-paragraph,
.detail-no-image,
.empty-state p,
.section-head > p,
.filter-intro {
  color: var(--muted);
}

.access-form {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.access-code-field {
  display: grid;
  gap: 10px;
}

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

.login-grid label,
.search-field,
.compact-select,
.form-grid label,
.editor-panel > label {
  display: grid;
  gap: 10px;
}

.login-grid label span,
.search-field span,
.compact-select span,
.form-grid label span,
.editor-panel > label span,
.image-panel-eyebrow,
.detail-label,
.taxonomy-hint,
#resultCount,
.form-status {
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(112, 88, 65, 0.2);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--ink);
  background: rgba(255, 251, 247, 0.92);
}

select {
  appearance: none;
  padding-right: 42px;
  color: var(--ink);
  background-color: rgba(255, 252, 247, 0.98);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color-scheme: light;
}

select option,
optgroup {
  color: var(--ink);
  background: var(--surface-3);
}

textarea {
  resize: vertical;
  line-height: 1.72;
}

#descriptionInput {
  min-height: 340px;
}

#noteInput {
  min-height: 190px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(145, 52, 23, 0.3);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(29, 112, 104, 0.58);
}

.login-button,
.primary-button,
.secondary-button,
.admin-entry,
.logout-button,
.search-button,
.manage-action,
.close-button,
.image-chip-button,
.detail-expand {
  border: 0;
  border-radius: 16px;
  font-weight: 800;
}

.login-button,
.primary-button,
.search-button {
  min-height: 52px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--jade) 100%);
  box-shadow: 0 18px 34px rgba(23, 19, 17, 0.18);
}

.login-button:hover,
.primary-button:hover,
.search-button:hover,
.admin-entry.is-return:hover {
  transform: translateY(-2px);
}

.secondary-button,
.manage-action,
.logout-button,
.image-chip-button,
.detail-expand {
  min-height: 46px;
  padding: 0 18px;
  color: var(--ink);
  border: 1px solid rgba(128, 94, 60, 0.18);
  background: rgba(255, 250, 245, 0.9);
}

.admin-entry,
.logout-button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink-soft);
  border: 1px solid rgba(130, 101, 74, 0.18);
  background: rgba(255, 251, 247, 0.82);
  font-size: 13px;
}

.admin-entry.is-return {
  background: linear-gradient(135deg, var(--accent), var(--jade));
  border-color: transparent;
}

.manage-action {
  min-height: 52px;
  color: var(--jade);
  background: rgba(29, 112, 104, 0.1);
}

.danger-action {
  color: #a14d3f;
  background: rgba(161, 77, 63, 0.1);
}

.search-button {
  min-width: 120px;
  padding: 0 20px;
}

.close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--ink);
  border: 1px solid rgba(128, 94, 60, 0.18);
  background: rgba(255, 250, 245, 0.92);
  font-size: 26px;
  line-height: 1;
}

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

.app-shell {
  min-height: 100vh;
}

.app-shell.is-locked {
  max-height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1740px, calc(100% - 30px));
  margin: 16px auto 0;
  padding: 16px 22px;
  border: 1px solid rgba(130, 101, 74, 0.16);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.94), rgba(246, 237, 225, 0.9));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 18px;
}

.brand-copy span {
  color: rgba(91, 77, 66, 0.72);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-badge {
  max-width: 180px;
  overflow: hidden;
  padding: 9px 12px;
  border: 1px solid rgba(130, 101, 74, 0.16);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 251, 247, 0.82);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  width: min(1740px, calc(100% - 30px));
  margin: 18px auto 38px;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.gallery-workspace {
  position: relative;
  min-height: calc(100vh - 160px);
  padding-left: 92px;
}

.filter-drawer {
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  width: min(432px, calc(100vw - 12px));
  transform: translate3d(calc(-100% + 76px), -50%, 0);
  transition:
    transform 240ms ease,
    box-shadow 240ms ease;
}

.filter-drawer:hover,
.filter-drawer:focus-within {
  transform: translate3d(0, -50%, 0);
}

.filter-peek-tab {
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: center;
  width: 76px;
  min-height: 176px;
  margin-left: -1px;
  padding: 18px 12px;
  border: 1px solid rgba(130, 101, 74, 0.18);
  border-left: 0;
  border-radius: 0 24px 24px 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(245, 235, 223, 0.98)),
    repeating-linear-gradient(0deg, rgba(31, 24, 20, 0.02) 0, rgba(31, 24, 20, 0.02) 1px, transparent 1px, transparent 28px);
  box-shadow: 0 18px 36px rgba(58, 40, 25, 0.12);
  text-align: center;
}

.filter-peek-en {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-peek-tab strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.filter-band {
  position: relative;
  flex: 1;
  overflow: auto;
  max-height: calc(100vh - 160px);
  padding: 28px 24px 26px;
  border: 1px solid rgba(130, 101, 74, 0.18);
  border-right: 0;
  border-radius: 0 32px 32px 0;
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(247, 239, 228, 0.98)),
    repeating-linear-gradient(90deg, rgba(31, 24, 20, 0.018) 0, rgba(31, 24, 20, 0.018) 1px, transparent 1px, transparent 120px);
  box-shadow: var(--shadow-panel);
}

.filter-band::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(166, 100, 67, 0.92) 0%, rgba(182, 154, 108, 0.78) 52%, rgba(104, 139, 132, 0.92) 100%);
}

.filter-title h2,
.filter-title p,
.filter-band .compact-select span,
.filter-band .search-field span {
  color: var(--ink);
}

.filter-title .eyebrow {
  color: var(--accent);
}

.filter-intro {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.78;
}

.filter-group {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.filter-chips,
.search-row {
  display: grid;
  gap: 14px;
}

.filter-band input,
.filter-band select {
  border-color: rgba(130, 101, 74, 0.18);
  color: var(--ink);
  background: rgba(255, 252, 248, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color-scheme: light;
}

.filter-band input::placeholder {
  color: var(--muted-2);
}

.filter-band select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
}

.gallery-panel {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 160px);
  padding: 30px;
  border: 1px solid rgba(130, 101, 74, 0.16);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(247, 239, 229, 0.98)),
    repeating-linear-gradient(90deg, rgba(31, 24, 20, 0.018) 0, rgba(31, 24, 20, 0.018) 1px, transparent 1px, transparent 130px);
  box-shadow: var(--shadow-panel);
}

.gallery-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--jade) 100%);
}

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

.section-head.compact {
  align-items: center;
  margin-bottom: 26px;
}

.gallery-head h2 {
  font-size: clamp(34px, 4vw, 56px);
}

#resultCount,
.form-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(128, 94, 60, 0.16);
  border-radius: 999px;
  background: rgba(255, 251, 247, 0.92);
  color: var(--ink-soft);
}

.idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 26px;
}

.idea-card,
.idea-card > button {
  width: 100%;
}

.idea-card > button {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(128, 94, 60, 0.16);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 253, 250, 1), rgba(244, 235, 223, 0.98));
  box-shadow: 0 24px 46px rgba(23, 19, 17, 0.12);
  text-align: left;
}

.idea-card > button:hover {
  transform: translateY(-5px) rotate(-0.4deg);
  box-shadow: 0 30px 56px rgba(23, 19, 17, 0.18);
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, rgba(104, 139, 132, 0.08), rgba(166, 100, 67, 0.1));
}

.card-image-wrap img,
.no-image-card {
  width: 100%;
  height: 100%;
}

.card-image-wrap img {
  object-fit: cover;
}

.no-image-card {
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
  background:
    repeating-linear-gradient(45deg, rgba(23, 19, 17, 0.03) 0, rgba(23, 19, 17, 0.03) 10px, transparent 10px, transparent 20px),
    linear-gradient(135deg, rgba(104, 139, 132, 0.08), rgba(166, 100, 67, 0.08));
}

.latest-flag,
.image-count,
.existing-image-stage-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.latest-flag {
  top: 16px;
  left: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 20px rgba(166, 100, 67, 0.24);
}

.image-count {
  right: 16px;
  bottom: 16px;
  color: #fff;
  background: rgba(31, 24, 20, 0.58);
}

.card-body {
  display: grid;
  grid-template-rows: minmax(3.18em, auto) auto;
  align-content: start;
  gap: 12px;
  min-height: 144px;
  padding: 18px 18px 20px;
  background: linear-gradient(180deg, rgba(52, 40, 33, 0.92), rgba(34, 26, 21, 0.98));
}

.card-body h3 {
  margin: 0;
  color: #fff6ef;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 22px;
  line-height: 1.22;
}

.card-meta {
  margin: 0;
  align-self: end;
  color: rgba(255, 246, 239, 0.72);
  font-size: 13px;
  line-height: 1.6;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 42px 24px;
  border: 1px dashed rgba(128, 94, 60, 0.22);
  border-radius: 26px;
  background: rgba(255, 251, 247, 0.7);
  text-align: center;
}

.empty-state h3,
.empty-state p {
  margin-bottom: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.68fr);
  gap: 20px;
}

.editor-panel {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(247, 239, 229, 0.98), rgba(255, 250, 242, 0.98)),
    repeating-linear-gradient(90deg, rgba(23, 19, 17, 0.018) 0, rgba(23, 19, 17, 0.018) 1px, transparent 1px, transparent 128px);
  box-shadow: var(--shadow-panel);
}

.editor-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--jade) 0%, var(--accent) 100%);
}

.queue-panel {
  position: sticky;
  top: 104px;
  align-self: start;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(130, 101, 74, 0.16);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(247, 239, 229, 0.98)),
    radial-gradient(circle at top right, rgba(104, 139, 132, 0.14), transparent 34%);
  box-shadow: var(--shadow-panel);
}

.queue-panel .eyebrow,
.queue-panel h2,
.queue-panel .search-field span,
.queue-panel .queue-hint {
  color: var(--ink);
}

.queue-panel .queue-hint {
  color: var(--muted);
}

.queue-panel input {
  color: var(--ink);
  border-color: rgba(130, 101, 74, 0.18);
  background: rgba(255, 252, 247, 0.96);
}

.queue-panel input::placeholder {
  color: var(--muted-2);
}

.editor-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.form-status {
  white-space: nowrap;
}

.image-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
  margin-bottom: 18px;
}

.image-panel {
  display: grid;
  gap: 16px;
  min-height: 100%;
  padding: 20px;
  border: 1px solid rgba(128, 94, 60, 0.16);
  border-radius: 24px;
  background: rgba(255, 251, 247, 0.78);
}

.image-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.image-panel-copy {
  display: grid;
  gap: 4px;
}

.image-panel-copy h3 {
  margin: 0;
  font-size: 26px;
}

.image-panel-eyebrow {
  margin: 0;
  color: var(--accent);
}

.image-panel-note {
  margin: 0;
  line-height: 1.72;
}

.existing-image-stage {
  min-height: 450px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(128, 94, 60, 0.16);
  background: linear-gradient(180deg, rgba(242, 231, 217, 0.9), rgba(255, 250, 242, 0.98));
}

.existing-image-empty,
.image-preview-empty,
.detail-no-image {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 26px;
  text-align: center;
}

.existing-image-stage-button,
.image-preview-open {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
}

.existing-image-stage-button img {
  width: 100%;
  height: 448px;
  object-fit: contain;
}

.existing-image-stage-badge {
  left: 16px;
  bottom: 16px;
  color: #fff;
  background: rgba(23, 19, 17, 0.6);
}

.existing-image-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
}

.existing-image-thumb {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(128, 94, 60, 0.16);
  border-radius: 16px;
  background: rgba(255, 250, 245, 0.82);
}

.existing-image-thumb.is-active {
  border-color: rgba(29, 112, 104, 0.44);
  box-shadow: 0 0 0 3px rgba(29, 112, 104, 0.12);
}

.existing-image-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

.existing-image-thumb span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.image-uploader-panel {
  align-content: start;
}

.image-uploader {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 250px;
  padding: 30px;
  border: 1px dashed rgba(128, 94, 60, 0.24);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 250, 245, 0.96), rgba(248, 239, 228, 0.84));
  text-align: center;
}

.image-uploader input {
  display: none;
}

.image-uploader span {
  color: var(--jade);
  font-size: 36px;
  font-weight: 800;
}

.image-uploader strong {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.72;
}

.image-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.image-preview-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(128, 94, 60, 0.16);
  border-radius: 18px;
  background: rgba(255, 250, 245, 0.9);
}

.image-preview-open img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
}

.image-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-chip-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}

.editor-panel > label {
  margin-top: 18px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

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

.admin-search-field input {
  min-height: 48px;
}

.queue-hint {
  margin: 0 0 18px;
  line-height: 1.72;
}

.recent-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 250px);
  overflow: auto;
  padding-right: 4px;
}

.recent-item {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(130, 101, 74, 0.14);
  border-radius: 22px;
  background: rgba(255, 251, 247, 0.86);
  text-align: left;
}

.recent-item strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.22;
}

.recent-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.recent-item:hover,
.recent-item.is-active {
  border-color: rgba(166, 100, 67, 0.3);
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.96), rgba(245, 235, 224, 0.96));
  transform: translateY(-1px);
}

.taxonomy-dialog,
.detail-dialog,
.image-viewer-dialog {
  border: 0;
  padding: 0;
}

.taxonomy-dialog {
  width: min(760px, calc(100vw - 32px));
  border-radius: 30px;
  background: transparent;
}

.taxonomy-dialog::backdrop,
.detail-dialog::backdrop {
  background: rgba(10, 8, 7, 0.66);
  backdrop-filter: blur(10px);
}

.taxonomy-dialog-content {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(247, 239, 229, 0.98), rgba(255, 250, 242, 0.98));
  box-shadow: var(--shadow-panel);
}

.taxonomy-dialog-content::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--jade) 0%, var(--accent) 100%);
}

.taxonomy-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 18px;
}

.dialog-list {
  display: grid;
  gap: 12px;
  max-height: min(56vh, 520px);
  overflow: auto;
}

.taxonomy-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(128, 94, 60, 0.22);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 251, 247, 0.8);
  text-align: center;
}

.taxonomy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(128, 94, 60, 0.16);
  border-radius: 18px;
  background: rgba(255, 250, 245, 0.9);
}

.taxonomy-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 18px;
}

.taxonomy-item span {
  color: var(--muted);
  font-size: 13px;
}

.taxonomy-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.taxonomy-item-actions button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(128, 94, 60, 0.16);
  border-radius: 999px;
  background: rgba(255, 251, 247, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.detail-dialog {
  width: min(1880px, calc(100vw - 20px));
  max-width: none;
  height: min(93vh, 1120px);
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(17, 13, 11, 0.98), rgba(9, 8, 7, 0.98));
  box-shadow: var(--shadow-panel);
}

#detailContent {
  height: 100%;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(360px, 0.76fr);
  height: 100%;
}

.detail-gallery-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.detail-gallery-stage {
  min-height: 0;
  overflow: hidden;
  padding: 34px 34px 10px;
}

.detail-gallery {
  display: flex;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: visible;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.detail-gallery::-webkit-scrollbar {
  display: none;
}

.detail-slide {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  flex: 0 0 100%;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(35, 28, 24, 0.92), rgba(20, 16, 14, 0.98));
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.detail-image-button {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(31, 24, 20, 0.7), rgba(14, 11, 9, 0.7));
}

.detail-slide img {
  width: 100%;
  height: min(68vh, 780px);
  object-fit: contain;
}

.detail-slide figcaption {
  display: none;
}

.detail-gallery-controls {
  display: grid;
  gap: 14px;
  padding: 8px 34px 28px;
}

.detail-gallery-navrow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  width: min(520px, calc(100% - 84px));
  justify-self: center;
}

.detail-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(216, 172, 127, 0.42);
  border-radius: 999px;
  background: rgba(255, 247, 238, 0.08);
  color: #fff3e5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.detail-nav-button span {
  font-size: 36px;
  line-height: 1;
  transform: translateY(-2px);
}

.detail-nav-button:disabled {
  opacity: 0.34;
}

.detail-nav-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 247, 238, 0.14);
}

.detail-gallery-status {
  display: grid;
  width: min(760px, 100%);
  justify-self: center;
}

.detail-slider {
  min-height: auto;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  appearance: none;
}

.detail-gallery-count {
  margin: 0;
  color: rgba(255, 242, 230, 0.82);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.detail-slider::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 244, 232, 0.18);
}

.detail-slider::-webkit-slider-thumb {
  width: 112px;
  height: 14px;
  margin-top: 0;
  border: 2px solid rgba(77, 49, 27, 0.24);
  border-radius: 999px;
  background: linear-gradient(180deg, #f2c58f, #c68954);
  box-shadow: 0 8px 16px rgba(164, 104, 60, 0.3);
  appearance: none;
  cursor: ew-resize;
}

.detail-slider::-moz-range-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 244, 232, 0.18);
}

.detail-slider::-moz-range-thumb {
  width: 112px;
  height: 14px;
  border: 2px solid rgba(77, 49, 27, 0.24);
  border-radius: 999px;
  background: linear-gradient(180deg, #f2c58f, #c68954);
  box-shadow: 0 8px 16px rgba(164, 104, 60, 0.3);
  cursor: ew-resize;
}

.detail-copy {
  height: 100%;
  overflow-y: auto;
  padding: 48px 52px 48px 34px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(248, 239, 228, 0.98), rgba(255, 251, 245, 0.98));
}

.detail-copy h2 {
  margin-bottom: 16px;
  font-size: clamp(36px, 3.2vw, 64px);
}

.detail-meta {
  margin-bottom: 28px;
  font-size: 16px;
}

.detail-block {
  padding-top: 24px;
  border-top: 1px solid rgba(128, 94, 60, 0.14);
}

.detail-block + .detail-block {
  margin-top: 28px;
}

.detail-label {
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 22px;
}

.detail-text-wrap {
  display: grid;
  gap: 14px;
}

.detail-richtext {
  position: relative;
  font-size: 18px;
  line-height: 1.92;
}

.detail-richtext.is-collapsed {
  max-height: 310px;
  overflow: hidden;
}

.detail-richtext.is-collapsed::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 96px;
  background: linear-gradient(180deg, rgba(255, 251, 245, 0), rgba(255, 251, 245, 1));
}

.detail-paragraph {
  margin: 0;
}

.detail-paragraph + .detail-paragraph {
  margin-top: 18px;
}

.detail-expand {
  justify-self: start;
  min-height: 40px;
  padding: 0 16px;
  color: var(--jade);
}

.image-viewer-dialog {
  width: min(96vw, 1840px);
  max-width: none;
  background: transparent;
}

.image-viewer-dialog::backdrop {
  background: rgba(7, 7, 8, 0.84);
  backdrop-filter: blur(10px);
}

.image-viewer-stage {
  display: grid;
  place-items: center;
  min-height: 82vh;
  padding: 40px;
}

.image-viewer-stage img {
  width: 100%;
  max-width: 1640px;
  max-height: calc(82vh - 80px);
  object-fit: contain;
}

.image-viewer-close {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(20, 20, 20, 0.72);
}

@media (max-width: 1180px) {
  .admin-layout,
  .image-editor-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .gallery-workspace {
    padding-left: 0;
  }

  .filter-drawer {
    position: static;
    display: block;
    width: 100%;
    max-width: none;
    margin-bottom: 20px;
    transform: none;
  }

  .filter-peek-tab {
    display: none;
  }

  .filter-band,
  .queue-panel {
    position: static;
    max-height: none;
  }

  .filter-band {
    border-right: 1px solid rgba(130, 101, 74, 0.18);
    border-radius: var(--radius-lg);
  }

  .detail-copy {
    padding: 26px 28px 32px;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
}

@media (max-width: 1040px) {
  .topbar,
  main {
    width: calc(100% - 20px);
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .access-gate {
    padding: 16px;
  }

  .gate-panel {
    padding: 30px 22px;
  }

  .login-grid,
  .form-grid,
  .with-action,
  .taxonomy-add-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 14px 16px;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .gallery-panel,
  .filter-band,
  .editor-panel,
  .queue-panel {
    padding: 18px;
  }

  .idea-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .card-body h3 {
    font-size: 21px;
  }

  .search-row,
  .form-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .search-button,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .existing-image-stage {
    min-height: 320px;
  }

  .existing-image-stage-button img {
    height: 318px;
  }

  .image-uploader {
    min-height: 190px;
    padding: 18px;
  }

  .detail-dialog {
    width: calc(100vw - 8px);
    height: calc(100vh - 8px);
    border-radius: 24px;
  }

  .detail-gallery {
    padding: 0;
  }

  .detail-slide {
    padding: 14px;
  }

  .detail-slide img {
    height: min(48vh, 460px);
  }

  .detail-copy {
    padding: 18px 18px 24px;
  }

  .detail-gallery-controls {
    gap: 12px;
    padding: 12px 14px 20px;
  }

  .detail-gallery-navrow {
    gap: 12px;
    width: 100%;
  }

  .detail-nav-button {
    width: 44px;
    height: 44px;
  }

  .detail-nav-button span {
    font-size: 28px;
  }

  .detail-gallery-stage {
    padding: 64px 14px 10px;
  }

  .detail-slider::-webkit-slider-thumb {
    width: 72px;
  }

  .detail-slider::-moz-range-thumb {
    width: 72px;
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .user-badge {
    max-width: 120px;
  }

  .idea-grid {
    gap: 16px;
  }

  .gallery-head h2,
  .filter-title h2,
  .editor-panel h2,
  .queue-panel h2 {
    font-size: clamp(24px, 8vw, 34px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}

/* 20260518 feedback refinement start */
body {
  background: linear-gradient(180deg, #f7f1e8 0%, #efe5d8 100%);
}

.gate-panel,
.gallery-panel,
.editor-panel,
.queue-panel,
.taxonomy-dialog-content {
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(248, 241, 232, 0.98));
}

.filter-band {
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(248, 241, 232, 0.98));
}

.gate-panel::before,
.filter-band::before,
.gallery-panel::before,
.editor-panel::before,
.queue-panel::before,
.taxonomy-dialog-content::before {
  content: none;
  display: none;
}

.gallery-workspace {
  min-height: calc(100vh - 160px);
  padding: 0 58px;
}

.filter-drawer {
  top: 108px;
  bottom: 18px;
  left: 0;
  width: min(392px, calc(100vw - 10px));
  height: calc(100vh - 126px);
  align-items: stretch;
  transform: translate3d(calc(-100% + 58px), 0, 0);
  transition:
    transform 360ms cubic-bezier(0.2, 0.74, 0.18, 0.98),
    box-shadow 360ms cubic-bezier(0.2, 0.74, 0.18, 0.98);
}

.filter-drawer:hover,
.filter-drawer:focus-within {
  transform: translate3d(0, 0, 0);
}

.filter-peek-tab {
  align-self: center;
  width: 58px;
  min-height: 160px;
  padding: 16px 8px;
  border: 1px solid rgba(130, 101, 74, 0.16);
  border-left: 0;
  border-radius: 0 20px 20px 0;
  background: rgba(255, 251, 246, 0.98);
  box-shadow: 0 16px 30px rgba(58, 40, 25, 0.1);
  appearance: none;
}

.filter-peek-en {
  font-size: 10px;
}

.filter-peek-tab strong {
  font-size: 15px;
  line-height: 1.24;
}

.filter-band {
  height: 100%;
  min-height: 100%;
  max-height: none;
  padding: 34px 24px 28px;
  border-right: 0;
  border-radius: 0 28px 28px 0;
  box-shadow: 0 28px 56px rgba(58, 40, 25, 0.11);
}

.filter-title h2 {
  margin-bottom: 4px;
}

.filter-group {
  gap: 16px;
}

.filter-band input,
.filter-band select {
  min-height: 56px;
  color: var(--ink);
  border-color: rgba(130, 101, 74, 0.18);
  background: #fbf7f1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  color-scheme: light;
}

.filter-band input::placeholder {
  color: #a5968a;
}

.filter-band select {
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4.5L6 8L10 4.5' stroke='%23645447' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: calc(100% - 18px) 50%;
  background-size: 12px 12px;
  background-repeat: no-repeat;
}

.gallery-panel {
  box-shadow: 0 24px 52px rgba(58, 40, 25, 0.1);
}

@media (max-width: 1180px) {
  .gallery-workspace {
    padding: 0;
  }

  .filter-drawer {
    position: static;
    display: block;
    width: 100%;
    max-width: none;
    margin-bottom: 18px;
    transform: none;
  }

  .filter-peek-tab {
    display: none;
  }

  .filter-band {
    height: auto;
    border-right: 1px solid rgba(130, 101, 74, 0.18);
    border-radius: var(--radius-lg);
  }
}


/* 20260518 sticker pass start */
.brand-mark {
  background: #d9b7a4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 14px 28px rgba(116, 86, 62, 0.18);
}

.brand-mark.small {
  background: #d9b7a4;
}

.filter-peek-tab {
  width: 54px;
}

.filter-peek-tab strong {
  display: grid;
  gap: 2px;
  justify-items: center;
  font-size: 16px;
  line-height: 1.06;
}

.filter-peek-tab strong span {
  display: block;
}

.latest-flag {
  top: 13px;
  left: 13px;
  min-width: 58px;
  min-height: 58px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
  overflow: visible;
}

.latest-flag-burst {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(135deg, #ff9d5c, #ff6d4d);
  clip-path: polygon(50% 0%, 61% 16%, 79% 7%, 80% 27%, 98% 26%, 87% 42%, 100% 56%, 81% 60%, 88% 79%, 69% 75%, 64% 95%, 50% 82%, 36% 95%, 31% 75%, 12% 79%, 19% 60%, 0% 56%, 13% 42%, 2% 26%, 20% 27%, 21% 7%, 39% 16%);
  filter: drop-shadow(0 10px 18px rgba(187, 82, 44, 0.3));
  transform: rotate(-12deg);
}

.latest-flag::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1.5px dashed rgba(255, 248, 240, 0.68);
  border-radius: 50%;
  z-index: 1;
  transform: rotate(8deg);
}

.latest-flag-text {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 58px;
  color: #fffaf4;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 10px rgba(116, 40, 16, 0.22);
  transform: rotate(-10deg);
}

@media (max-width: 1180px) {
  .filter-peek-tab {
    width: 50px;
  }
}
/* 20260518 sticker pass end */



/* 20260518 sticker fix start */
.filter-peek-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.filter-peek-en {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding-left: 0.14em;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  white-space: nowrap;
}

.filter-peek-tab strong {
  width: 100%;
  gap: 4px;
  text-align: center;
  justify-items: center;
  align-items: center;
}

.idea-card > button {
  position: relative;
  overflow: visible;
}

.card-image-wrap {
  overflow: hidden;
  border-radius: 28px 28px 0 0;
}

.card-body {
  border-radius: 0 0 28px 28px;
}

.idea-card > button.has-latest::before,
.idea-card > button.has-latest::after {
  position: absolute;
  z-index: 6;
  pointer-events: none;
}

.idea-card > button.has-latest::before {
  content: "";
  top: -18px;
  left: -16px;
  width: 76px;
  height: 76px;
  background: linear-gradient(135deg, #ffb15f, #ff714f 58%, #ff5e63 100%);
  clip-path: polygon(50% 0%, 60% 14%, 77% 4%, 78% 22%, 97% 20%, 86% 37%, 100% 50%, 84% 58%, 93% 78%, 73% 74%, 67% 96%, 50% 82%, 33% 96%, 27% 74%, 7% 78%, 16% 58%, 0% 50%, 14% 37%, 3% 20%, 22% 22%, 23% 4%, 40% 14%);
  box-shadow: 0 14px 26px rgba(177, 74, 44, 0.28);
  transform: rotate(-14deg);
}

.idea-card > button.has-latest::after {
  content: "NEW";
  top: -18px;
  left: -16px;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fffaf4;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px rgba(118, 45, 19, 0.18);
  transform: rotate(-14deg);
}
/* 20260518 sticker fix end */

/* 20260518 feedback refinement end */
