﻿:root {
  --bg-1: #f3efe7;
  --bg-2: #e5dccf;
  --ink: #1d1a16;
  --muted: #5f564a;
  --card: #fffdfa;
  --line: #d8cdbf;
  --accent: #c26a2e;
  --accent-dark: #9e5121;
  --ok: #1c7a45;
  --error: #b3362f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, rgba(194, 106, 46, 0.24), transparent 36%),
    radial-gradient(circle at 86% 82%, rgba(29, 26, 22, 0.14), transparent 38%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
  overflow: hidden;
}

.login-shell {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 860px);
  min-height: 520px;
  max-height: 92dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 22px 45px rgba(29, 26, 22, 0.16);
}

.hero-panel {
  background: linear-gradient(165deg, #24201b, #383027);
  color: #f8f2e9;
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.eyebrow {
  margin: 0;
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  opacity: 0.85;
}

.login-card {
  background: var(--card);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.login-card h2,
.login-card .message {
  width: 100%;
}

h1,
h2 {
  margin: 0 0 6px;
  font-size: 30px;
}

h2 {
  color: #2f281f;
  font-size: 24px;
  margin-bottom: 18px;
}

.subtext {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

form {
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 10px;
}

label {
  font-size: 14px;
  font-weight: 500;
}

input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
}

input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(194, 106, 46, 0.17);
}

.captcha-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
}

.captcha-code {
  width: 150px;
  height: 44px;
  border-radius: 11px;
  border: 1px dashed var(--line);
  background: #f7efe5;
  display: block;
  user-select: none;
  cursor: pointer;
}

.remember-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.remember-row input {
  width: 16px;
  height: 16px;
}

.submit-btn {
  margin-top: 6px;
  height: 46px;
  border: none;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.submit-btn:hover {
  background: var(--accent-dark);
}

.ghost-btn {
  height: 42px;
  border: 1px solid var(--line);
  background: #f8f2e9;
  border-radius: 10px;
  padding: 0 12px;
  cursor: pointer;
  color: #473a2f;
}

.operation-log-btn {
  border-color: rgba(194, 106, 46, 0.72);
  background: #f3dfca;
  color: #763915;
  font-weight: 700;
}

.operation-log-btn:hover {
  background: #e8c8a6;
  border-color: rgba(158, 81, 33, 0.82);
  color: #5a2c10;
}

.ghost-btn.danger {
  border-color: #c67d73;
  color: #86382f;
  background: #f4ddd8;
}

.message {
  min-height: 24px;
  margin: 12px 0 0;
  font-size: 14px;
}

.message.ok {
  color: var(--ok);
}

.message.error {
  color: var(--error);
}

.home-shell {
  width: 100vw;
  min-height: 100dvh;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr 7fr;
  overflow: visible;
}

.sidebar {
  background: linear-gradient(165deg, #24201b, #383027);
  color: #f8f2e9;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100dvh;
  overflow: hidden;
}

.add-account-btn {
  margin-top: 2px;
  height: 42px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
}

.search-row input {
  background: rgba(255, 255, 255, 0.92);
}

.account-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 2px;
  list-style: none;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  justify-items: center;
  align-content: start;
  grid-auto-rows: minmax(clamp(32px, 4.1vh, 48px), auto);
  gap: 8px;
  scrollbar-width: none;
}

.account-list:hover {
  scrollbar-color: rgba(248, 242, 233, 0.45) rgba(255, 255, 255, 0.08);
}

.account-list::-webkit-scrollbar {
  width: 0;
}

.account-list:hover::-webkit-scrollbar {
  width: 0;
}

.account-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.account-list::-webkit-scrollbar-thumb {
  background: rgba(248, 242, 233, 0.45);
  border-radius: 999px;
}

.account-list::-webkit-scrollbar-thumb:hover {
  background: rgba(248, 242, 233, 0.62);
}

.account-item {
  border: 1px solid rgba(248, 242, 233, 0.24);
  border-radius: 10px;
  padding: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  min-height: clamp(32px, 4.1vh, 48px);
  width: 100%;
  max-width: 200px;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.account-item:hover {
  transform: scale(1.03);
  border-color: rgba(248, 242, 233, 0.56);
  background: rgba(255, 255, 255, 0.08);
}

@media (hover: none) and (pointer: coarse) {
  .account-item:hover {
    transform: none;
    border-color: rgba(248, 242, 233, 0.24);
    background: rgba(255, 255, 255, 0.04);
  }
}

.account-item.selected {
  border-color: rgba(194, 106, 46, 0.95);
  background: rgba(194, 106, 46, 0.24);
  transform: none;
}

.account-item.selected:hover {
  transform: none;
  border-color: rgba(194, 106, 46, 0.95);
  background: rgba(194, 106, 46, 0.24);
}

.account-item strong {
  font-size: 14px;
  font-weight: 500;
  color: rgba(248, 242, 233, 0.95);
}

.account-item.empty {
  color: rgba(248, 242, 233, 0.8);
}

.account-item-actions {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 100%;
  padding: 0 4px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  z-index: 10;
  pointer-events: auto;
}

.account-item.active .account-item-actions {
  display: flex;
}

.account-item.active strong {
  opacity: 0.2;
  pointer-events: none;
}

.account-item.dragging {
  opacity: 0.5;
  border-color: rgba(194, 106, 46, 0.8);
  background: rgba(194, 106, 46, 0.3);
}

.account-item.drag-over-above {
  border-top: 3px solid rgba(194, 106, 46, 0.95);
}

.account-item.drag-over-below {
  border-bottom: 3px solid rgba(194, 106, 46, 0.95);
}

.tiny-btn {
  height: 24px;
  min-width: 0;
  flex: 1 1 0;
  max-width: 60px;
  border: 1px solid rgba(248, 242, 233, 0.5);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(248, 242, 233, 0.95);
  font-size: 10px;
  white-space: nowrap;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tiny-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.content {
  background: rgba(255, 253, 250, 0.55);
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.content-topbar {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.content-topbar h1 {
  margin: 0;
  font-size: 24px;
  color: #2f281f;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-user-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(194, 106, 46, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(194, 106, 46, 0.3);
  margin-right: 8px;
}

.user-label {
  font-size: 12px;
  color: var(--muted);
}

.user-name {
  font-size: 16px;
  font-weight: 600;
  color: #2f281f;
}

.topbar-user-info-mobile {
  display: none;
}

.feature-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 2;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.feature-tab {
  height: 40px;
  border: 1px solid #c9b7a4;
  border-radius: 10px;
  padding: 0 16px;
  background: #fbf6ef;
  color: #2f281f;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.feature-tab:hover {
  border-color: #c9b6a1;
  background: rgba(255, 255, 255, 0.95);
}

.feature-tab.active {
  border-color: rgba(194, 106, 46, 0.9);
  background: rgba(194, 106, 46, 0.16);
  color: #6f3818;
}

.feature-board {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  padding: 18px;
  display: flex;
  overflow: hidden;
}

.feature-pane {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.feature-pane[hidden] {
  display: none !important;
}

.feature-pane[data-pane="app"],
.feature-pane[data-pane="command"] {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.feature-pane[data-pane="account"] {
  overflow: auto;
}

.resource-list-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  padding: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.feature-pane h2 {
  margin: 0;
  font-size: 20px;
  color: #2f281f;
}

.feature-pane p {
  margin: 0;
  font-size: 14px;
  color: #6a5d4f;
}

.resource-meta {
  margin-bottom: 0;
}

.resource-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding-left: 26px;
  padding-right: 20px;
}

.resource-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4d4337;
  white-space: nowrap;
  margin-left: -4px;
}

.resource-select-all input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.resource-search {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
}

.resource-strong-btn {
  border-color: rgba(194, 106, 46, 0.72);
  background: #f3dfca;
  color: #763915;
  font-weight: 700;
}

.resource-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.resource-strong-btn:hover {
  background: #e8c8a6;
  border-color: rgba(158, 81, 33, 0.82);
  color: #5a2c10;
}

.resource-list {
  display: grid;
  align-content: start;
  flex: 1;
  gap: 8px;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.resource-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.resource-check-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  min-width: 16px;
}

.resource-item-check {
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin: 0;
  flex: 0 0 auto;
}

.resource-item-name {
  margin: 0;
  font-size: 14px;
  color: #2f281f;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-item-time {
  margin: 0;
  color: #6a5d4f;
  font-size: 13px;
  white-space: nowrap;
}

.resource-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.resource-op-btn {
  min-width: 46px;
  height: 28px;
  border-color: rgba(194, 106, 46, 0.62);
  background: #f5e8da;
  color: #7d3f16;
  font-weight: 600;
}

.resource-op-btn:hover {
  background: #ecd3bb;
  border-color: rgba(158, 81, 33, 0.78);
  color: #5f2f10;
}

.account-manage-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.group-create-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  align-items: center;
}

.group-create-row .submit-btn {
  margin-top: 0;
  height: 42px;
}

.group-help-row {
  font-size: 13px;
  color: #6a5d4f;
}

.group-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 0;
}

.group-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-panel-head h3 {
  margin: 0;
  font-size: 16px;
  color: #2f281f;
}

.group-count {
  font-size: 12px;
  color: #705e4d;
  background: rgba(194, 106, 46, 0.12);
  border: 1px solid rgba(194, 106, 46, 0.28);
  border-radius: 999px;
  padding: 2px 8px;
}

.ungrouped-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  overflow-y: auto;
}

.account-chip {
  position: relative;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #3c3127;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}

.account-chip:hover {
  border-color: rgba(194, 106, 46, 0.72);
  background: rgba(194, 106, 46, 0.12);
}

.chip-name {
  display: block;
  min-width: 0;
  max-width: calc(100% - 36px);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-group-btn {
  display: none;
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  min-width: 32px;
  border: 1px solid rgba(194, 106, 46, 0.52);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #8d4a1f;
  font-size: 12px;
  font-weight: 600;
  padding: 0 2px;
  cursor: pointer;
}

.account-chip:hover .chip-group-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.grouped-chip {
  border-radius: 10px;
}

.usermgmt-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.user-create-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 120px;
  gap: 8px;
  align-items: center;
}

.user-create-row .submit-btn {
  margin-top: 0;
  height: 42px;
}

.user-table-wrapper {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.user-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-2);
}

.user-table th:first-child,
.user-table td:first-child {
  width: 180px;
}

.user-table th:nth-child(2),
.user-table td:nth-child(2) {
  width: 100px;
}

.user-table th:nth-child(3),
.user-table td:nth-child(3) {
  width: 180px;
}

.user-table th:nth-child(4),
.user-table td:nth-child(4) {
  width: 180px;
}

.user-table th:last-child,
.user-table td:last-child {
  width: 160px;
}

.user-table th {
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.user-table td {
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(216, 205, 191, 0.5);
  text-align: center;
}

.user-table tbody tr:last-child td {
  border-bottom: none;
}

.user-table tbody tr:hover {
  background: rgba(194, 106, 46, 0.06);
}

.user-role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-role-badge.admin {
  background: var(--accent);
  color: #fff;
}

.user-role-badge.user {
  background: var(--bg-2);
  color: var(--muted);
}

.user-table-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.user-table-actions .ghost-btn {
  font-size: 12px;
  padding: 4px 10px;
  height: auto;
}

.chip-picker {
  position: absolute;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 6px;
  width: 230px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 22px rgba(76, 51, 27, 0.16);
}

.grouped-box {
  display: grid;
  gap: 8px;
  overflow-y: auto;
}

.group-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  overflow: hidden;
}

.group-header {
  border-bottom: 1px solid rgba(216, 205, 191, 0.7);
  background: rgba(247, 238, 226, 0.88);
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 0;
}

.group-header-main {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: none;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}

.group-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 1;
  pointer-events: auto;
  padding-right: 2px;
}

.group-header-actions .tiny-btn {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  border-color: rgba(194, 106, 46, 0.45);
  background: rgba(255, 255, 255, 0.96);
  color: #8d4a1f;
}

.group-header-actions .tiny-btn:hover {
  background: rgba(194, 106, 46, 0.12);
}

.group-header-actions .tiny-btn.danger {
  border-color: rgba(175, 57, 34, 0.42);
  color: #a8442f;
}

.group-header-actions .tiny-btn.danger:hover {
  background: rgba(168, 68, 47, 0.12);
}

.group-title {
  font-size: 14px;
  font-weight: 700;
  color: #2f281f;
}

.group-meta {
  font-size: 12px;
  color: #705e4d;
}

.group-toggle {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(194, 106, 46, 0.45);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8d4a1f;
  font-size: 13px;
  font-weight: 700;
}

.group-body {
  display: none;
  padding: 8px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.group-body.expanded {
  display: grid;
}

.account-manage-list {
  display: grid;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 2px;
}

.manage-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(160px, 1.4fr) minmax(140px, 1fr) 100px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px;
}

.manage-account-name {
  font-size: 14px;
  font-weight: 600;
  color: #2f281f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-account-origin {
  font-size: 13px;
  color: #6a5d4f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-group-select {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
}

.manage-save-btn {
  height: 36px;
  font-size: 13px;
}

.manage-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: #6a5d4f;
  font-size: 14px;
  padding: 16px;
  text-align: center;
}

.login-user {
  font-size: 14px;
  color: var(--muted);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
}

#noticeModal {
  z-index: 60;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(29, 26, 22, 0.45);
}

.modal-panel {
  position: relative;
  width: min(94vw, 560px);
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 16px 38px rgba(29, 26, 22, 0.22);
}

.modal-panel h3 {
  margin: 0 0 14px;
  color: #2f281f;
  font-size: 20px;
}

.password-form {
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 10px;
}

.select-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
}

.select-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(194, 106, 46, 0.17);
}

.modal-actions {
  margin-top: 2px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions .submit-btn {
  margin-top: 0;
  height: 42px;
  padding: 0 16px;
}

.migrate-label {
  font-size: 14px;
  font-weight: 500;
}

.migrate-type-row {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.migrate-type-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #4d4337;
  font-size: 14px;
}

.migrate-type-option input[type="radio"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.migrate-head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  align-items: stretch;
  gap: 14px;
}

.migrate-basic-fields {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 170px);
  align-items: end;
  gap: 12px;
}

.migrate-type-group {
  display: grid;
  gap: 8px;
}

.migrate-target-type-field {
  display: grid;
  gap: 8px;
}

.migrate-target-type-field .select-input {
  height: 36px;
  border-radius: 9px;
}

.visual-flow-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  width: 100%;
}

.visual-flow-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.visual-flow-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.visual-flow-section .select-input {
  height: 36px;
  border-radius: 9px;
}

.visual-flow-section .ghost-btn {
  height: 36px;
  padding: 0 10px;
}

.visual-flow-section .message {
  grid-column: 1 / -1;
  min-height: 16px;
  margin: 0;
  font-size: 12px;
}

.migrate-target-toolbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding-left: 18px;
}

#migrateModal .modal-panel {
  width: min(96vw, 700px);
  height: min(86dvh, 680px);
  display: flex;
  flex-direction: column;
}

#localUploadModal .modal-panel {
  width: min(96vw, 640px);
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

#rollbackModal .modal-panel {
  width: min(96vw, 700px);
  height: min(80dvh, 620px);
  display: flex;
  flex-direction: column;
}

#operationLogModal .modal-panel {
  width: min(98vw, 1080px);
  height: min(82dvh, 640px);
  display: flex;
  flex-direction: column;
}

#rollbackModal .rollback-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.rollback-version-list {
  flex: 1;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.operation-log-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.operation-log-list {
  flex: 1;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

.operation-log-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.operation-log-card-list {
  display: none;
}

.operation-log-table .col-time {
  width: 180px;
}

.operation-log-table .col-resource {
  width: 300px;
}

.operation-log-table .col-path {
  width: auto;
}

.operation-log-table .col-type {
  width: 110px;
}

.operation-log-table .col-status {
  width: 260px;
}

.operation-log-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3e8db;
  color: #2f281f;
  font-size: 13px;
  text-align: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.operation-log-table thead th:last-child {
  border-right: none;
}

.operation-log-table tbody td {
  font-size: 13px;
  color: #4d4337;
  padding: 14px 10px;
  border-bottom: 1px solid #efe4d6;
  border-right: 1px solid #efe4d6;
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operation-log-table tbody td:last-child {
  border-right: none;
}

.operation-log-table tbody tr:hover {
  background: rgba(243, 232, 219, 0.35);
}

.operation-log-table .status-ok {
  color: var(--ok);
  font-weight: 600;
}

.operation-log-table .status-error {
  color: var(--error);
  font-weight: 600;
}

.operation-log-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.operation-log-pagination .ghost-btn {
  height: 36px;
  padding: 0 10px;
}

.operation-log-pagination .ghost-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.operation-log-page-text {
  font-size: 13px;
  color: #5f564a;
}

.rollback-version-item {
  border: 1px solid rgba(216, 205, 191, 0.78);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rollback-version-left {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rollback-version-title {
  margin: 0;
  color: #2f281f;
  font-size: 14px;
  font-weight: 700;
}

.rollback-version-time {
  margin: 0;
  color: #6a5d4f;
  font-size: 12px;
}

#migrateModal .password-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.local-upload-dropzone {
  border: 1px dashed rgba(194, 106, 46, 0.58);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(250, 243, 236, 0.98)),
    radial-gradient(circle at top left, rgba(194, 106, 46, 0.08), transparent 42%);
  min-height: 220px;
  padding: 20px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.local-upload-dropzone:hover {
  border-color: var(--accent);
  box-shadow: 0 14px 28px rgba(46, 31, 12, 0.08);
  transform: translateY(-1px);
}

.local-upload-dropzone-title {
  font-size: 18px;
  font-weight: 700;
  color: #2f281f;
}

.local-upload-dropzone-subtitle {
  max-width: 380px;
  font-size: 13px;
  line-height: 1.6;
  color: #6a5d4f;
}

.local-upload-file-name {
  max-width: 100%;
  border-radius: 999px;
  background: rgba(194, 106, 46, 0.12);
  color: #8a461e;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.migrate-target-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.migrate-target-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-height: 120px;
  height: 100%;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.migrate-target-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(216, 205, 191, 0.75);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.92);
}

.migrate-target-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.migrate-target-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2f281f;
  font-size: 14px;
}

.migrate-visual-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4d4337;
}

.migrate-visual-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.migrate-progress {
  display: grid;
  gap: 6px;
}

.migrate-progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #efe4d6;
  border: 1px solid #dfcfbd;
  border-radius: 999px;
  overflow: hidden;
}

.migrate-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #c26a2e, #9e5121);
  transition: width 0.25s ease;
}

.migrate-progress-text {
  margin: 0;
  font-size: 13px;
  color: #5f564a;
}

@media (max-width: 1024px) {
  body {
    overflow: auto;
  }

  .home-shell {
    width: 100%;
    min-height: 100dvh;
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding: 18px;
    gap: 10px;
  }

  .account-list {
    max-height: 32dvh;
    min-height: 120px;
    grid-template-columns: repeat(2, 1fr);
  }

  .account-item {
    max-width: none;
  }

  .content {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 18px;
  }

  .feature-shell {
    min-height: 0;
  }

  .feature-board {
    overflow: visible;
  }

  .resource-list-shell {
    min-height: 280px;
  }

  .resource-item {
    grid-template-columns: 16px minmax(0, 1fr);
    grid-template-areas:
      "check name"
      "time actions";
  }

  .resource-check-wrap {
    grid-area: check;
  }

  .resource-item-name {
    grid-area: name;
  }

  .resource-item-time {
    grid-area: time;
  }

  .resource-item-actions {
    grid-area: actions;
    justify-self: end;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .operation-log-table {
    display: none;
  }

  .operation-log-card-list {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  .operation-log-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    display: grid;
    gap: 6px;
  }

  .operation-log-card p {
    margin: 0;
    font-size: 13px;
    color: #4d4337;
    line-height: 1.4;
    word-break: break-all;
  }

  .operation-log-card p strong {
    color: #2f281f;
  }

  #migrateModal .modal-panel {
    height: min(90dvh, 760px);
  }

  #localUploadModal .modal-panel {
    width: min(96vw, 640px);
  }

  #rollbackModal .modal-panel {
    height: min(90dvh, 700px);
  }

  #operationLogModal .modal-panel {
    height: min(90dvh, 720px);
  }

  .content-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }

  .content-topbar h1 {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .topbar-buttons-row {
    width: 100%;
    display: flex;
    gap: 6px;
  }

  .topbar-buttons-row .ghost-btn {
    flex: 1;
    min-width: 0;
    padding: 8px clamp(6px, 2.2vw, 10px);
    white-space: nowrap;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(11px, 2.8vw, 13px);
  }

  .topbar-user-info {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
  }

  .user-label {
    font-size: clamp(12px, 3vw, 14px);
    color: var(--muted);
  }

  .user-name {
    font-size: clamp(15px, 3.8vw, 18px);
    font-weight: 600;
    color: #2f281f;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .login-shell {
    position: static;
    transform: none;
    margin: 20px auto;
    max-height: none;
    grid-template-columns: 1fr;
  }

  .hero-panel {
    padding: 30px 24px;
  }

  .login-card {
    padding: 24px;
  }

  h1 {
    font-size: 25px;
  }

  .home-shell {
    width: 100vw;
    min-height: 100dvh;
    grid-template-columns: 1fr;
  }

  .account-item {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .content {
    padding: 10px;
  }

  .feature-board {
    padding: 10px;
  }

  .feature-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 5px;
  }

  .feature-tab {
    width: 100%;
    height: 34px;
    padding: 0 6px;
    font-size: 12px;
    border-radius: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .resource-toolbar {
    padding-left: 4px;
    padding-right: 4px;
    margin-bottom: 8px;
  }

  .migrate-head-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .migrate-basic-fields {
    grid-template-columns: 1fr;
    padding: 8px;
    gap: 10px;
  }

  .local-upload-dropzone {
    min-height: 190px;
    padding: 16px;
  }

  .visual-flow-section {
    width: 100%;
    padding: 6px;
    gap: 5px;
  }

  .visual-flow-section .select-input,
  .visual-flow-section .ghost-btn {
    height: 34px;
    font-size: 12px;
  }

  .resource-list-shell {
    padding: 6px;
  }

  .group-create-row {
    grid-template-columns: 1fr;
  }

  .group-split-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .user-create-row {
    grid-template-columns: 1fr;
  }

  .user-create-row .submit-btn {
    width: 100%;
  }

  .user-table-wrapper {
    border: none;
    background: transparent;
    overflow: visible;
  }

  .user-table {
    table-layout: auto;
  }

  .user-table thead {
    display: none;
  }

  .user-table tbody {
    display: grid;
    gap: 10px;
  }

  .user-table tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    padding: 8px 10px;
  }

  .user-table td {
    width: auto !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    text-align: left;
    border-bottom: 1px dashed rgba(216, 205, 191, 0.6);
    font-size: 13px;
  }

  .user-table td:last-child {
    border-bottom: none;
  }

  .user-table td::before {
    content: attr(data-label) "：";
    color: var(--muted);
    font-weight: 600;
    flex: 0 0 auto;
  }

  .user-table-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .user-table-actions .ghost-btn {
    width: 100%;
    padding: 0 6px;
    height: 30px;
    font-size: 12px;
    white-space: nowrap;
  }

  .resource-toolbar {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "search search"
      "select actions";
    align-items: center;
    padding-left: 4px;
    padding-right: 4px;
    gap: 8px;
  }

  .resource-toolbar .resource-select-all {
    grid-area: select;
    width: auto;
    min-width: 0;
    justify-content: flex-start;
    margin-left: 17px;
  }

  .resource-toolbar .resource-search {
    grid-area: search;
  }

  .resource-toolbar .resource-toolbar-actions {
    grid-area: actions;
    width: 100%;
    justify-content: flex-end;
  }

  .resource-item {
    grid-template-columns: 16px minmax(0, 1fr);
    grid-template-areas:
      "check name"
      "time actions";
  }

  .resource-check-wrap {
    grid-area: check;
  }

  .resource-item-name {
    grid-area: name;
  }

  .resource-item-time {
    grid-area: time;
  }

  .resource-item-actions {
    grid-area: actions;
    justify-self: end;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .manage-row {
    grid-template-columns: 1fr;
  }

  .chip-picker {
    grid-template-columns: 1fr;
    width: min(90vw, 260px);
  }

  .content-topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    flex-wrap: wrap;
  }

  .content-topbar h1 {
    flex: 1;
    min-width: 0;
  }

  .topbar-user-info-mobile {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(194, 106, 46, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(194, 106, 46, 0.3);
  }

  .topbar-user-info-mobile .user-label {
    font-size: clamp(10px, 2.5vw, 12px);
    color: var(--muted);
  }

  .topbar-user-info-mobile .user-name {
    font-size: clamp(13px, 3.2vw, 16px);
    font-weight: 600;
    color: #2f281f;
  }

  .topbar-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    order: 3;
  }

  .topbar-buttons-row {
    width: 100%;
    display: flex;
    gap: 6px;
  }

  .topbar-buttons-row .ghost-btn {
    flex: 1;
    min-width: 0;
    padding: 8px clamp(6px, 2.2vw, 10px);
    white-space: nowrap;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(11px, 2.8vw, 13px);
  }

  .topbar-user-info {
    display: none;
  }
}

.permissions-section {
  margin-top: 12px;
}

.permissions-label {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.permissions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.permission-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}