/* 「序庭之箱」精致重设计 - 2026-08-31 */
:root {
  color-scheme: dark;
  font-family: Inter, "Microsoft YaHei UI", system-ui, sans-serif;
  color: #f4f7ff;
  background: #07101d;
  --wallpaper-image: none;
  --overlay-color: #0a1222;
  --overlay-opacity: .52;
  --background-blur: 2px;

  /* 精致色彩系统 */
  --primary-bg: #07101d;
  --surface-1: #0e1929;
  --surface-2: #152338;
  --surface-3: #1d2f4a;
  --glass-light: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent-blue: #5b8cff;
  --accent-cyan: #4dd4ff;
  --accent-purple: #a855f7;
  --text-primary: #f4f7ff;
  --text-secondary: #c6d3e8;
  --text-muted: #8997b3;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  isolation: isolate;
  background: var(--primary-bg);
}

/* 背景系统 - 三层渐进式增强 */
body::before,
body::after,
body .bg-overlay {
  position: fixed;
  content: "";
  pointer-events: none;
}

/* 第一层：壁纸与动态渐变 */
body::before {
  inset: calc(var(--background-blur) * -2);
  z-index: -3;
  background-image:
    var(--wallpaper-image),
    radial-gradient(circle at 85% 8%, rgba(91, 140, 255, 0.12), transparent 40rem),
    radial-gradient(circle at 15% 92%, rgba(168, 85, 247, 0.08), transparent 35rem),
    linear-gradient(135deg, #172945, #07101d);
  background-position: center;
  background-size: cover;
  filter: blur(var(--background-blur));
  transform: scale(1.025);
  animation: gentleFloat 20s ease-in-out infinite;
}

@keyframes gentleFloat {
  0%, 100% { transform: scale(1.025) translateY(0); }
  50% { transform: scale(1.028) translateY(-8px); }
}

/* 第二层：色彩蒙版 */
body::after {
  inset: 0;
  z-index: -2;
  background: var(--overlay-color);
  opacity: var(--overlay-opacity);
}

/* 表单元素基础 */
button,
input,
textarea {
  font: inherit;
}

button {
  position: relative;
  padding: .85rem 1.4rem;
  color: var(--primary-bg);
  border: 0;
  border-radius: .85rem;
  background: linear-gradient(135deg, #c4d6ff 0%, #a8bfeb 100%);
  font-weight: 650;
  font-size: .93rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

button:hover::before {
  opacity: 1;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196, 214, 255, 0.25);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
  transform: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(91, 140, 255, 0.5);
  outline-offset: 3px;
}

/* ===== 登录页面 ===== */
.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
}

.auth-card {
  width: min(100%, 28rem);
  padding: 3rem 2.75rem;
  border: 1px solid rgba(91, 140, 255, 0.15);
  border-radius: 1.5rem;
  background:
    linear-gradient(135deg, rgba(21, 35, 56, 0.92), rgba(11, 20, 35, 0.95)),
    radial-gradient(circle at top right, rgba(91, 140, 255, 0.06), transparent);
  backdrop-filter: blur(24px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0 0 .65rem;
  color: var(--accent-cyan);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: 0.85;
}

h1 {
  margin: .1rem 0 .8rem;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 750;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, #f4f7ff 0%, #c6d3e8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.muted {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: .95rem;
}

form {
  display: grid;
  gap: 1.1rem;
  margin-top: 2.25rem;
}

label {
  display: grid;
  gap: .5rem;
  color: var(--text-primary);
  font-size: .88rem;
  font-weight: 500;
}

input,
textarea {
  width: 100%;
  padding: .85rem 1rem;
  color: inherit;
  border: 1px solid rgba(114, 139, 178, 0.25);
  border-radius: .75rem;
  background: rgba(9, 19, 35, 0.6);
  transition: all 0.2s ease;
}

input:hover {
  border-color: rgba(114, 139, 178, 0.4);
}

input:focus {
  border-color: var(--accent-blue);
  background: rgba(9, 19, 35, 0.8);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.1);
}

.form-error {
  margin: 0;
  padding: .75rem 1rem;
  color: #ffb4b4;
  background: rgba(234, 92, 99, 0.1);
  border: 1px solid rgba(234, 92, 99, 0.2);
  border-radius: .75rem;
  font-size: .88rem;
}

/* ===== 主页面 ===== */
.portal-shell {
  width: min(1280px, calc(100% - 4rem));
  margin: 0 auto;
  padding: 1.5rem 0 5rem;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
  padding: .75rem 1.25rem;
  border-radius: 1.25rem;
  background:
    linear-gradient(135deg, rgba(21, 35, 56, 0.5), rgba(11, 20, 35, 0.3));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.portal-brand {
  --brand-image-width: clamp(9rem, 16vw, 12rem);
  --brand-title-overlap: clamp(-3rem, -4vw, -2.25rem);
  display: flex;
  align-items: center;
  min-width: 0;
  color: #fff;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.portal-brand:hover {
  transform: translateX(4px);
}

.portal-brand-image {
  display: block;
  width: var(--brand-image-width);
  height: 3.5rem;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: .75rem;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 45%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 45%, transparent 100%);
}

.portal-brand-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  filter: drop-shadow(0 .25rem 1rem rgba(0, 0, 0, 0.6));
}

.portal-title {
  margin-left: var(--brand-title-overlap);
  white-space: nowrap;
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  font-weight: 750;
  letter-spacing: .055em;
  background: linear-gradient(135deg, #f4f7ff 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 24px rgba(77, 212, 255, 0.3);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.server-status {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .58rem .85rem;
  color: var(--text-primary);
  font-size: .82rem;
  border-radius: .65rem;
  background: rgba(255, 255, 255, 0.03);
  font-weight: 500;
}

#connection-dot {
  width: .58rem;
  height: .58rem;
  border-radius: 50%;
  background: #ea5c63;
  box-shadow: 0 0 16px rgba(234, 92, 99, 0.6);
  animation: pulse-error 2s ease-in-out infinite;
}

@keyframes pulse-error {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.95); }
}

#connection-dot.connected {
  background: #67d7a5;
  box-shadow: 0 0 16px rgba(103, 215, 165, 0.6);
  animation: pulse-success 3s ease-in-out infinite;
}

@keyframes pulse-success {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.header-button {
  padding: .58rem .95rem;
  color: var(--text-primary);
  border: 1px solid rgba(129, 147, 178, 0.2);
  background: rgba(16, 27, 44, 0.7);
  font-size: .82rem;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}

.header-button:hover {
  border-color: rgba(129, 147, 178, 0.4);
  background: rgba(16, 27, 44, 0.9);
  transform: translateY(-1px);
}

/* ===== 插件网格 ===== */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2.25rem;
}

.plugin-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem;
  gap: 1.25rem;
  align-items: center;
  min-height: 7rem;
  padding: 1.1rem 1.4rem;
  overflow: hidden;
  border: 1px solid rgba(155, 175, 209, 0.12);
  border-radius: 1.25rem;
  background:
    linear-gradient(140deg, rgba(20, 36, 59, 0.85), rgba(10, 20, 37, 0.75));
  backdrop-filter: blur(20px);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.plugin-card-link {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
}

.plugin-card-link:focus-visible {
  outline: 3px solid rgba(148, 190, 255, 0.85);
  outline-offset: -3px;
}

/* 卡片光泽效果 */
.plugin-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.plugin-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  pointer-events: none;
}

.plugin-card:hover::before {
  opacity: 1;
}

.plugin-card:hover {
  transform: translateY(-4px);
  border-color: rgba(211, 225, 255, 0.35);
  background: linear-gradient(140deg, rgba(27, 49, 80, 0.95), rgba(13, 28, 48, 0.85));
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(91, 140, 255, 0.1);
}

.plugin-card-copy {
  display: grid;
  position: relative;
  z-index: 2;
  align-content: center;
  gap: .45rem;
  min-width: 0;
  pointer-events: none;
}

.plugin-card.unavailable {
  opacity: .5;
  cursor: not-allowed;
}

.plugin-card.unavailable:hover {
  transform: none;
  border-color: rgba(155, 175, 209, 0.12);
  background: linear-gradient(140deg, rgba(20, 36, 59, 0.85), rgba(10, 20, 37, 0.75));
  box-shadow: none;
}

.plugin-card.unavailable::before {
  opacity: 0;
}

.plugin-card.unavailable .plugin-card-link {
  pointer-events: none;
}

.plugin-card h2 {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.015em;
  color: var(--text-primary);
}

.plugin-card p {
  max-width: 45rem;
  margin: 0;
  color: var(--text-secondary);
  font-size: .89rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.plugin-card small {
  display: block;
  margin-top: .3rem;
  color: var(--text-muted);
  line-height: 1.4;
  font-size: .82rem;
}

.plugin-card .card-state {
  color: var(--text-muted);
}

.plugin-card[data-kind="plugin"][data-state-code="healthy"] .card-state,
.plugin-card[data-kind="external_link"][data-state-code="online"] .card-state {
  color: #9ee8c5;
}

.plugin-card[data-kind="plugin"][data-state-code="starting"] .card-state,
.plugin-card[data-kind="external_link"][data-state-code="checking"] .card-state {
  color: #ffcf8f;
}

.plugin-card[data-kind="plugin"][data-state-code="unhealthy"] .card-state,
.plugin-card[data-kind="plugin"][data-state-code="start_failed"] .card-state,
.plugin-card[data-kind="plugin"][data-state-code="exited"] .card-state,
.plugin-card[data-kind="plugin"][data-state-code="config_error"] .card-state,
.plugin-card[data-kind="external_link"][data-state-code="unreachable"] .card-state {
  color: #ffb4b4;
}

.enter-plugin {
  position: relative;
  z-index: 2;
  width: 5.5rem;
  padding: .65rem .85rem;
  font-size: .85rem;
  font-weight: 600;
  border-radius: .75rem;
}

.empty-state {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed rgba(181, 198, 228, 0.2);
  border-radius: 1.25rem;
  background: rgba(9, 19, 36, 0.4);
}

@media (max-width: 860px) {
  .plugin-grid {
    grid-template-columns: 1fr;
  }
}

.empty-state h2 {
  margin: 0 0 .75rem;
  font-size: 1.25rem;
}

.empty-state p {
  margin: 0;
  line-height: 1.6;
}

/* ===== 对话框 ===== */
.portal-dialog {
  width: min(100% - 2rem, 46rem);
  max-height: min(90vh, 54rem);
  padding: 0;
  overflow: hidden;
  color: var(--text-primary);
  border: 1px solid rgba(154, 179, 219, 0.25);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at 95% 5%, rgba(91, 140, 255, 0.08), transparent 30rem),
    linear-gradient(145deg, rgba(21, 36, 58, 0.98), rgba(11, 20, 35, 0.99));
  backdrop-filter: blur(32px);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.portal-dialog::backdrop {
  background: rgba(2, 7, 19, 0.7);
  backdrop-filter: blur(12px);
}

.portal-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  height: min(90vh, 54rem);
  max-height: min(90vh, 54rem);
  margin: 0;
  padding: .65rem;
}

.dialog-header,
.dialog-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: rgba(16, 28, 43, 0.9);
}

.dialog-header {
  margin: .2rem;
  border-bottom: 1px solid rgba(154, 177, 216, 0.15);
  border-radius: 1rem 1rem 0 0;
}

.dialog-footer {
  margin: .2rem;
  border-top: 1px solid rgba(112, 131, 168, 0.15);
  border-radius: 0 0 1rem 1rem;
  box-shadow: 0 -8px 24px rgba(7, 16, 29, 0.3);
  justify-content: flex-end;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 650;
  letter-spacing: .015em;
}

.dialog-content {
  min-height: 0;
  padding: .25rem .2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 167, 208, 0.3) transparent;
}

.dialog-content::-webkit-scrollbar,
textarea::-webkit-scrollbar {
  width: .5rem;
}

.dialog-content::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
  background: transparent;
}

.dialog-content::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(140, 167, 208, 0.3);
  background-clip: padding-box;
}

.dialog-content::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
  background-color: rgba(181, 201, 233, 0.5);
}

.icon-button {
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  color: var(--text-secondary);
  border: 1px solid rgba(167, 193, 230, 0.2);
  background: rgba(46, 70, 104, 0.4);
  font-size: 1.5rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.icon-button:hover {
  color: var(--text-primary);
  background: rgba(46, 70, 104, 0.6);
  transform: rotate(90deg);
}

.settings-section {
  display: grid;
  gap: .95rem;
  margin: 1rem 1.25rem;
  padding: 1.25rem;
  border: 1px solid rgba(141, 166, 206, 0.12);
  border-radius: 1.15rem;
  background:
    linear-gradient(135deg, rgba(7, 16, 29, 0.6), rgba(28, 45, 71, 0.3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.settings-section h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: .96rem;
  font-weight: 650;
}

.settings-section > label,
.dialog-note,
.setting-hint {
  color: var(--text-secondary);
  font-size: .84rem;
  line-height: 1.6;
}

.setting-hint {
  margin: 0;
}

textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 167, 208, 0.3) transparent;
  background: rgba(6, 14, 28, 0.8);
  border-color: rgba(104, 130, 170, 0.3);
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.color-control {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .85rem;
  padding: .75rem .85rem;
  border: 1px solid rgba(113, 139, 176, 0.2);
  border-radius: .85rem;
  background: rgba(7, 19, 35, 0.5);
}

.color-control > span:first-child {
  font-size: .88rem;
}

.color-swatch {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  overflow: hidden;
  border: 1px solid rgba(185, 201, 230, 0.4);
  border-radius: .7rem;
  box-shadow: 0 0 0 3px rgba(11, 23, 41, 0.5);
}

.color-swatch input[type="color"] {
  position: absolute;
  inset: -.4rem;
  width: calc(100% + .8rem);
  height: calc(100% + .8rem);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.color-swatch input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-swatch input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 0;
}

.range-control {
  display: grid;
  gap: .65rem;
  padding: .8rem .85rem;
  border: 1px solid rgba(113, 139, 176, 0.2);
  border-radius: .85rem;
  background: rgba(7, 19, 35, 0.5);
}

.range-control > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.range-control label {
  font-size: .88rem;
}

.range-control input[type="range"] {
  width: 100%;
  height: .7rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.range-control input[type="range"]::-webkit-slider-thumb {
  width: 1.25rem;
  height: 1.25rem;
  appearance: none;
  border: 3px solid #e6efff;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.range-control input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(77, 212, 255, 0.5);
}

output {
  min-width: 3.5rem;
  color: var(--text-secondary);
  font-size: .8rem;
  text-align: right;
  font-weight: 600;
}

.parameter-readout {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .8rem .85rem;
  color: var(--text-muted);
  border: 1px dashed rgba(130, 155, 186, 0.25);
  border-radius: .85rem;
  font: 500 .77rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.parameter-readout b {
  color: var(--accent-cyan);
  font-weight: 700;
}

.settings-feedback {
  min-height: 1.3rem;
  margin: 0;
  color: var(--text-secondary);
  font-size: .82rem;
}

.secondary-button {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(44, 64, 95, 0.9), rgba(36, 52, 78, 0.9));
  border: 1px solid rgba(129, 147, 178, 0.2);
}

.secondary-button:hover {
  background: linear-gradient(135deg, rgba(52, 74, 110, 0.95), rgba(44, 62, 92, 0.95));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.danger-button {
  color: #ffe9e7;
  border: 1px solid rgba(255, 137, 129, .3);
  background: linear-gradient(135deg, rgba(137, 48, 55, .88), rgba(91, 35, 45, .9));
}

.danger-button:hover {
  background: linear-gradient(135deg, rgba(162, 55, 62, .95), rgba(113, 39, 50, .95));
}

.manager-dialog {
  width: min(100% - 2rem, 72rem);
}

.manager-controls {
  display: grid;
  gap: .8rem;
  margin: 1rem 1.5rem 0;
  padding: 1rem;
  border: 1px solid rgba(140, 166, 203, .2);
  border-radius: 1rem;
  background: rgba(7, 17, 31, .55);
}

.maintenance-summary,
.entry-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.maintenance-summary {
  color: var(--text-secondary);
  font-size: .82rem;
}

.maintenance-active {
  color: #ffcf8f;
  font-weight: 700;
}

.maintenance-inactive {
  color: #9ee8c5;
  font-weight: 700;
}

.manager-actions {
  flex-wrap: wrap;
}

.entry-list-heading {
  margin: 1rem 1.5rem 0;
}

.entry-list-heading .dialog-note {
  margin: 0;
}

.link-editor-content {
  display: grid;
  gap: .7rem;
  padding: 1.25rem 1.5rem;
}

.link-editor-content label {
  color: var(--text-secondary);
  font-size: .84rem;
}

.link-dialog-footer {
  justify-content: flex-start;
}

.dialog-footer-spacer {
  flex: 1;
}

.dialog-note {
  margin: 1.25rem 1.5rem 0;
}

/* ===== 拖拽排序 ===== */
.order-list {
  display: grid;
  gap: .6rem;
  margin: 1.25rem 1.5rem;
  padding: 0;
  list-style: none;
}

.order-row,
.order-placeholder {
  min-height: 3.75rem;
  border-radius: .95rem;
}

.order-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .95rem 1.1rem;
  border: 1px solid rgba(140, 166, 203, 0.2);
  background: linear-gradient(120deg, rgba(10, 20, 36, 0.85), rgba(27, 44, 70, 0.6));
  cursor: default;
  touch-action: auto;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.order-row:hover {
  border-color: rgba(140, 166, 203, 0.35);
  background: linear-gradient(120deg, rgba(15, 25, 41, 0.9), rgba(32, 49, 75, 0.7));
}

.order-row.drag-ready {
  border-color: rgba(198, 216, 247, 0.5);
  background: linear-gradient(120deg, rgba(20, 30, 46, 0.95), rgba(37, 54, 80, 0.8));
  box-shadow: 0 0 0 3px rgba(140, 174, 229, 0.15);
  transform: scale(1.015);
}

.drag-node {
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  flex: 0 0 auto;
  color: var(--text-secondary);
  border: 1px solid rgba(158, 184, 224, 0.3);
  border-radius: .65rem;
  background: rgba(49, 75, 113, 0.4);
  font-size: 1.1rem;
  line-height: 1;
  letter-spacing: -.18em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: grab;
  touch-action: none;
}

.order-row-copy {
  display: grid;
  flex: 1 1 14rem;
  gap: .2rem;
  min-width: 0;
}

.order-label {
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.order-meta {
  color: var(--text-muted);
  font-size: .75rem;
  line-height: 1.35;
}

.order-row[data-state-code="healthy"] .order-meta,
.order-row[data-state-code="online"] .order-meta {
  color: #9ee8c5;
}

.order-row[data-state-code="starting"] .order-meta,
.order-row[data-state-code="checking"] .order-meta {
  color: #ffcf8f;
}

.order-row[data-state-code="unhealthy"] .order-meta,
.order-row[data-state-code="start_failed"] .order-meta,
.order-row[data-state-code="exited"] .order-meta,
.order-row[data-state-code="config_error"] .order-meta,
.order-row[data-state-code="unreachable"] .order-meta {
  color: #ffb4b4;
}

.order-row-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .45rem;
}

.compact-button {
  min-width: 3.5rem;
  padding: .48rem .65rem;
  font-size: .76rem;
}

.order-placeholder {
  border: 1px dashed rgba(198, 215, 250, 0.4);
  background: rgba(138, 167, 219, 0.08);
  box-shadow: inset 0 0 0 1px rgba(212, 226, 255, 0.1);
}

.drag-ghost {
  position: fixed;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .95rem 1.1rem;
  color: var(--text-primary);
  border: 1px solid rgba(212, 226, 255, 0.6);
  border-radius: .95rem;
  background: linear-gradient(120deg, rgba(26, 45, 79, 0.98), rgba(12, 24, 42, 0.98));
  backdrop-filter: blur(24px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: .98;
  transform: scale(1.035) rotate(.5deg);
  transform-origin: center;
}

body.dragging-plugin {
  cursor: grabbing;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .portal-shell {
    width: min(100% - 2rem, 1280px);
    padding-top: 1rem;
  }

  .portal-header {
    flex-wrap: wrap;
    padding: .65rem 1rem;
  }

  .portal-brand {
    --brand-image-width: 8.5rem;
    --brand-title-overlap: -2.25rem;
  }

  .portal-brand-image {
    height: 3rem;
  }

  .portal-title {
    font-size: 1.3rem;
  }

  .portal-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .header-button {
    padding: .52rem .7rem;
    font-size: .78rem;
  }

  .server-status {
    padding: .52rem .5rem;
    font-size: .78rem;
  }

  .plugin-grid {
    grid-template-columns: 1fr;
    margin-top: 1.5rem;
    gap: 1rem;
  }

  .plugin-card {
    min-height: 6.5rem;
    padding: 1rem 1.2rem;
  }

  .settings-actions {
    flex-direction: column;
  }

  .portal-dialog {
    width: min(100% - 1.5rem, 42rem);
  }

  .drag-ghost {
    max-width: calc(100vw - 2rem);
  }

  .order-row {
    flex-wrap: wrap;
  }

  .order-row-copy {
    flex-basis: calc(100% - 3rem);
  }

  .order-row-actions {
    width: 100%;
  }

  .entry-list-heading,
  .maintenance-summary {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 2.5rem 2rem;
  }

  .portal-brand {
    --brand-image-width: 7.5rem;
    --brand-title-overlap: -2rem;
  }

  .plugin-card {
    grid-template-columns: minmax(0, 1fr) 5rem;
    gap: 1rem;
  }

  .enter-plugin {
    width: 5rem;
    padding: .6rem .7rem;
    font-size: .82rem;
  }

  .portal-dialog {
    width: calc(100% - 1rem);
  }
}

/* ===== 辅助动画 ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
