:root {
  --ink: #19202a;
  --text: #19202a;
  --muted: #6d7480;
  --line: #dfe4ea;
  --paper: #ffffff;
  --wash: #f4f6f8;
  --primary: #548C00;
  --primary-dark: #8f141c;
  --gold: #d79a2b;
  --danger: #b9232e;
  --radius: 8px;
  --shadow: 0 10px 28px rgba(25, 32, 42, 0.06);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--wash);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.wrap {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(25, 32, 42, 0.05);
}

.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.compact-topbar {
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 50%;
  font-weight: 900;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.nav a,
button.nav-link-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

.nav a:hover,
button.nav-link-btn:hover {
  color: var(--primary);
  background: #fff1f2;
}

.nav-logout {
  margin: 0;
}

.nav button.perm-lock-btn {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.nav button.perm-lock-locked,
.nav button.perm-lock-locked:hover {
  color: #e25b2a;
  background: #fff3ee;
}

.nav button.perm-lock-unlocked,
.nav button.perm-lock-unlocked:hover {
  color: #0d8a72;
  background: #e7f7f3;
}

.nav-mobile-links {
  display: none;
}

.page {
  padding: 22px 0 44px;
}

.feedback-page,
.admin-page {
  display: grid;
  gap: 14px;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.feedback-page .panel,
.admin-page .panel {
  margin-top: 0;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title.tight {
  margin-bottom: 10px;
}

.section-title h1,
.section-title h2 {
  font-size: 20px;
  line-height: 1.25;
}

.feedback-nav-row {
  display: grid;
  grid-template-columns: repeat(var(--nav-cols, 3), minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background: #FFDAC8;
  border: 2px solid #FF8F59;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.feedback-nav-row a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  color: #7a1a20;
  border-right: 1px solid #fff;
  overflow: hidden;
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-nav-row a:hover {
  background: #fff;
}

.feedback-nav-row a:last-child {
  border-right: 0;
}

.feedback-hero {
  padding: 22px 16px;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.feedback-hero h1 {
  margin: 0;
  color: #7a1a20;
  font-size: 22px;
  line-height: 1.2;
}

.feedback-compose form,
.feedback-admin-panel,
.login-card form {
  display: grid;
  gap: 12px;
}

.login-card {
  justify-self: center;
  width: min(460px, 100%);
  margin-top: 20px;
}

.login-card h2 {
  color: #7a1a20;
  font-size: 22px;
}

.feedback-content-field,
.feedback-user-row label,
.feedback-status-filter,
.login-card label,
.feedback-reply-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.feedback-content-field textarea,
.feedback-reply-field textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
}

.feedback-content-field textarea {
  min-height: 190px;
}

.feedback-photo-field {
  position: relative;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.photo-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px dashed #c5ccd6;
  border-radius: 6px;
  background: #ffffff;
}

.photo-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

button.photo-pick {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #c5ccd6;
  border-radius: 4px;
  background: #f3f4f6;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.photo-names {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.feedback-photo-field em {
  min-height: 0;
  color: var(--primary);
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
}

.feedback-photo-field em:empty {
  display: none;
}

.photo-preview,
.feedback-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-preview:empty,
.feedback-photos:empty {
  display: none;
}

.photo-preview img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.feedback-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.feedback-photos {
  margin-top: 8px;
}

.feedback-question .feedback-photos {
  grid-column: 2;
  flex-wrap: nowrap;
}

.feedback-photos button.photo-thumb {
  position: relative;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  min-height: 88px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
  cursor: zoom-in;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 16px;
  background: rgba(0, 0, 0, 0.72);
}

.photo-lightbox[hidden] {
  display: none;
}

.photo-lightbox img {
  max-width: min(920px, 100%);
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.photo-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.feedback-reply-field textarea {
  min-height: 96px;
  padding: 10px;
}

.feedback-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.feedback-user-row input,
.feedback-status-filter select,
.feedback-reply-field input,
.login-card input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.feedback-status-filter {
  max-width: 240px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(180, 32, 42, 0.18);
  border-color: var(--primary);
}

input::placeholder,
textarea::placeholder {
  color: #9aa1ab;
}

button,
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--primary);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.feedback-compose form > button,
.login-card form > button {
  width: 100%;
}

.login-card form > button {
  min-height: 56px;
  margin-top: 6px;
  font-size: 20px;
}

.login-card {
  width: min(640px, 100%);
  margin-top: 48px;
  padding: 36px 40px 32px;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 32px;
}

.login-card form {
  gap: 18px;
}

.login-card label {
  gap: 8px;
  font-size: 16px;
}

.login-card input {
  min-height: 56px;
  padding: 0 16px;
  font-size: 18px;
}

.login-captcha-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-captcha-row b {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
}

.login-captcha-row input {
  width: auto;
  flex: 1 1 140px;
  min-width: 0;
}

.button.secondary,
button.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

button.danger {
  background: var(--danger);
}

.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.button.is-disabled,
button:disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.alert {
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 700;
}

.alert.ok {
  color: #0f5f3f;
  background: #e7f7ef;
}

.alert.error {
  color: #8f141c;
  background: #fff1f2;
}

.empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.feedback-list,
.feedback-admin-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.feedback-item,
.feedback-admin-item {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 10px 12px;
}

.admin-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-fold {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 14px;
  border-bottom: 1px solid var(--line);
}

.admin-tabs a {
  margin-bottom: -1px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.admin-tabs a.is-on {
  color: #1677ff;
  border-bottom: 2px solid #1677ff;
}

.layout-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

textarea.layout-html {
  width: 100%;
  min-height: 560px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  white-space: pre;
  tab-size: 2;
}

.layout-links {
  display: grid;
  gap: 8px;
}

.layout-link {
  display: grid;
  grid-template-columns: 28px 180px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.layout-link b {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.layout-link input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e8e8e8;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.admin-table th {
  color: #666;
  font-size: 13px;
  font-weight: 700;
  background: #fafafa;
}

.admin-table tbody tr:hover {
  background: #fafafa;
}

.admin-table .col-check {
  width: 46px;
  text-align: center;
}

.admin-table .col-no {
  width: 72px;
  color: var(--muted);
  font-weight: 700;
}

.admin-table input[type="checkbox"],
.admin-batch input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #548C00;
  cursor: pointer;
}

.admin-batch {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.admin-batch label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.admin-table .admin-title {
  color: var(--ink);
  font-weight: 700;
}

.admin-table button.row-toggle {
  min-height: 0;
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.admin-table button.row-toggle:hover {
  color: #1677ff;
}

.admin-table tr.admin-expand {
  display: none;
}

.admin-table tr.admin-expand.is-open {
  display: table-row;
}

.admin-table tr.is-open td {
  border-bottom-color: transparent;
  background: #f7f9fb;
}

.admin-table tr.admin-expand td {
  padding-top: 0;
  background: #f7f9fb;
}

.admin-expand-box {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.admin-expand-body {
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
}

.admin-expand-box .feedback-photos a {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.admin-expand-box textarea {
  min-height: 88px;
}

.admin-expand-actions button {
  min-width: 96px;
}

.admin-ops {
  white-space: nowrap;
}

.admin-ops a.button,
.admin-ops button.op-reply,
.admin-ops button.op-del {
  min-height: 28px;
  margin-right: 6px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.admin-ops a.op-view {
  color: #1677ff;
  background: #e8f3ff;
  border-color: #c5ddff;
}

.admin-ops a.op-edit {
  color: #b8860b;
  background: #fff6df;
  border-color: #f3ddaa;
}

.admin-ops a.op-reply,
.admin-ops button.op-reply {
  color: #168b56;
  background: #e8f8ef;
  border-color: #bfe8d0;
}

.admin-ops button.op-del {
  margin-right: 0;
  color: #548C00;
  background: #fdecee;
  border-color: #f3c5ca;
}

.admin-ops form {
  display: inline;
  margin: 0;
}

.admin-back {
  margin-bottom: 12px;
}

.admin-back a {
  color: #1677ff;
  font-weight: 700;
}

.admin-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-detail-head h3 {
  margin: 0;
  font-size: 18px;
}

.admin-detail-body,
.admin-detail-reply {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  line-height: 1.7;
}

.admin-detail-body {
  background: #ECFFFF;
}

.admin-detail-reply {
  margin-top: 10px;
  background: #FFF3EE;
}

.admin-detail-reply strong {
  display: inline-block;
  margin-right: 8px;
  color: #276a46;
}

.admin-detail-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.feedback-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.feedback-qa {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
  align-items: start;
}

.feedback-qa > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  color: #ffffff;
  background: #548C00;
  border-radius: 6px;
  font-weight: 900;
}

.feedback-answer > span {
  background: #ff00ff;
}

.feedback-qa p {
  margin: 0;
  padding: 7px 10px;
  min-height: 30px;
  color: var(--text);
  background: #ECFFFF;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.feedback-answer p {
  background: #FFF3EE;
}

.feedback-admin-item .feedback-reply-field {
  margin-top: 0;
}

.feedback-admin-item textarea {
  min-height: 88px;
}

.feedback-count,
.feedback-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  color: #7a1a20;
  background: #ffe36e;
  border-radius: 6px;
  font-weight: 900;
  white-space: nowrap;
}

.feedback-status.status-approved {
  color: #0f5f3f;
  background: #e7f7ef;
}

.feedback-status.status-rejected {
  color: #8f141c;
  background: #fff1f2;
}

.feedback-pager,
.feedback-admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.feedback-pager {
  justify-content: center;
  margin-top: 14px;
}

.feedback-admin-actions {
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.feedback-admin-actions button {
  flex: 0 0 auto;
  min-width: 96px;
}

.footer {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
  font-size: 14px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 720px) {
  .wrap {
    width: min(100% - 12px, 1180px);
  }

  .feedback-page > *,
  .admin-page > * {
    min-width: 0;
  }

  .topbar-inner {
    align-items: stretch;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
  }

  .nav {
    margin: 0;
    padding: 0;
    width: 100%;
  }

  .nav > a {
    flex: 0 0 auto;
  }

  .nav-mobile-links {
    display: grid;
    grid-template-columns: repeat(var(--nav-cols, 4), minmax(0, 1fr));
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .nav .nav-mobile-links a {
    min-width: 0;
    min-height: 34px;
    justify-content: center;
    padding: 0 4px;
    border-radius: 0;
    border-right: 1px solid #d5dbe3;
    color: #7a1a20;
    background: transparent;
    overflow: hidden;
    font-size: clamp(11px, 2.8vw, 14px);
    font-weight: 900;
    text-overflow: ellipsis;
  }

  .nav .nav-mobile-links a:last-child {
    border-right: 0;
  }

  .nav .nav-mobile-links a:hover {
    color: #7a1a20;
    background: #f7f8fa;
  }

  .section-title {
    flex-direction: column;
    gap: 4px;
  }

  .section-title h2 {
    font-size: 24px;
  }

  .feedback-nav-row a {
    font-size: clamp(12px, 3.4vw, 15px);
    padding: 0 4px;
  }

  .feedback-item-head {
    display: grid;
    gap: 4px;
  }

  .feedback-item-head,
  .head-left {
    align-items: flex-start;
  }

  .admin-row {
    flex-wrap: wrap;
  }

  .admin-title {
    flex: 1 1 100%;
  }

  .admin-time {
    margin-right: auto;
  }

  .feedback-admin-actions button,
  .feedback-admin-actions .button {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
  }

  .layout-link {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .layout-link input[name="nav_href[]"] {
    grid-column: 2;
  }
}

@media (max-width: 480px) {
  .feedback-question .feedback-photos {
    grid-column: 1 / -1;
  }

  .feedback-photos button.photo-thumb {
    flex: 0 1 88px;
    width: 88px;
    max-width: 88px;
    height: auto;
    aspect-ratio: 1;
    min-height: 0;
  }
}
