/* Market console skin. Loaded last to keep legacy workflow styles compatible. */
:root,
html[data-theme="light"],
html[data-theme="warm"] {
  --bg-1: #f4f5f7;
  --bg-2: #f4f5f7;
  --bg-soft: #fafafa;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-elevated: #ffffff;
  --surface-elevated-soft: #fafafa;
  --surface-elevated-strong: #ffffff;
  --card: #ffffff;
  --ink: #24262b;
  --muted: #73767f;
  --muted-soft: #92959e;
  --muted-ink: #73767f;
  --line: #e5e6eb;
  --line-soft: #eff0f3;
  --line-strong: #d4d6de;
  --line-hover: #b8bbc5;
  --accent: #ed4855;
  --accent-dark: #d93443;
  --accent-rgb: 237, 72, 85;
  --accent-dark-rgb: 217, 52, 67;
  --accent-soft: #fff0f1;
  --sidebar: #ffffff;
  --sidebar-soft: #fafafa;
  --sidebar-active: #fff0f1;
  --sidebar-hover: #f5f5f7;
  --ok: #19866c;
  --error: #d43845;
  --danger-bg: #fff1f0;
  --danger-line: #ffc8c9;
  --text-inverse: #ffffff;
  --page-border: #e9eaee;
  --content-bg: transparent;
  --table-head-bg: #fafafa;
  --table-head-ink: #60636d;
  --table-row-hover: #fff8f8;
  --focus-ring: 0 0 0 3px rgba(237, 72, 85, 0.12);
  --shadow-soft: 0 1px 3px rgba(24, 24, 28, 0.03);
  --shadow-strong: 0 16px 64px rgba(24, 24, 28, 0.16);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --captcha-bg: #fafafa;
  --captcha-line: rgba(96, 99, 109, 0.18);
  --captcha-ink: 60, 62, 70;
  --resource-select-col: 52px;
  --console-header-height: 60px;
  --console-sidebar-width: 232px;
}

html[data-theme="dark"] {
  --bg-1: #141414;
  --bg-2: #141414;
  --bg-soft: #242424;
  --surface: #1f1f1f;
  --surface-soft: #252525;
  --surface-elevated: #1f1f1f;
  --surface-elevated-soft: #252525;
  --surface-elevated-strong: #292929;
  --card: #1f1f1f;
  --ink: #eeeeef;
  --muted: #a5a5ad;
  --muted-soft: #82828c;
  --muted-ink: #a5a5ad;
  --line: #38383b;
  --line-soft: #303033;
  --line-strong: #48484c;
  --line-hover: #66666e;
  --accent: #ff6975;
  --accent-dark: #ff818b;
  --accent-rgb: 255, 105, 117;
  --accent-dark-rgb: 255, 129, 139;
  --accent-soft: #38252a;
  --sidebar: #1f1f1f;
  --sidebar-soft: #242424;
  --sidebar-active: #38252a;
  --sidebar-hover: #2a2a2d;
  --ok: #64c6a6;
  --error: #ff858a;
  --danger-bg: #3c2427;
  --danger-line: #704047;
  --text-inverse: #241418;
  --page-border: #303033;
  --table-head-bg: #262626;
  --table-head-ink: #bcbcc4;
  --table-row-hover: #302327;
  --focus-ring: 0 0 0 3px rgba(255, 105, 117, 0.18);
  --shadow-soft: none;
  --shadow-strong: 0 16px 64px rgba(0, 0, 0, 0.4);
  --captcha-bg: #292929;
  --captcha-line: rgba(180, 180, 188, 0.18);
  --captcha-ink: 235, 235, 239;
}

body {
  background: var(--bg-1);
  -webkit-font-smoothing: antialiased;
}

body, button, input, select, textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.lucide {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.7;
  pointer-events: none;
}

input:not([type="checkbox"]):not([type="radio"]),
select, textarea, .select-input, .custom-role-select-trigger {
  border-radius: 6px;
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.submit-btn, .ghost-btn, .resource-strong-btn, .tiny-btn {
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  transition: background-color 0.16s, color 0.16s, border-color 0.16s;
}

.submit-btn:hover, .ghost-btn:hover, .resource-strong-btn:hover, .tiny-btn:hover {
  transform: none;
  box-shadow: none;
}

.submit-btn, html[data-theme="dark"] .submit-btn,
html[data-theme="dark"] .submit-btn:hover { color: var(--text-inverse); }
.submit-btn { background: var(--accent); text-shadow: none; }
.submit-btn:hover { background: var(--accent-dark); filter: none; }

.console-page .home-shell {
  display: grid;
  grid-template-columns: var(--console-sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--console-header-height) minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.console-page [hidden] { display: none !important; }

.console-page .content-topbar {
  grid-column: 1 / -1;
  height: var(--console-header-height);
  min-height: 0;
  position: relative;
  inset: auto;
  z-index: 70;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
}

.console-brand { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.console-brand > img { object-fit: contain; flex-shrink: 0; }
.brand-name { font-size: 20px; font-weight: 650; color: var(--ink); }
.brand-name > span { font-size: 15px; font-weight: 500; margin-left: 3px; }
.brand-divider { width: 1px; height: 20px; margin: 0 5px; background: var(--line); }
.brand-product { font-size: 15px; font-weight: 550; }
.version-tag { color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 4px; font-size: 10px; padding: 1px 5px; }

.console-page .content-topbar .topbar-actions,
.console-page .content-topbar .topbar-buttons-row,
.console-page .content-topbar .topbar-session {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: auto;
}

.console-page .content-topbar .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.console-page .content-topbar .ghost-btn:hover { color: var(--accent); background: var(--accent-soft); }
.console-page .content-topbar .topbar-guide-link { width: auto; padding: 0 8px; }
.console-page .content-topbar .topbar-user-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  height: 30px;
  width: auto;
  margin: 0 0 0 4px;
  padding: 0 4px 0 16px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
}
.user-avatar { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-dark); border-radius: 50%; font-size: 12px; font-weight: 600; }
.console-page .content-topbar .user-name { font-size: 13px; }
.session-role { color: var(--muted-soft); font-size: 11px; }
.console-page .topbar-user-info-mobile,
.console-page .content-topbar .mobile-menu-toggle { display: none; }

.console-page .sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 18px 12px 0;
  gap: 0;
  background: var(--sidebar);
  color: var(--ink);
  border: 0;
  border-right: 1px solid var(--line);
  box-shadow: none;
  overflow: hidden;
}
.sidebar-workspace { display: flex; align-items: center; gap: 9px; padding: 0 12px 18px; font-size: 13px; font-weight: 550; }
.sidebar-workspace > .lucide { color: var(--muted); }
.workspace-indicator { width: 6px; height: 6px; background: var(--ok); border-radius: 50%; margin-left: auto; }
.console-page .feature-nav { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 4px; padding: 0 0 18px; overflow: visible; border: 0; background: transparent; flex-shrink: 0; }
.nav-group-label { margin: 12px 12px 5px; color: var(--muted-soft); font-size: 11px; font-weight: 500; }
.nav-group-label:first-child { margin-top: 0; }
.console-page .feature-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  text-align: left;
}
.console-page .feature-tab:hover { background: var(--sidebar-hover); color: var(--ink); }
.console-page .feature-tab.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 550; box-shadow: none; }
html[data-theme="dark"] .console-page .feature-tab.active { background: var(--accent-soft); color: var(--accent-dark); box-shadow: none; }
.nav-item-indicator { width: 5px; height: 5px; background: currentColor; border-radius: 50%; margin-left: auto; display: none; }
.feature-tab.active .nav-item-indicator { display: block; }
.sidebar-accounts-heading { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; height: 49px; border-top: 1px solid var(--line-soft); padding: 6px 10px 0; font-size: 12px; color: var(--muted); }
.sidebar-count { font-size: 11px; color: var(--muted-soft); font-variant-numeric: tabular-nums; }
.console-page .add-account-btn { display: inline-flex; align-items: center; justify-content: center; margin: 0 0 0 auto; padding: 0; width: 26px; min-width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); }
.console-page .add-account-btn:hover { background: var(--accent-soft); color: var(--accent-dark); }
.console-page .search-row { position: relative; display: block; margin: 2px 6px 10px; width: auto; max-width: none; flex-shrink: 0; }
.search-row > .lucide { position: absolute; top: 10px; left: 10px; width: 14px; height: 14px; color: var(--muted-soft); }
.console-page .sidebar .search-row input { height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px 0 31px; background: var(--surface); color: var(--ink); font-size: 12px; }
.console-page .sidebar .search-row input::placeholder { color: var(--muted-soft); }
.console-page .sidebar .search-row input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.console-page .account-list { flex: 1 1 auto; min-height: 60px; max-height: none; width: 100% !important; align-self: stretch; margin: 0; padding: 0 4px 12px; border: 0; display: block; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.console-page .account-list::-webkit-scrollbar { width: 4px; }
.console-page .account-list .sb-group { margin-bottom: 8px; }
.console-page .sb-group-head { height: 30px; padding: 0 8px; color: var(--muted); border-radius: 4px; }
.console-page .sb-group-head:hover { background: var(--sidebar-hover); color: var(--ink); }
.console-page .sb-group-name { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.console-page .sb-group-count { font-size: 10px; color: var(--muted-soft); }
.console-page .sb-group-body { gap: 3px; }
.console-page .account-list .account-item { height: 36px; min-height: 36px; padding: 0 8px; border-radius: 5px; background: transparent; }
.console-page .account-list .account-item:hover { background: var(--sidebar-hover); }
.console-page .account-list .account-item.selected { background: var(--accent-soft); box-shadow: none; }
.console-page .account-list .account-item .account-name { color: var(--ink); font-size: 12px; letter-spacing: 0; }
.console-page .account-select { display: block; padding: 0; border: 0; background: transparent; font: inherit; cursor: pointer; }
.console-page .account-list .account-item.selected .account-name { color: var(--accent-dark); font-weight: 550; }
.console-page .account-avatar { color: hsl(var(--av-h, 214) 40% 40%); background: hsl(var(--av-h, 214) 40% 94%); border-radius: 5px; box-shadow: none; }
html[data-theme="dark"] .console-page .account-avatar { color: hsl(var(--av-h, 214) 45% 78%); background: hsl(var(--av-h, 214) 20% 24%); }
.console-page .account-list .account-item.empty { display: flex; min-height: 72px; color: var(--muted-soft); font-size: 12px; }
.console-page .account-list .account-item .tiny-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; min-width: 26px; max-width: 26px; height: 26px; padding: 0; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.console-page .account-list .account-item .tiny-btn > .lucide { width: 13px; height: 13px; }
.console-page .account-list .account-item .tiny-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.console-page .account-list .account-item .account-item-actions { display: flex; left: auto; right: 4px; top: 50%; width: 36px; opacity: 0; }
.console-page .account-list .account-item:hover .account-item-actions,
.console-page .account-list .account-item:focus-within .account-item-actions { opacity: 1; }
.console-page .account-list .account-item .choose-btn { display: none; }
.console-page .account-list .account-item:hover .account-name,
.console-page .account-list .account-item:focus-within .account-name { padding-right: 32px; }
.console-page .account-list .account-item { cursor: pointer; }
.sidebar-footer { margin-top: auto; padding: 15px 10px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted-soft); font-size: 10px; flex-shrink: 0; }
.sidebar-footer-mark { font-weight: 600; font-size: 10px; }

.console-page .content { height: 100%; min-width: 0; min-height: 0; padding: 20px 28px 24px; display: flex; flex-direction: column; gap: 18px; overflow: hidden; background: var(--bg-1); }
.workspace-breadcrumb { display: flex; align-items: center; gap: 8px; min-height: 18px; color: var(--muted-soft); font-size: 12px; flex-shrink: 0; }
.workspace-breadcrumb > .lucide { width: 13px; height: 13px; }
#workspaceBreadcrumb { color: var(--muted); }
#workspaceDate { margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums; }
.workspace-heading { display: flex; align-items: center; gap: 13px; min-height: 28px; flex-shrink: 0; }
.workspace-heading h1 { font-size: 24px; line-height: 1.3; letter-spacing: 0; font-weight: 600; }
.workspace-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.workspace-label > span { width: 5px; height: 5px; background: var(--ok); border-radius: 50%; }
.resource-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; flex-shrink: 0; }
.overview-item { position: relative; display: flex; align-items: center; gap: 16px; min-width: 0; height: 98px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--page-border); border-radius: 8px; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 0.16s; }
.overview-item:hover { border-color: var(--line-strong); }
.overview-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0; }
.overview-icon > .lucide { width: 22px; height: 22px; }
.coral { color: #ed4855; background: #fff0f1; }
.green { color: #209b7a; background: #e9f7f1; }
.blue { color: #4888da; background: #edf4ff; }
html[data-theme="dark"] .coral { color: #ff7a87; background: #3b272c; }
html[data-theme="dark"] .green { color: #6dcbaa; background: #22382f; }
html[data-theme="dark"] .blue { color: #80b1f0; background: #253147; }
.overview-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.overview-copy > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.overview-copy > strong { color: var(--ink); font-size: 27px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.overview-item > .overview-arrow { width: 15px; height: 15px; margin-left: auto; color: var(--muted-soft); align-self: flex-start; }
.console-page .feature-shell { flex: 1 1 auto; min-height: 0; gap: 0; }
.console-page .feature-board { padding: 0; border: 1px solid var(--page-border); border-radius: 8px; box-shadow: none; background: var(--surface); overflow: hidden; }
.console-page .feature-pane { min-height: 0; overflow: hidden; }
.console-page .feature-pane[data-pane="app"],
.console-page .feature-pane[data-pane="sharedApp"],
.console-page .feature-pane[data-pane="command"] { display: flex; flex-direction: column; gap: 0; }
.console-page .resource-mobile-sticky,
.console-page .resource-mobile-sticky.is-pinned { position: static; inset: auto; width: auto; min-width: 0; padding: 22px 24px 18px; border: 0; border-radius: 0; box-shadow: none; background: var(--surface); display: grid; grid-template-columns: max-content minmax(0, 1fr); grid-template-areas: "title meta" "toolbar toolbar"; align-items: center; gap: 20px 16px; flex-shrink: 0; }
.console-page .resource-mobile-sticky::before { display: none; }
.console-page .resource-mobile-sticky h2, .console-page .feature-pane h2 { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.console-page .resource-mobile-sticky .resource-meta { margin: 0; text-align: right; font-size: 12px; line-height: 1.5; color: var(--muted); }
.console-page .resource-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin: 0; }
.console-page .resource-search { flex: 0 1 270px; width: 270px; min-width: 130px; height: 34px; padding: 0 12px; font-size: 12px; border-radius: 6px; }
.console-page .resource-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.console-page .feature-pane .resource-toolbar-actions .resource-strong-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 400; border-radius: 6px; box-shadow: none; white-space: nowrap; }
.console-page .resource-strong-btn > .lucide { width: 15px; height: 15px; }
.console-page .resource-strong-btn:hover { color: var(--accent-dark); border-color: var(--accent); background: var(--surface); box-shadow: none; }
.console-page .feature-pane .resource-toolbar-actions .primary-action { background: var(--accent); border-color: var(--accent); color: var(--text-inverse); }
.console-page .resource-toolbar .primary-action:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--text-inverse); }
.console-page .resource-table-wrapper { flex: 1 1 auto; min-height: 0; margin: 0 24px; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; box-shadow: none; background: var(--surface); }
.console-page .resource-table-scroll { flex: 1 1 auto; overflow: auto; scrollbar-gutter: stable; }
.console-page .resource-table th, .console-page .resource-table td { padding: 14px 12px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.console-page .resource-table th { color: var(--table-head-ink); font-weight: 500; background: var(--table-head-bg); }
.console-page .resource-table td { color: var(--ink); height: 64px; }
.console-page .resource-table th:first-child, .console-page .resource-table td:first-child { width: 52px; }
.console-page .resource-table th:nth-child(3), .console-page .resource-table td:nth-child(3) { width: 170px; color: var(--muted); }
.console-page .resource-table th:last-child, .console-page .resource-table td:last-child { width: 204px; }
.console-page .shared-resource-table th:nth-child(4), .console-page .shared-resource-table td:nth-child(4) { width: 140px; }
.console-page .shared-resource-table th:last-child, .console-page .shared-resource-table td:last-child { width: 110px; }
.console-page .resource-table th:nth-last-child(2), .console-page .resource-table td:nth-last-child(2) { box-shadow: none; }
.console-page .resource-table td.resource-item-name { font-weight: 500; }
.console-page .resource-item-actions { display: flex; gap: 6px; align-items: center; justify-content: center; }
.console-page .resource-item-actions .resource-op-btn { width: 28px; min-width: 28px; max-width: 28px; height: 28px; flex-basis: 28px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); }
.console-page .resource-item-actions .resource-op-btn:hover { color: var(--accent-dark); border-color: transparent; background: var(--accent-soft); }
.console-page .resource-item-actions .resource-op-btn.danger { color: var(--error); }
.console-page .resource-table-scroll:has(.empty-state) { display: flex; }
.console-page .resource-table-body:has(.empty-state) { height: 100%; }
.console-page .resource-table .manage-empty { height: 100%; padding: 45px 16px; width: auto; border: 0; background: transparent; text-align: center; }
.empty-state { display: flex; min-height: 170px; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--muted-soft); font-size: 12px; }
.empty-state > .lucide { width: 40px; height: 40px; margin-bottom: 6px; stroke-width: 1.2; color: var(--line-hover); }
.empty-state > strong { font-weight: 500; color: var(--muted); font-size: 13px; }
.resource-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin: 0 24px; border-top: 1px solid var(--line-soft); color: var(--muted-soft); font-size: 11px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.console-page .account-manage-shell, .console-page .usermgmt-shell { padding: 22px 24px; gap: 18px; }
.console-page .account-manage-wrapper { margin: 0; padding: 0; border: 0; }
.console-page .group-panel { border: 0; border-radius: 0; padding: 12px 0; background: transparent; }
.console-page .group-panel + .group-panel { border-left: 1px solid var(--line-soft); padding-left: 20px; }
.console-page .group-card { border-radius: 6px; box-shadow: none; }
.console-page .group-header-actions .tiny-btn { color: var(--muted); background: var(--surface); border: 1px solid var(--line); font-weight: 400; }
.console-page .group-header-actions .tiny-btn.danger { color: var(--error); border-color: var(--danger-line); }
.console-page .user-table-wrapper { border-radius: 0; box-shadow: none; }
.console-page .group-help-row { font-size: 12px; color: var(--muted); }
.console-page .user-create-row { grid-template-columns: repeat(3, minmax(0, 1fr)) 105px 100px; }

.modal-mask { background: rgba(15, 15, 20, 0.38); backdrop-filter: none; }
.console-page .modal { z-index: 100; }
.console-page #visualTipTemplateModal { z-index: 120; }
.console-page #noticeModal { z-index: 140; }
.modal-panel { border: 1px solid var(--line); border-radius: 8px; padding: 24px; box-shadow: var(--shadow-strong); }
.console-page :is(#passwordModal, #accountModal, #batchAccountModal, #groupActionModal, #visualTipTemplateModal, #userModal, #noticeModal, #marketUpgradeModal, #migrateModal, #localUploadModal, #dependencyUpdateModal, #dependencyAppModal, #rollbackModal, #operationLogModal) .modal-panel { border-radius: 8px; background: var(--surface); }
.modal-panel h3, .notice-modal-heading h3 { font-size: 18px; font-weight: 600; }
.modal-actions { border-top: 1px solid var(--line-soft); padding-top: 18px; margin-top: 8px; }
.modal-panel .modal-actions .ghost-btn, .modal-panel .modal-actions .submit-btn { height: 36px; margin-top: 0; font-size: 13px; }
.modal-panel label { font-size: 13px; font-weight: 500; }
.modal-panel input:not([type="checkbox"]):not([type="radio"]), .modal-panel .select-input { height: 38px; }
.modal-panel textarea.select-input { height: auto; }
.group-count, .dependency-flow-count, .user-role-badge { border-radius: 4px; letter-spacing: 0; }
.console-page .content.is-settings-view .resource-overview,
.console-page .content.is-settings-view .workspace-label { display: none; }

.login-page { overflow-y: auto; }
.login-page .login-shell { position: static; transform: none; display: flex; flex-direction: column; width: 100%; min-height: 100dvh; max-height: none; border: 0; border-radius: 0; background: var(--bg-1); box-shadow: none; margin: 0; overflow: visible; }
.login-masthead { display: flex; align-items: center; gap: 10px; width: 100%; padding: 24px 36px; font-size: 20px; font-weight: 600; }
.login-masthead img { width: 30px; height: 30px; object-fit: contain; }
.login-masthead > span:last-child { font-size: 13px; font-weight: 400; color: var(--muted); padding-left: 16px; margin-left: 8px; border-left: 1px solid var(--line); }
.login-page .login-card { align-self: center; width: min(420px, calc(100% - 40px)); padding: 36px 32px 24px; margin: auto; border: 1px solid var(--page-border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.login-heading { width: 100%; margin-bottom: 26px; }
.login-heading h1 { font-size: 25px; line-height: 1.4; font-weight: 600; letter-spacing: 0; }
.login-heading p { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.login-page #loginForm { max-width: none; gap: 9px; }
.login-page #loginForm label { font-size: 12px; font-weight: 500; margin-top: 6px; }
.login-page #loginForm input:not([type="checkbox"]) { height: 42px; border-radius: 6px; font-size: 13px; }
.login-page .captcha-wrap { display: flex; flex-direction: row; margin-top: 12px; gap: 10px; }
.login-page .captcha-wrap input { min-width: 0; flex: 1 1 auto; }
.login-page .captcha-code { width: 130px; height: 42px; border: 1px solid var(--line); border-radius: 6px; flex-shrink: 0; background: var(--captcha-bg); }
.login-page .remember-row { font-size: 12px; font-weight: 400; margin: 8px 0; }
.login-page .submit-btn { height: 42px; border-radius: 6px; margin-top: 8px; font-size: 14px; font-weight: 500; }
.login-page #message { min-height: 18px; margin: 12px 0 0; font-size: 12px; }
.login-footer { padding: 30px 20px; text-align: center; color: var(--muted-soft); font-size: 11px; line-height: 1.8; }
.login-footer a { color: var(--muted); text-decoration: none; }
.login-footer a:hover { color: var(--accent-dark); }

.guide-page, html[data-theme="dark"] .guide-page {
  --guide-ink: var(--ink);
  --guide-ink-soft: var(--ink);
  --guide-muted: var(--muted);
  --guide-line: var(--line);
  --guide-line-strong: var(--line-strong);
  --guide-paper: var(--surface);
  --guide-soft: var(--surface-soft);
  --guide-soft-2: var(--bg-1);
  --guide-accent: var(--accent);
  --guide-accent-soft: var(--accent-soft);
  --guide-radius: 8px;
  background: var(--bg-1);
}
.guide-page .guide-progress span { background: var(--accent); }

@media (max-width: 1200px) {
  .console-page .content { padding: 18px 20px; }
  .console-page .resource-toolbar { flex-wrap: wrap; }
  .console-page .resource-search { flex: 1 1 180px; width: auto; }
  .console-page .resource-toolbar-actions { gap: 6px; }
  .console-page .resource-strong-btn { padding: 0 9px; }
  .console-page .resource-mobile-sticky, .console-page .account-manage-shell, .console-page .usermgmt-shell { padding: 18px; }
  .console-page .resource-table-wrapper, .console-page .resource-footer { margin-left: 18px; margin-right: 18px; }
}

@media (max-width: 1024px) {
  .console-page .home-shell { grid-template-columns: 212px minmax(0, 1fr); }
  .console-page .resource-mobile-sticky { grid-template-columns: 1fr; grid-template-areas: "title" "meta" "toolbar"; gap: 10px; }
  .console-page .resource-mobile-sticky .resource-meta { text-align: left; white-space: normal; }
  .console-page .resource-toolbar-actions { margin-left: 0; }
  .console-page .resource-search { flex-basis: 100%; }
  .overview-item { height: 86px; padding: 14px; gap: 12px; }
  .overview-icon { width: 36px; height: 36px; }
  .overview-copy > strong { font-size: 24px; }
  .console-page .user-create-row { grid-template-columns: 1fr 1fr; }
  .console-page .user-table-wrapper { overflow: auto; }
  .console-page .user-table { min-width: 740px; }
}

@media (max-width: 760px) {
  .console-page { overflow: hidden; }
  .console-page .home-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); height: 100dvh; }
  .console-page .content-topbar { height: 56px; padding: 0 12px; gap: 6px; }
  .console-brand { gap: 7px; }
  .console-brand > img { width: 25px; height: 25px; }
  .brand-name { font-size: 17px; }
  .brand-name > span { font-size: 12px; }
  .brand-product, .brand-divider, .version-tag, .session-role, .topbar-guide-link > span { display: none; }
  .console-page .content-topbar .mobile-menu-toggle { display: inline-flex; }
  .console-page .content-topbar .topbar-actions, .console-page .content-topbar .topbar-session, .console-page .content-topbar .topbar-buttons-row { gap: 2px; }
  .console-page .content-topbar .topbar-user-info { padding: 0; margin: 0 0 0 4px; border: 0; gap: 0; }
  .console-page .topbar-user-info .user-name { display: none; }
  .console-page .content-topbar .topbar-guide-link { padding: 0; width: 30px; }
  .console-page .content-topbar .ghost-btn { width: 30px; min-width: 30px; height: 34px; }
  .console-page .user-avatar { width: 25px; height: 25px; }
  .console-page .sidebar { position: fixed; top: 56px; bottom: 0; left: 0; z-index: 65; width: 250px; height: auto; max-height: none; padding: 18px 12px 0; transform: translateX(-100%); transition: transform 0.2s; }
  .console-page.sidebar-is-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 56px 0 0; z-index: 60; background: rgba(15, 15, 20, 0.32); }
  .sidebar-backdrop[hidden] { display: none; }
  .console-page .account-list .account-item { min-height: 42px; height: 42px; }
  .console-page .sb-group-head { min-height: 34px; }
  .console-page .content { height: 100%; min-height: 0; padding: 15px 12px; gap: 14px; overflow: auto; }
  .workspace-breadcrumb { font-size: 11px; }
  #workspaceDate { font-size: 10px; }
  .workspace-heading h1 { font-size: 22px; }
  .workspace-label { margin-left: auto; font-size: 10px; }
  .resource-overview { gap: 8px; }
  .overview-item { height: 100px; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
  .overview-icon { position: absolute; top: 12px; right: 10px; width: 25px; height: 25px; border-radius: 5px; }
  .overview-icon > .lucide { width: 15px; height: 15px; }
  .overview-copy { height: 100%; justify-content: space-between; gap: 18px; padding-top: 2px; }
  .overview-copy > span { font-size: 11px; }
  .overview-copy > strong { font-size: 24px; }
  .overview-item > .overview-arrow { display: none; }
  .console-page .feature-shell { min-height: 380px; flex: 1 0 380px; }
  .console-page .feature-board { min-height: 0; padding: 0; overflow: hidden; }
  .console-page .resource-mobile-sticky, .console-page .resource-mobile-sticky.is-pinned { position: static; width: auto; margin: 0; padding: 16px 14px 14px; border: 0; border-radius: 0; box-shadow: none; gap: 10px; }
  .console-page .resource-mobile-sticky h2 { font-size: 16px; }
  .console-page .resource-mobile-sticky .resource-meta { font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
  .console-page .resource-toolbar { display: flex; gap: 10px; }
  .console-page .resource-search { width: 100%; max-width: none; height: 36px; }
  .console-page .feature-pane[data-pane] .resource-toolbar .resource-toolbar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .console-page .feature-pane[data-pane] .resource-toolbar-actions .resource-strong-btn { width: 100%; height: 36px; min-height: 36px; padding: 0 8px; font-size: 12px; }
  .console-page .resource-table-wrapper { margin: 0 14px; padding: 0; overflow: hidden; }
  .console-page .resource-table-head { display: none; }
  .console-page .resource-table-body, .console-page .resource-table-body tbody { display: block; width: 100%; height: auto; }
  .console-page .resource-table .resource-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px 8px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: transparent; box-shadow: none; }
  .console-page .resource-table .resource-row td { display: block; padding: 0; width: auto !important; height: auto; border: 0; min-width: 0; text-align: left; background: transparent; box-shadow: none; }
  .console-page .resource-table .resource-row td::before { display: none; }
  .console-page .resource-table .resource-row td:first-child { grid-row: 1 / 4; }
  .console-page .resource-table .resource-row .resource-item-name { grid-column: 2; white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
  .console-page .resource-table .resource-row .resource-item-time,
  .console-page .resource-table .resource-row .resource-item-meta { grid-column: 2; font-size: 11px; }
  .console-page .resource-table .resource-row td:last-child { grid-column: 2; padding-top: 4px; }
  .console-page .resource-item-actions { justify-content: flex-start; gap: 12px; }
  .console-page .resource-item-actions .resource-op-btn { width: 32px; min-width: 32px; max-width: 32px; height: 32px; flex-basis: 32px; }
  .console-page .resource-table-body:has(.empty-state) { display: table; height: 100%; }
  .console-page .resource-table-body:has(.empty-state) tbody { display: table-row-group; height: 100%; }
  .console-page .resource-table .manage-empty { display: table-cell; padding: 20px 8px; height: 100%; }
  .console-page .resource-table .manage-empty::before { display: none; }
  .console-page .resource-table-body:has(.empty-state) tr { display: table-row; border: 0; background: transparent; box-shadow: none; }
  .console-page .resource-table-body:has(.empty-state) .manage-empty { width: auto !important; }
  .empty-state { min-height: 140px; font-size: 11px; }
  .resource-footer { margin: 0 14px; min-height: 42px; }
  .console-page .account-manage-shell, .console-page .usermgmt-shell { padding: 16px 14px; gap: 12px; overflow: auto; }
  .console-page .group-split-layout { grid-template-columns: minmax(0, 1fr); }
  .console-page .group-panel + .group-panel { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-soft); }
  .console-page .user-create-row { grid-template-columns: minmax(0, 1fr); }
  .console-page .user-table { min-width: 0; width: 100%; }
  .console-page .user-table tbody tr { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); box-shadow: none; padding: 10px 0; }
  .console-page .user-table td { overflow-wrap: anywhere; }
  .console-page .account-manage-wrapper { margin: 0; min-height: 180px; }
  .console-page .account-list .account-item .account-item-actions { opacity: 1; }
  .console-page .account-list .account-item .account-name { padding-right: 32px; }
  .modal { padding: 14px; }
  .modal-panel { width: 100%; max-height: calc(100dvh - 28px); padding: 20px; border-radius: 8px; }
  .modal-panel .modal-actions { flex-wrap: wrap; }
  .login-masthead { padding: 22px 20px; }
  .login-page .login-card { padding: 28px 24px 20px; }
}

@media (max-width: 380px) {
  .brand-name > span, .console-page .topbar-session .user-avatar { display: none; }
  .overview-icon { display: none; }
  .login-masthead > span:last-child { font-size: 12px; margin-left: 0; padding-left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
