/* 前后台共用框架、导航、目录、表单基础。 */

.workspace {
  min-height: 100vh;
  padding: 18px;
}

body[data-mode="front"] .workspace {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 0%, rgba(214, 177, 106, 0.24), transparent 34%),
    radial-gradient(circle at 86% 8%, rgba(47, 117, 97, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(154, 106, 36, 0.12), transparent 280px),
    linear-gradient(180deg, rgba(255, 253, 248, 0.9), rgba(238, 242, 243, 0.96)),
    repeating-linear-gradient(0deg, rgba(154, 106, 36, 0.026) 0, rgba(154, 106, 36, 0.026) 1px, transparent 1px, transparent 22px);
}

body[data-mode="front"] .workspace::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(50% - 1px), rgba(154, 106, 36, 0.032) 50%, transparent calc(50% + 1px), transparent 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 210px);
}

.topbar,
.front-nav,
.search-row,
.layout,
.detail-header,
.actions,
.top-actions,
.mode-switch,
.panel-title,
.records-head,
.tree-node-main {
  display: flex;
  align-items: center;
}

.topbar {
  position: relative;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto 14px;
  max-width: 1380px;
}

body[data-mode="front"] .topbar {
  overflow: hidden;
  border: 1px solid #d9c8a8;
  border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(154, 106, 36, 0.035) 0, rgba(154, 106, 36, 0.035) 1px, transparent 1px, transparent 34px),
    linear-gradient(100deg, rgba(154, 106, 36, 0.14), transparent 46%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(248, 251, 250, 0.96));
  box-shadow: 0 18px 42px rgba(69, 54, 29, 0.1);
  padding: 16px 18px;
}

body[data-mode="front"] .topbar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--bronze);
}

body[data-mode="front"] .topbar::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(154, 106, 36, 0.34), transparent);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

body[data-mode="front"] .topbar h1 {
  color: #1f2f2b;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

body[data-mode="front"] .topbar .eyebrow {
  color: var(--bronze);
  font-weight: 800;
}

body[data-mode="admin"] .topbar {
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.06);
  padding: 12px 14px;
}

body[data-mode="admin"] .topbar .eyebrow {
  color: var(--admin-muted);
  font-weight: 800;
}

body[data-mode="admin"] .topbar h1 {
  color: var(--admin-ink);
  font-size: 22px;
}

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

.current-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  max-width: 260px;
  padding: 6px 10px;
  border: 1px solid #d9c8a8;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  color: #3f3427;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.current-user-badge .current-user-label {
  color: #8a7042;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.current-user-badge strong {
  min-width: 0;
  overflow: hidden;
  color: #1f2f2b;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user-badge em {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid rgba(154, 106, 36, 0.2);
  border-radius: 999px;
  background: rgba(154, 106, 36, 0.08);
  color: #745324;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.15;
}

body[data-mode="admin"] .current-user-badge {
  border-color: var(--admin-line);
  background: #f8fafc;
  color: var(--admin-ink);
}

body[data-mode="admin"] .current-user-badge .current-user-label {
  color: var(--admin-muted);
}

body[data-mode="admin"] .current-user-badge strong {
  color: var(--admin-ink);
}

body[data-mode="admin"] .current-user-badge em {
  border-color: rgba(31, 92, 147, 0.18);
  background: rgba(31, 92, 147, 0.08);
  color: var(--admin-accent);
}

.mode-switch {
  overflow: hidden;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 1380px;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

body[data-mode="admin"] .admin-tabs {
  border-color: var(--admin-line);
  background: #f8fafc;
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.04);
}

.admin-tabs button {
  min-height: 38px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.admin-tabs button:hover,
.admin-tabs button.active {
  background: var(--accent);
  color: #fff;
}

body[data-mode="admin"] .admin-tabs button {
  color: var(--admin-ink);
}

body[data-mode="admin"] .admin-tabs button:hover,
body[data-mode="admin"] .admin-tabs button.active {
  background: var(--admin-accent);
  color: #fff;
}

.mode-switch button {
  min-height: 38px;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

.mode-switch button:hover,
.mode-switch button.active {
  background: var(--accent);
  color: #fff;
}

body[data-mode="admin"] .mode-switch button:hover,
body[data-mode="admin"] .mode-switch button.active {
  background: var(--admin-accent);
  color: #fff;
}

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

.ghost-button:hover {
  background: var(--soft);
}

.search-row {
  display: grid;
  grid-template-columns: 220px minmax(260px, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  max-width: 860px;
  margin: 0 auto 16px;
  padding: 0;
}

body[data-mode="front"] .search-row {
  max-width: 860px;
  border: 1px solid #d9c8a8;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 255, 255, 0.96));
  box-shadow: 0 14px 34px rgba(69, 54, 29, 0.07);
  padding: 8px;
}

.search-row.has-custom-scope {
  grid-template-columns: 220px 230px minmax(260px, 1fr) auto;
  max-width: 1060px;
}

body[data-mode="front"] .search-row.has-custom-scope {
  max-width: 1060px;
}

.coin-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  max-width: none;
  margin: -4px 0 10px;
  padding: 6px 8px;
  border: 1px solid #e8dac0;
  border-radius: 8px;
  background: rgba(255, 252, 245, 0.72);
  box-shadow: none;
}

.coin-filter-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 32px;
  min-width: 0;
}

.coin-filter-field > span {
  position: absolute;
  left: 10px;
  color: #7b5b2a;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.coin-filter-field input {
  width: 170px;
  height: 32px;
  box-sizing: border-box;
  border: 1px solid #d8c7a7;
  border-radius: 7px;
  background: #fffdf8;
  padding: 5px 9px 5px 68px;
  color: var(--ink);
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.coin-filter-price {
  gap: 6px;
  border: 1px solid #d8c7a7;
  border-radius: 7px;
  background: #fffdf8;
  padding-left: 68px;
  width: 230px;
  height: 32px;
  box-sizing: border-box;
  overflow: hidden;
}

.coin-filter-price input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 30px;
  border: 0;
  border-radius: 0;
  padding: 5px 4px;
  text-align: center;
  box-shadow: none;
  background: transparent;
}

.coin-filter-price em {
  flex: 0 0 18px;
  min-width: 18px;
  height: 20px;
  border-radius: 999px;
  background: #f0e1c4;
  color: #6f4812;
  font-style: normal;
  font-size: 14px;
  font-weight: 950;
  line-height: 18px;
  text-align: center;
}

.filter-submit-button {
  min-width: 58px;
  height: 32px;
  border: 1px solid #9c6a22;
  border-radius: 7px;
  background: linear-gradient(135deg, #9c6a22, #7b4f12);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.coin-filter-row #resetCoinFilterBtn {
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
}

.filter-submit-button:hover {
  filter: brightness(1.04);
}

.front-nav {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  max-width: 1380px;
  margin: 0 auto 14px;
  border: 1px solid #d9c8a8;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.96);
  padding: 4px;
  box-shadow: 0 8px 20px rgba(154, 106, 36, 0.06);
}

body[data-mode="front"] .front-nav {
  box-shadow: 0 12px 26px rgba(69, 54, 29, 0.075);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

body[data-mode="admin"] .front-nav {
  display: none !important;
}

.seo-public-page {
  max-width: 1180px;
  margin: 22px auto;
  padding: 0 18px 28px;
}

body:not(.is-booting) .seo-public-page {
  display: none;
}

.seo-public-breadcrumb {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 12px;
  border: 1px solid #d9c8a8;
  border-radius: 8px;
  background: #fffdf8;
  padding: 8px 12px;
  color: #6b4a18;
  font-size: 14px;
  font-weight: 850;
}

.seo-public-detail {
  border: 1px solid #d9c8a8;
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 16px 40px rgba(69, 54, 29, 0.09);
  padding: 18px;
}

.seo-public-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #eadcc1;
  padding-bottom: 14px;
}

.seo-public-head p {
  margin: 0 0 5px;
  color: #9a6a24;
  font-size: 13px;
  font-weight: 900;
}

.seo-public-head h2 {
  margin: 0;
  color: #2f261a;
  font-size: 26px;
  line-height: 1.25;
}

.seo-public-head a {
  flex: 0 0 auto;
  border: 1px solid #9c6a22;
  border-radius: 8px;
  background: linear-gradient(135deg, #9c6a22, #7b4f12);
  color: #fff;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.seo-public-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.seo-public-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid #eadcc1;
  border-radius: 8px;
  background: #f9f2e4;
}

.seo-public-card {
  margin-top: 14px;
  border: 1px solid #eadcc1;
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.seo-public-card h3 {
  margin: 0 0 10px;
  color: #4d3314;
  font-size: 17px;
}

.seo-public-card p {
  margin: 0;
  color: #4d4437;
  line-height: 1.8;
}

.seo-public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0;
}

.seo-public-grid div {
  border: 1px solid #eadcc1;
  border-radius: 7px;
  background: #fffdf8;
  padding: 8px;
}

.seo-public-grid dt {
  color: #8a6a35;
  font-size: 12px;
  font-weight: 900;
}

.seo-public-grid dd {
  margin: 5px 0 0;
  color: #2f261a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.seo-public-timeline {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.seo-public-timeline li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid #eadcc1;
  padding-bottom: 8px;
}

.seo-public-timeline li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.seo-public-timeline time {
  color: #7b5b2a;
  font-weight: 900;
}

.seo-public-timeline span {
  color: #3e3325;
}

.seo-public-related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.seo-public-related a {
  display: grid;
  gap: 4px;
  border: 1px solid #eadcc1;
  border-radius: 8px;
  background: #fffdf8;
  padding: 10px;
  color: #2f261a;
  text-decoration: none;
}

.seo-public-related span {
  color: #806036;
  font-size: 13px;
}

.front-notice-bar {
  overflow: hidden;
  display: flex;
  align-items: center;
  max-width: 1380px;
  margin: 0 auto 12px;
  border: 1px solid #f2c5bd;
  border-radius: 6px;
  background: #fff7f5;
  padding: 7px 0;
}

body[data-mode="admin"] .front-notice-bar {
  display: none !important;
}

.front-notice-label {
  flex: 0 0 auto;
  padding: 0 12px 0 14px;
  border-right: 1px solid rgba(194, 31, 18, 0.18);
  color: #b91c12;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.4;
  white-space: nowrap;
}

.front-notice-track {
  flex: 1 1 auto;
  overflow: hidden;
  min-width: 0;
  color: #c21f12;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.4;
  white-space: nowrap;
}

.front-notice-marquee {
  display: inline-flex;
  gap: 360px;
  min-width: max-content;
  animation: notice-marquee 26s linear infinite;
}

.front-notice-marquee span {
  flex: 0 0 auto;
  padding-left: 16px;
}

.front-notice-track.is-static {
  text-align: center;
}

.front-notice-track.is-static .front-notice-marquee {
  display: inline-flex;
  min-width: 0;
  animation: none;
}

.front-notice-track.is-static span {
  padding-left: 0;
}

.front-notice-track.is-static span[aria-hidden="true"] {
  display: none;
}

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

.search-box {
  display: flex;
  align-items: stretch;
  position: relative;
  min-height: 42px;
  min-width: 0;
}

.search-scope-box {
  display: flex;
  align-items: stretch;
  position: relative;
  min-height: 42px;
  min-width: 0;
}

.search-scope-box::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 2px solid #7b5b2a;
  border-bottom: 2px solid #7b5b2a;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.custom-search-scope-box {
  display: flex;
  align-items: stretch;
  position: relative;
  min-height: 42px;
  min-width: 0;
}

.search-box > span,
.search-scope-box > span,
.custom-search-scope-box > span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

.search-box input,
.search-scope-box select,
.custom-search-scope-box input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  border-color: #cfd8dd;
  border-radius: 8px;
  padding: 8px 11px;
  box-shadow: 0 8px 22px rgba(32, 33, 36, 0.06);
  line-height: 1.2;
}

.search-box input,
.custom-search-scope-box input {
  padding-left: 50px;
}

.search-scope-box select {
  padding-left: 82px;
}

.search-scope-box select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding-top: 0;
  padding-right: 38px;
  padding-bottom: 0;
  line-height: normal;
  font-weight: 700;
}

.search-scope-box select::-ms-expand {
  display: none;
}

@media (forced-colors: active) {
  .search-scope-box::after {
    border-color: ButtonText;
  }
}

body[data-mode="front"] .search-box input,
body[data-mode="front"] .search-scope-box select,
body[data-mode="front"] .custom-search-scope-box input {
  height: 46px;
  border-color: #d7c8ac;
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 10px 24px rgba(69, 54, 29, 0.045);
}

body[data-mode="front"] .search-box,
body[data-mode="front"] .search-scope-box,
body[data-mode="front"] .custom-search-scope-box {
  min-height: 46px;
}

body[data-mode="front"] .search-box input:focus,
body[data-mode="front"] .search-scope-box select:focus,
body[data-mode="front"] .custom-search-scope-box input:focus {
  border-color: var(--bronze);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(154, 106, 36, 0.12);
}

body[data-mode="front"] .search-box > span,
body[data-mode="front"] .search-scope-box > span,
body[data-mode="front"] .custom-search-scope-box > span {
  color: #7b5b2a;
  font-weight: 800;
}

.scope-cascade {
  position: absolute;
  z-index: 29;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  width: fit-content;
  min-width: 0;
  max-width: min(92vw, 880px);
  max-height: 340px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  scrollbar-width: thin;
}

.scope-cascade-column {
  flex: 0 0 126px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: fit-content;
  max-height: 318px;
  overflow-y: auto;
  border: 1px solid #dfcfad;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #fff8ec);
  box-shadow: 0 12px 28px rgba(69, 54, 29, 0.13);
  padding: 6px;
  scrollbar-width: thin;
}

.scope-cascade-title {
  flex: 0 0 auto;
  color: #4b3a22;
  font-size: 12px;
  font-weight: 900;
  padding: 0 2px 3px;
  line-height: 1.3;
}

.scope-cascade-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  min-height: 30px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #26342f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  padding: 0 7px;
  text-align: left;
  white-space: nowrap;
}

.scope-cascade-option:hover,
.scope-cascade-option:focus {
  border-color: #d9c8a8;
  background: #fffaf0;
  outline: 0;
}

.scope-cascade-option.active {
  border-color: var(--bronze);
  background: linear-gradient(135deg, #fff4dd, #eef8f5);
  color: #4b320f;
}

.scope-cascade-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-cascade-option em {
  flex: 0 0 auto;
  color: var(--bronze);
  font-style: normal;
  font-size: 14px;
  font-weight: 900;
}

.search-submit-button {
  min-height: 42px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 0 16px;
  white-space: nowrap;
}

.search-submit-button:hover {
  background: var(--accent-strong);
}

body[data-mode="front"] .search-submit-button {
  min-height: 46px;
  border-color: #8f6424;
  border-radius: 10px;
  background: linear-gradient(135deg, #9c6a22, #7b4f12);
  box-shadow: 0 10px 22px rgba(154, 106, 36, 0.2);
}

body[data-mode="front"] .search-submit-button:hover {
  background: #815719;
}

.mobile-tree-button {
  display: none;
}

.mobile-tree-backdrop {
  display: none;
}

.front-nav button {
  min-height: 38px;
  border: 1px solid #e0cda9;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdf8, #fff7e8);
  color: #5d4219;
  font-size: 13px;
  font-weight: 850;
  padding: 0 14px;
  white-space: nowrap;
  box-shadow: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.front-nav #frontHomeBtn:hover,
.front-nav #frontSearchBtn:hover,
.front-nav #frontFavoritesBtn:hover,
.front-nav #frontMineBtn:hover,
.front-nav #frontHomeBtn:focus,
.front-nav #frontSearchBtn:focus,
.front-nav #frontFavoritesBtn:focus,
.front-nav #frontMineBtn:focus {
  border-color: #c8ad7a;
  background: #f4ead8;
  color: #5d4219;
}

.front-nav #frontHomeBtn.active,
.front-nav #frontSearchBtn.active,
.front-nav #frontFavoritesBtn.active,
.front-nav #frontMineBtn.active {
  border-color: #9c6a22;
  background: linear-gradient(135deg, #9c6a22, #7b4f12);
  color: #fff;
}

.front-mine-button {
  min-width: 72px;
}

.front-mine-button:hover,
.front-mine-button.active {
  background: var(--bronze);
  color: #fff;
}

body[data-mode="admin"] .front-mine-button {
  display: none !important;
}

.layout {
  align-items: stretch;
  gap: 14px;
  max-width: 1380px;
  margin: 0 auto;
}

body[data-mode="front"] .layout {
  gap: 16px;
}

body[data-mode="front"].front-view-mine .layout {
  display: block;
  max-width: 1180px;
  padding-top: 8px;
}

body[data-mode="front"].front-view-mine .sidebar {
  display: none;
}

body[data-mode="front"].front-view-mine .content {
  width: 100%;
}

.mine-panel {
  display: grid;
  gap: 16px;
  max-width: 1040px;
  margin: 0 auto;
}

.mine-card {
  display: grid;
  gap: 18px;
  position: relative;
  overflow: hidden;
  border: 1px solid #dfcfb1;
  border-radius: 8px;
  background:
    radial-gradient(circle at 0 0, rgba(214, 177, 106, 0.18), transparent 34%),
    linear-gradient(180deg, #fffdf9 0%, #fffaf0 100%);
  box-shadow: 0 18px 36px rgba(69, 54, 29, 0.09);
  padding: 24px;
}

.mine-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #9c6a22, #d6b16a, #2f7561);
}

.mine-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #eadfc9;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  padding: 14px;
}

.mine-avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(156, 106, 34, 0.28);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f7e4b7, #a8752d 68%, #75511e);
  color: #fffdf8;
  font-size: 18px;
  font-weight: 950;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.35), 0 8px 18px rgba(69, 54, 29, 0.14);
}

.mine-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mine-identity span {
  color: #7b5b2a;
  font-size: 13px;
  font-weight: 900;
}

.mine-identity strong {
  color: #26342f;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.mine-role-pill {
  border: 1px solid #d9c8a8;
  border-radius: 999px;
  background: #fffaf0;
  color: #7b4f12;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  padding: 8px 12px;
  white-space: nowrap;
}

.mine-section-title {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-bottom: 2px solid rgba(156, 106, 34, 0.24);
  color: #4b3a22;
  font-size: 14px;
  font-weight: 950;
  padding-top: 0;
}

.mine-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  border: 1px solid #eadfc9;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.68);
  padding: 12px;
}

.mine-action-section {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  border: 1px solid rgba(217, 200, 168, 0.72);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.74);
  padding: 10px;
}

.mine-action-heading {
  color: #7b5b2a;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
}

.mine-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mine-action-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #eadfc9;
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.8);
  color: #6c5a3c;
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.mine-action {
  flex: 0 0 auto;
  min-height: 32px;
  min-width: 82px;
  border: 1px solid #d9c8a8;
  border-radius: 7px;
  background: rgba(255, 250, 240, 0.92);
  color: #4b3a22;
  font-size: 12px;
  font-weight: 850;
  padding: 0 10px;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.mine-action:hover {
  border-color: #9c6a22;
  background: #f4ead8;
  box-shadow: 0 6px 12px rgba(69, 54, 29, 0.07);
}

.mine-action.primary {
  border-color: #9c6a22;
  background: linear-gradient(135deg, #9c6a22, #7b4f12);
  color: #fffdf8;
}

.mine-action.danger {
  border-color: #d8a3a0;
  background: #fff5f4;
  color: #b42318;
}

.sidebar {
  flex: 0 0 340px;
  min-width: 0;
  min-height: calc(100vh - 142px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
}

body[data-mode="front"] .sidebar {
  border-color: #ded1ba;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 255, 255, 0.96)),
    repeating-linear-gradient(0deg, rgba(154, 106, 36, 0.02) 0, rgba(154, 106, 36, 0.02) 1px, transparent 1px, transparent 20px);
  box-shadow: 0 16px 34px rgba(69, 54, 29, 0.075);
}

body[data-mode="front"] .sidebar .panel-title {
  border-bottom: 1px solid #eadfc9;
  margin: -2px 0 12px;
  padding-bottom: 10px;
}

body[data-mode="front"] .sidebar .panel-title h2 {
  color: #273a34;
  font-size: 18px;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 18px;
}

body[data-mode="front"] .content {
  border-color: #ded1ba;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 18px 38px rgba(69, 54, 29, 0.075);
}

body[data-mode="front"] .detail-header {
  border-bottom: 1px solid #eadfc9;
  margin: -2px 0 12px;
  padding-bottom: 12px;
}

body[data-mode="front"] .records-head {
  border-top: 1px solid #eadfc9;
  padding-top: 14px;
}

.panel-title,
.detail-header,
.records-head {
  justify-content: space-between;
  gap: 12px;
}

.panel-title h2,
.detail-header h2,
.records-head h3 {
  margin-bottom: 0;
}

.breadcrumb-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 6px;
}

#selectedPath {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
  margin: 0;
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #d5e2de;
  border-radius: 999px;
  background: #f8fbfa;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  padding: 0 10px;
  line-height: 1;
}

.breadcrumb-link:hover {
  border-color: #9fc8bf;
  background: #eef6f2;
  color: var(--accent-strong);
}

.breadcrumb-link.current {
  border-color: #0f766e;
  background: #e4f3ef;
  color: #074f4a;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.breadcrumb-link.current::before {
  content: "\5F53\524D\76EE\5F55\0020";
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
}

.breadcrumb-link.current.recent-current::before {
  content: "";
}

.breadcrumb-separator {
  color: #7e8a96;
  font-size: 17px;
  font-weight: 800;
  margin: 0 3px;
}

.breadcrumb-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  border: 1px dashed #c7d0d8;
  border-radius: 999px;
  background: #f6f7f9;
  color: #64717f;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

body[data-mode="front"] .breadcrumb-link {
  border-color: #d8c7a8;
  background: linear-gradient(180deg, #fffdf8, #fff8ec);
  color: #7b5b2a;
  box-shadow: 0 5px 12px rgba(69, 54, 29, 0.055);
}

body[data-mode="front"] .breadcrumb-link.current {
  border-color: var(--bronze);
  background: linear-gradient(180deg, #fff4df, #f8ebd4);
  color: #4f3717;
  box-shadow: 0 6px 14px rgba(154, 106, 36, 0.1);
}

body[data-mode="front"] .breadcrumb-link:hover {
  border-color: #b9924d;
  background: #fff7e8;
}

.selected-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.selected-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 8px;
  border: 1px solid #b38a3c;
  border-radius: 4px;
  background: #fffaf0;
  color: #5b4520;
  padding: 5px 8px;
}

body[data-mode="front"] .selected-count-badge {
  background: #fffdf8;
  box-shadow: 0 4px 12px rgba(69, 54, 29, 0.045);
}

.selected-count-badge strong {
  font-size: 18px;
  line-height: 1;
}

.selected-count-badge em {
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.child-category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.child-category-link {
  min-height: 30px;
  border: 1px solid #b7d6d0;
  background: #f1f8f6;
  color: #0b5f59;
  font-size: 13px;
  padding: 0 10px;
}

body[data-mode="front"] .child-category-link {
  border-color: #dac9aa;
  background: linear-gradient(180deg, #fffdf8, #fff8ec);
  color: #74531f;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(69, 54, 29, 0.045);
}

.child-category-link:hover {
  border-color: #7fb9ae;
  background: #e2f2ee;
  color: #074f4a;
}

body[data-mode="front"] .child-category-link:hover {
  border-color: #b9924d;
  background: #fff3dc;
  color: #4f3717;
}

.favorite-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.favorite-category-link {
  min-height: 30px;
  border: 1px solid #dac9aa;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #fff8ec);
  color: #74531f;
  font-size: 13px;
  font-weight: 800;
  padding: 0 10px;
  box-shadow: 0 6px 14px rgba(69, 54, 29, 0.045);
}

.favorite-category-link:hover {
  border-color: #b9924d;
  background: #fff3dc;
  color: #4f3717;
}

.favorite-category-link.active {
  border-color: #9c6a22;
  background: linear-gradient(135deg, #9c6a22, #7b4f12);
  color: #fff;
  box-shadow: 0 8px 18px rgba(154, 106, 34, 0.16);
}

.search-category-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.search-category-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.search-category-link.active {
  border-color: var(--bronze);
  background: #fff3dc;
  color: #4f3717;
}

.search-category-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-category-count {
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
}

.tree {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  min-width: 0;
  overflow-x: hidden;
}

.tree-node {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tree-node-main {
  position: relative;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 4px 6px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tree-node-main:hover {
  border-color: #d3dfdb;
  background: #f7faf9;
}

body[data-mode="front"] .tree-node-main {
  border-radius: 8px;
}

body[data-mode="front"] .tree-node-main:hover {
  border-color: #d7c5a5;
  background: #fffaf0;
  box-shadow: inset 0 0 0 1px rgba(154, 106, 36, 0.04);
}

.tree-node-main.active {
  border-color: #8fbfb6;
  background: #e8f5f1;
  box-shadow: inset 3px 0 0 var(--accent);
}

body[data-mode="front"] .tree-node-main.active {
  border-color: #b9924d;
  background: linear-gradient(90deg, #fff4dd, #eef8f5);
  box-shadow: inset 3px 0 0 var(--bronze), 0 6px 14px rgba(154, 106, 36, 0.1);
}

body[data-mode="admin"] .tree-node-main.active {
  border-color: #b7c3ce;
  background: #f3f6f8;
  box-shadow: inset 3px 0 0 #69717d;
}

.tree-toggle,
.tree-name {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.tree-toggle {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  border: 1px solid #d7dee5;
  border-radius: 6px;
  background: #fff;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.tree-node-main.has-children .tree-toggle {
  color: var(--accent);
  font-weight: 800;
}

body[data-mode="front"] .tree-node-main.has-children .tree-toggle {
  border-color: #dac9aa;
  background: #fffaf0;
  color: var(--bronze);
}

.tree-node-main.has-children.collapsed .tree-toggle {
  border-color: #bfd0ca;
  background: #f1f7f5;
}

.tree-toggle:disabled {
  cursor: default;
  opacity: 0.55;
}

.tree-toggle-empty {
  border-color: transparent;
  background: transparent;
  color: #a8b0ba;
}

.tree-name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  padding: 0 6px;
  text-align: left;
  font-size: 14px;
  font-weight: 650;
}

body[data-mode="front"] .tree-name {
  color: #24352f;
}

body[data-mode="front"] .tree-node-main.active .tree-name {
  color: #1d3f38;
  font-weight: 800;
}

.tree-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-coin-count {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 20px;
  color: #c0362c;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

body[data-mode="front"] .tree-coin-count {
  min-width: 24px;
  justify-content: center;
  border: 1px solid #e0c89d;
  border-radius: 999px;
  background: #fff7e8;
  color: #9d3b2d;
  padding: 0 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.tree-toggle:hover,
.tree-name:hover {
  background: transparent;
}

.tree-children {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  margin-left: 10px;
  padding-left: 6px;
  border-left: 1px dashed #cfd8dd;
}

body[data-mode="front"] .tree-children {
  border-left-color: #e4d2b1;
}

.tree-children .tree-node-main::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 5px;
  border-top: 1px dashed #cfd8dd;
}

body[data-mode="front"] .tree-children .tree-node-main::before {
  border-top-color: #e4d2b1;
}

.actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.category-actions {
  gap: 18px;
}

.category-actions #addChildBtn {
  min-width: 102px;
}

.category-actions #deleteNodeBtn {
  min-width: 54px;
  padding: 0 9px;
}

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

.danger:hover {
  background: #8f1c13;
}

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

.field-label {
  display: inline-flex;
  align-items: baseline;
  width: fit-content;
  max-width: 100%;
}

.grading-editor-field {
  display: grid;
  gap: 9px;
  align-content: start;
  border: 1px solid #d8e2df;
  border-radius: 7px;
  background: #f8fbfa;
  padding: 11px;
}

.grading-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.grading-editor-head > span {
  font-weight: 750;
}

.grading-editor {
  display: grid;
  gap: 8px;
}

.grading-editor-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(120px, 1fr) minmax(110px, 0.9fr) 32px;
  gap: 8px;
  align-items: center;
}

.grading-editor-row input {
  min-width: 0;
}

.grading-remove-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border: 1px solid #dfb8b2;
  border-radius: 6px;
  background: #fff5f3;
  color: #a23b31;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.grading-remove-button:hover,
.grading-remove-button:focus-visible {
  border-color: #b94f43;
  background: #b94f43;
  color: #fff;
}

@media (max-width: 760px) {
  .grading-editor-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px;
  }

  .grading-editor-row .grading-input-result {
    grid-column: 1 / 3;
  }

  .grading-editor-row .grading-remove-button {
    grid-column: 3;
    grid-row: 1 / 3;
  }
}

body.force-mobile .grading-editor-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px;
}

body.force-mobile .grading-editor-row .grading-input-result {
  grid-column: 1 / 3;
}

body.force-mobile .grading-editor-row .grading-remove-button {
  grid-column: 3;
  grid-row: 1 / 3;
}

.required-mark {
  margin-left: 3px;
  color: var(--danger);
  font-weight: 700;
  line-height: 1;
}

.readonly-field {
  display: grid;
  gap: 7px;
  align-content: start;
  color: var(--muted);
  font-size: 14px;
}

.readonly-field strong {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid #d8e2df;
  border-radius: 6px;
  background: #f7faf9;
  color: #29443d;
  font-size: 13px;
  padding: 8px 11px;
}

.locked-field strong {
  background: #f1f3f5;
  color: #7a828c;
}

.wide {
  grid-column: 1 / -1;
}

.coin-form-section {
  display: grid;
  gap: 12px;
  border: 1px solid #d8e2df;
  border-radius: 8px;
  background: #fbfdfc;
  padding: 14px;
}

.coin-form-section h4,
.record-internal-info h4 {
  margin: 0;
  color: #25343b;
  font-size: 14px;
  font-weight: 800;
}
