/* 智能书签 V3 - 用户控制台（对齐 ui-prototypes/console.html） */

:root {
  --cyan: #22d3ee;
  --dim: #5f7091;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --glow: 0 0 22px rgba(34, 211, 238, .14);
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell .topbar {
  height: 62px;
}

.shell .brand {
  align-items: center;
}

.brand-name {
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .5px;
}

.brand-sub {
  display: block;
  font-size: 10px;
  color: var(--dim);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.search {
  flex: 1 1 280px;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: rgba(9, 15, 27, .78);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--dim);
}

.search:focus-within {
  border-color: rgba(34, 211, 238, .55);
  box-shadow: 0 0 18px rgba(34, 211, 238, .12);
}

.search svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 15, 27, .7);
  color: var(--dim);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.icon-btn:hover {
  border-color: rgba(34, 211, 238, .5);
  color: var(--cyan);
  box-shadow: var(--glow);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.shell .layout {
  flex: 1;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 0;
}

.shell .sidebar {
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  background: rgba(9, 15, 27, .72);
  border-right: 1px solid var(--line);
}

.nav-group {
  margin: 14px 8px 6px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--dim);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.nav-item .ic {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 13px;
}

.nav-item:hover {
  background: rgba(34, 211, 238, .06);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, .13), rgba(34, 211, 238, .02));
  border-color: rgba(34, 211, 238, .35);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--cyan), 0 0 18px rgba(34, 211, 238, .10);
}

.nav-item.active .ic {
  color: var(--cyan);
}

.folder-item {
  display: flex;
  align-items: center;
}

.folder-item .nav-item {
  flex: 1;
  min-width: 0;
}

.folder-item .icon-btn {
  width: 26px;
  height: 26px;
  margin-right: 4px;
  font-size: 14px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--dim);
}

#tagList {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 8px 8px;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(34, 211, 238, .06);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-cloud-item:hover {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, .5);
  box-shadow: var(--glow);
}

.tag-cloud-item.active {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, .55);
  background: rgba(34, 211, 238, .12);
  box-shadow: var(--glow);
}

.main {
  padding: 18px 26px 32px;
  overflow-y: auto;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: 20px;
  font-weight: 600;
}

.page-head .desc {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.overview-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

.overview-bar .stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 6px;
  margin: 0;
  align-items: stretch;
  flex: 1;
}

.overview-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  background: linear-gradient(160deg, rgba(16, 26, 48, .9), rgba(10, 17, 31, .9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.overview-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.stats-col .stat {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 16px 8px;
  text-align: center;
  min-height: 0;
}

.stats-col .stat .v {
  font-size: 20px;
}

.stats-col .stat .k {
  font-size: 11px;
}

.actions-col .head-actions {
  justify-content: flex-start;
  margin-top: auto;
}

.actions-col .btn {
  flex: 1 1 calc((100% - 20px) / 3);
}

.batch-bar {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(248, 113, 113, .35);
  border-radius: var(--radius);
  background: rgba(248, 113, 113, .06);
}

.batch-bar.active {
  display: flex;
}

.batch-bar .grow {
  flex: 1;
}

.batch-select-all,
.batch-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.batch-select-all input,
.batch-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.batch-check {
  flex-shrink: 0;
}

.batch-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  white-space: nowrap;
}

.row.selected,
.grid-card.selected {
  border-color: rgba(34, 211, 238, .5);
  box-shadow: 0 0 14px rgba(34, 211, 238, .12);
}

.plugin-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sort-seg button {
  padding: 0 9px;
  font-size: 11.5px;
}

.import-progress {
  min-width: 320px;
  padding: 6px 0 12px;
}

.import-bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(9, 15, 27, .8);
  overflow: hidden;
}

.import-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), #8b5cf6);
  box-shadow: 0 0 12px rgba(34, 211, 238, .45);
  transition: width .25s ease;
}

.import-status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.local-summary {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.local-bookmarks {
  max-height: 46vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 15, 27, .6);
}

.local-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .10);
  cursor: pointer;
}

.local-item:last-child {
  border-bottom: 0;
}

.local-item:hover {
  background: rgba(34, 211, 238, .045);
}

.local-check {
  accent-color: var(--cyan);
}

.local-title {
  color: var(--text);
  font-size: 12.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.local-url {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #0e7490, #22d3ee);
  color: #03131a;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(34, 211, 238, .28);
}

.btn-ghost {
  background: rgba(16, 26, 48, .7);
  border-color: var(--line);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: rgba(34, 211, 238, .5);
  color: var(--cyan);
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-block {
  width: 100%;
}

.panel {
  background: linear-gradient(180deg, rgba(16, 26, 48, .86), rgba(12, 20, 36, .9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(2, 6, 14, .35);
}

.panel-pad {
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}

.stats {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.stats .head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  background: linear-gradient(160deg, rgba(16, 26, 48, .9), rgba(10, 17, 31, .9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat .k {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.stat .v {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.stat .d {
  display: none;
}

.stat .d.up {
  color: var(--green);
}

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

.tab {
  height: 32px;
  padding: 0 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 14px rgba(34, 211, 238, .55);
}

.view-toolbar,
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-bar {
  margin-bottom: 8px;
}

.view-toolbar {
  margin-bottom: 10px;
}

.view-toolbar .grow {
  flex: 1;
}

.select-sm {
  height: 32px;
  font-size: 12px;
}

.seg {
  display: inline-flex;
  background: rgba(9, 15, 27, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
  gap: 3px;
}

.seg button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.seg button.active {
  background: rgba(34, 211, 238, .14);
  border-color: rgba(34, 211, 238, .4);
  color: var(--cyan);
}

.count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
}

.list-panel {
  overflow: hidden;
}

.list-panel.view-grid .list-head,
.list-panel.view-compact .list-head {
  display: none;
}

.list-head,
.row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 0 16px;
}

.list-head {
  height: 40px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--dim);
  background: rgba(9, 15, 27, .6);
  border-bottom: 1px solid var(--line);
}

.row {
  height: 62px;
  border-bottom: 1px solid rgba(148, 163, 184, .10);
  transition: background .12s ease;
  overflow: hidden;
}

.row:last-child {
  border-bottom: none;
}

.row:hover {
  background: rgba(34, 211, 238, .045);
}

.row.compact {
  height: 50px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.row.compact .u {
  display: none;
}

.bookmark-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.favicon {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #061018;
  background: linear-gradient(135deg, #67e8f9, #22d3ee);
  overflow: hidden;
}

.favicon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.favicon > span {
  position: relative;
  z-index: 0;
}

.row,
.grid-card {
  cursor: pointer;
}

.bm-link {
  color: var(--text);
}

.bm-link:hover {
  color: var(--cyan);
  text-decoration: underline;
}

.favicon.v {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #f5f3ff;
}

.favicon.g {
  background: linear-gradient(135deg, #6ee7b7, #10b981);
}

.favicon.a {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
}

.favicon.r {
  background: linear-gradient(135deg, #fca5a5, #ef4444);
}

.t {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.u {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}

.tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.tags .badge {
  flex: 0 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, .08);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.badge.cyan {
  border-color: rgba(34, 211, 238, .4);
  background: rgba(34, 211, 238, .10);
  color: var(--cyan);
}

.badge.violet {
  border-color: rgba(139, 92, 246, .4);
  background: rgba(139, 92, 246, .10);
  color: #c4b5fd;
}

.badge.green {
  border-color: rgba(52, 211, 153, .4);
  background: rgba(52, 211, 153, .10);
  color: var(--green);
}

.badge.amber {
  border-color: rgba(251, 191, 36, .4);
  background: rgba(251, 191, 36, .10);
  color: var(--amber);
}

.badge.red {
  border-color: rgba(248, 113, 113, .4);
  background: rgba(248, 113, 113, .10);
  color: var(--red);
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions .icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

.row-actions .icon-btn svg {
  width: 14px;
  height: 14px;
}

.row-actions .icon-btn.danger:hover {
  color: var(--red);
  border-color: rgba(248, 113, 113, .5);
  box-shadow: 0 0 14px rgba(248, 113, 113, .2);
}

.star-mark {
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  vertical-align: -1px;
}

.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 12px;
  padding: 16px;
}

.grid-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(9, 15, 27, .62);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 150px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.grid-card:hover {
  border-color: rgba(34, 211, 238, .45);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.grid-card .gc-head {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.grid-card .gc-title {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-card .gc-url {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-card .gc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(148, 163, 184, .10);
  padding-top: 10px;
  margin-top: auto;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 0 4px;
  flex-wrap: wrap;
}

.pager-info {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-right: 10px;
  white-space: nowrap;
}

.page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(9, 15, 27, .68);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.page-btn.active {
  border-color: rgba(34, 211, 238, .6);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(34, 211, 238, .15);
}

.page-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.two-col {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 16px;
  align-items: start;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .10);
  font-size: 12.5px;
}

.kv-row:last-child {
  border-bottom: 0;
}

.kv-row .k {
  color: var(--muted);
}

.kv-row .v {
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
}

.text-viewer pre {
  margin: 0;
  max-height: 60vh;
  overflow: auto;
  padding: 14px;
  background: rgba(9, 15, 27, .8);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.image-viewer-img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  border-radius: 8px;
  background: #0a1124;
}

@media (max-width: 1180px) {
  .overview-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1000px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .shell .layout {
    grid-template-columns: 1fr;
  }

  .shell .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-group,
  .sidebar-foot {
    display: none;
  }

  .nav-item {
    width: auto;
  }

  .main {
    padding: 18px 14px 30px;
  }
}

@media (max-width: 560px) {
  .overview-bar .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stats .head-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .overview-bar {
    grid-template-columns: 1fr;
  }

  .actions-col {
    grid-column: auto;
  }

  .local-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .local-url {
    grid-column: 2;
  }

  .stat .v {
    font-size: 20px;
  }

  .list-head {
    display: none;
  }

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

  .row .tags {
    display: none;
  }

  .row.compact {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}
