:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --text: #172331;
  --muted: #637082;
  --line: #dbe3ec;
  --primary: #167a6b;
  --primary-strong: #0e5f54;
  --primary-soft: #e3f4f0;
  --accent: #3a6ea5;
  --danger: #b42318;
  --warning: #a15c07;
  --shadow: 0 16px 40px rgba(24, 38, 54, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.app-shell-user {
  width: 100%;
  padding: 24px 32px 48px;
}

.app-shell-admin {
  width: 100%;
  min-width: 1180px;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.app-shell.app-shell-admin {
  width: 100%;
  min-width: 1180px;
  padding: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

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

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 800;
}

.brand h1,
.brand p,
.ops-sidebar h2,
.ops-heading h2,
.intro-panel h2,
.login-panel h2,
.dictionary-main h2 {
  margin: 0;
}

.brand h1 {
  font-size: 21px;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.nav-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nav-tabs button,
.side-link {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.nav-tabs button {
  padding: 8px 14px;
}

.nav-tabs button.active,
.side-link.active {
  background: var(--primary);
  color: #fff;
}

.content-grid {
  display: grid;
  gap: 20px;
}

.submit-grid {
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
}

.submit-grid-direct {
  grid-template-columns: minmax(0, 1fr);
}

.panel,
.ops-sidebar,
.ops-main,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.section-kicker {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.intro-panel {
  position: sticky;
  top: 20px;
}

.intro-panel p {
  color: var(--muted);
}

.success-box {
  display: grid;
  gap: 4px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid #a7d8ca;
  border-radius: 8px;
  background: var(--primary-soft);
}

.submit-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 20;
  width: min(560px, calc(100% - 32px));
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 13px 16px;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.submit-toast.success {
  border: 1px solid #a7d8ca;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.submit-toast.error {
  border: 1px solid #f4b4ae;
  background: #fff1f0;
  color: var(--danger);
}

.submit-success-modal {
  display: grid;
  gap: 18px;
  width: min(360px, 100%);
  padding: 28px 24px 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  text-align: center;
}

.submit-success-modal strong {
  color: var(--primary-strong);
  font-size: 20px;
}

.submit-success-modal .primary-btn {
  justify-self: center;
  min-width: 112px;
}

.success-box span,
.metric-strip span,
.row-main small,
.detail-title p,
.demo-note {
  color: var(--muted);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.metric-strip div,
.summary-item {
  display: grid;
  gap: 2px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.metric-strip strong,
.summary-item strong {
  font-size: 22px;
}

.feedback-form {
  display: grid;
  gap: 18px;
}

.feedback-form-direct {
  gap: 20px;
  align-content: start;
}

.submit-grid-direct .feedback-form {
  width: 100%;
  justify-self: stretch;
}

.form-section {
  display: grid;
  gap: 18px;
}

.form-section-main {
  grid-template-columns: 1fr;
}

.form-section-contact {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.form-title h2 {
  margin: 0;
  font-size: 22px;
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-label {
  font-weight: 700;
}

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

.field-row-top {
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  align-items: start;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 118px;
  resize: vertical;
  padding: 11px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 122, 107, 0.14);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: 8px;
}

.choice {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.choice.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
}

.upload-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 12px;
  border: 1px dashed #a8b7c7;
  border-radius: 8px;
  background: #fbfdff;
}

.upload-box input {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.image-list,
.detail-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-preview,
.detail-images a {
  overflow: hidden;
  width: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.image-preview img,
.detail-images img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
}

.image-preview button {
  width: 100%;
  height: 30px;
  border: 0;
  background: #fff;
  color: var(--danger);
}

.form-actions,
.ops-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.primary-btn,
.ghost-btn {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
}

.primary-btn {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.ghost-btn.small {
  min-height: 32px;
  padding: 0 10px;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
}

.login-wrap {
  display: grid;
  min-height: 58vh;
  place-items: center;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-width: 1180px;
  min-height: 100vh;
  background: #f3f5f9;
}

.admin-sidebar {
  display: grid;
  align-content: start;
  min-height: 100vh;
  background: #1d2d34;
  color: #d7e0e4;
}

.admin-sidebar-title {
  padding: 46px 24px 28px;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.admin-sidebar-line {
  height: 1px;
  margin: 0 22px 42px;
  background: rgba(255, 255, 255, 0.62);
}

.admin-menu {
  display: grid;
  gap: 0;
}

.admin-menu-item {
  height: 52px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  padding: 0 22px;
}

.admin-menu-item.active {
  background: #657983;
  color: #fff;
}

.admin-stage {
  min-width: 0;
  background: #f3f5f9;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 28px 0 34px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.06);
}

.admin-top-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 18px;
  border-radius: 3px;
  background: #1d2d34;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.admin-user-menu {
  position: relative;
  display: inline-flex;
  outline: none;
}

.admin-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #4b5563;
  font-size: 18px;
  font-weight: 700;
  padding: 8px 0 8px 12px;
  cursor: default;
}

.admin-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #c8c8c8;
  color: #fff;
  font-size: 25px;
  line-height: 1;
}

.admin-user-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 25;
  min-width: 118px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.admin-user-menu:hover .admin-user-popover,
.admin-user-menu:focus-within .admin-user-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.admin-user-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 22px;
  width: 12px;
  height: 12px;
  border-top: 1px solid #e5e7eb;
  border-left: 1px solid #e5e7eb;
  background: #fff;
  transform: rotate(45deg);
}

.admin-user-popover button {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #1f2933;
  font-weight: 700;
  text-align: center;
}

.admin-user-popover button:hover,
.admin-user-popover button:focus {
  background: #f1f5f9;
  outline: none;
}

.admin-content {
  min-width: 0;
  padding: 34px;
  overflow-x: hidden;
}

.admin-content .ops-main {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-content .dictionary-main {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.admin-filter-card,
.admin-table-card {
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.04);
}

.admin-filter-card {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid #d9dde3;
}

.admin-filter-card .search-input {
  flex: 1 1 260px;
}

.admin-filter-card select {
  flex: 1 1 150px;
}

.admin-filter-card input,
.admin-filter-card select {
  height: 36px;
  border-radius: 6px;
  color: #374151;
}

.admin-search-btn,
.admin-clear-btn {
  height: 36px;
  border-radius: 6px;
  padding: 0 18px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-search-btn {
  border: 1px solid #1d2d34;
  background: #1d2d34;
  color: #fff;
}

.admin-clear-btn {
  border: 1px solid #1d2d34;
  background: #fff;
  color: #1d2d34;
}

.admin-table-card {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.admin-data-table {
  min-width: 1080px;
  border-collapse: collapse;
  background: #fff;
}

.admin-data-table th,
.admin-data-table td {
  height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid #edf0f3;
  color: #242b32;
  font-size: 15px;
  text-align: center;
  vertical-align: middle;
}

.admin-data-table th {
  height: 58px;
  background: #fff;
  color: #1f252b;
  font-weight: 800;
}

.admin-data-table tr.selected td {
  background: #f7fafb;
}

.admin-text-cell {
  max-width: 280px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 26px;
  border-radius: 999px;
  background: #eef3f6;
  color: #526470;
  font-size: 13px;
  font-weight: 700;
}

.admin-status.processing {
  background: #fff4e5;
  color: #a15c07;
}

.admin-status.closed {
  background: #e3f4f0;
  color: #0e5f54;
}

.admin-action-btn {
  height: 32px;
  border: 1px solid #1d2d34;
  border-radius: 6px;
  background: #fff;
  color: #1d2d34;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.admin-action-btn:hover,
.admin-action-btn:focus {
  background: #1d2d34;
  color: #fff;
  outline: none;
}

.admin-empty-cell {
  color: #7b8794;
  text-align: center;
}

.ops-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ops-sidebar {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.side-link {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  text-align: left;
}

.ops-main {
  min-width: 0;
  padding: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.filter-bar {
  display: grid;
  grid-template-columns: 140px 150px 160px minmax(180px, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.feedback-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.feedback-list {
  display: grid;
  gap: 8px;
}

.feedback-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.feedback-row.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 122, 107, 0.1);
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.status-dot.processing {
  background: var(--warning);
}

.status-dot.closed {
  background: var(--primary);
}

.row-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.row-main strong,
.row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-panel {
  min-width: 0;
  padding: 18px;
}

.feedback-detail-modal {
  width: min(980px, calc(100vw - 64px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  border: 0;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #edf0f3;
}

.detail-title h3 {
  margin: 0;
  color: #17212b;
  font-size: 22px;
  font-weight: 900;
}

.detail-title p {
  margin: 6px 0 0;
  color: #667085;
  font-size: 14px;
}

.badge {
  align-self: start;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.badge.urgent {
  background: #fff4e5;
  color: var(--warning);
}

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

.detail-summary > div {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fbfdff;
}

.detail-summary span {
  display: block;
  margin-bottom: 6px;
  color: #667085;
  font-size: 13px;
}

.detail-summary strong {
  display: block;
  overflow: hidden;
  color: #1f252b;
  font-size: 17px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-summary .admin-status {
  display: inline-flex;
  min-width: 72px;
}

.detail-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.detail-section {
  min-width: 0;
  padding: 16px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
}

.detail-section h4 {
  margin: 0 0 12px;
  color: #17212b;
  font-size: 16px;
  font-weight: 900;
}

.detail-section-main {
  display: flex;
  flex-direction: column;
}

.detail-info-list {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px 10px;
  margin: 0;
}

.detail-info-list dt {
  color: #667085;
  font-size: 14px;
}

.detail-info-list dd {
  min-width: 0;
  margin: 0;
  color: #242b32;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.content-text {
  flex: 1;
  min-height: 132px;
  margin: 0;
  padding: 14px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fbfdff;
  color: #242b32;
  line-height: 1.7;
  white-space: pre-wrap;
}

.detail-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.detail-images a {
  display: grid;
  overflow: hidden;
  width: auto;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fbfdff;
  color: #242b32;
  text-decoration: none;
}

.detail-images img {
  width: 100%;
  height: 108px;
  object-fit: cover;
  background: #f2f4f7;
}

.detail-images span {
  overflow: hidden;
  padding: 8px 10px;
  color: #475467;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-empty-note {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #fbfdff;
  color: #667085;
}

.detail-process-section {
  margin-top: 16px;
  background: #fbfdff;
}

.detail-process-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.detail-process-grid .field-block {
  gap: 8px;
}

.detail-process-grid textarea {
  min-height: 96px;
  background: #fff;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.empty-state {
  padding: 22px;
  border: 1px dashed #b7c3d0;
  border-radius: 8px;
  background: #fbfdff;
  color: var(--muted);
  text-align: center;
}

.dict-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid #d9dde3;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.04);
}

.dict-toolbar .search-input {
  flex: 1 1 320px;
  height: 36px;
  border-radius: 6px;
}

.dict-table-card {
  margin-top: 0;
}

.dict-data-table {
  min-width: 720px;
}

.dict-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 26px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.dict-state.enabled {
  background: #e3f4f0;
  color: #0e5f54;
}

.dict-state.disabled {
  background: #f1f3f5;
  color: #667085;
}

.dict-toggle-btn {
  margin-left: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.36);
}

.dict-modal {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.dict-modal-head,
.dict-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dict-modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close-btn {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: #f1f3f5;
  color: #344054;
  font-size: 22px;
  line-height: 1;
}

table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding-top: 14px;
  }

  .topbar,
  .form-actions,
  .ops-heading,
  .detail-title {
    align-items: stretch;
    flex-direction: column;
  }

  .submit-grid,
  .ops-layout,
  .feedback-workbench {
    grid-template-columns: 1fr;
  }

  .intro-panel,
  .ops-sidebar {
    position: static;
  }

  .ops-sidebar {
    grid-template-columns: repeat(2, 1fr);
  }

  .ops-sidebar h2 {
    grid-column: 1 / -1;
  }

  .summary-grid,
  .filter-bar {
    grid-template-columns: repeat(2, 1fr);
  }

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

}

@media (max-width: 560px) {
  .brand {
    align-items: flex-start;
  }

  .brand h1 {
    font-size: 18px;
  }

  .nav-tabs,
  .field-row,
  .summary-grid,
  .filter-bar,
  .metric-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel,
  .ops-main,
  .detail-panel {
    padding: 16px;
  }

  .ops-sidebar {
    grid-template-columns: 1fr;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

}
