:root {
  --bg: #07111b;
  --panel: rgba(15, 28, 42, 0.92);
  --panel-2: rgba(22, 38, 55, 0.94);
  --line: #2b435b;
  --line-2: #3e5c7b;
  --text: #edf5ff;
  --muted: #91a4b9;
  --soft: #c8d5e5;
  --red: #ff4a37;
  --red-2: #db2c24;
  --cyan: #65e3ff;
  --green: #48d66d;
  --amber: #ffc247;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 6% 5%, rgba(101, 227, 255, 0.11), transparent 28%),
    radial-gradient(circle at 92% 0%, rgba(255, 74, 55, 0.12), transparent 26%),
    linear-gradient(135deg, #07131e, #111622 55%, #060d15);
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1500px, calc(100vw - 36px));
  min-height: calc(100vh - 36px);
  margin: 18px auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
}

.sidebar, .main {
  border: 1px solid var(--line);
  background: rgba(8, 17, 27, 0.78);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  min-height: 860px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(58, 86, 115, 0.7);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(#ff6049, #e72f26);
  font-weight: 900;
  font-size: 21px;
}

.brand h1, .topbar h2, .panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.25;
}

.brand p, .topbar p, .panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  margin-top: 28px;
  display: grid;
  gap: 12px;
}

.nav-item {
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(28, 47, 68, 0.76);
  color: var(--text);
  text-align: left;
  padding: 0 18px;
  font-weight: 800;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(255, 74, 55, 0.36), rgba(255, 74, 55, 0.12));
  border-color: var(--red);
}

.side-card {
  margin-top: 28px;
  border: 1px solid var(--line);
  background: rgba(13, 27, 42, 0.76);
  border-radius: 16px;
  padding: 16px;
}

.side-label {
  color: var(--cyan);
  font-weight: 900;
  font-size: 13px;
}

.side-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
}

.main {
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.topbar {
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 25, 38, 0.86);
}

.topbar h2 {
  font-size: 24px;
  line-height: 1;
}

.top-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.pill {
  min-width: 122px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 10px;
  background: rgba(24, 40, 58, 0.92);
  border: 1px solid var(--line-2);
  color: var(--soft);
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}

.pill.strong {
  min-width: 96px;
  color: var(--cyan);
}

.view {
  display: none;
  min-height: 0;
}

.view.active {
  display: block;
}

.toolbar {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 170px 170px;
  gap: 12px;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.search-box, select, input, textarea {
  border: 1px solid var(--line);
  background: rgba(7, 16, 26, 0.82);
  color: var(--text);
  border-radius: 12px;
}

.search-box {
  height: 50px;
  padding: 0 14px;
}

.search-box span {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

input, select, textarea {
  min-width: 0;
  outline: none;
}

.search-box input {
  border: 0;
  background: transparent;
  height: 100%;
}

select {
  height: 50px;
  padding: 0 14px;
}

.summary-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.category-chip {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(33, 60, 84, 0.96), rgba(22, 45, 66, 0.96));
  border-radius: 12px;
  padding: 14px 12px;
  min-height: 66px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.category-chip strong {
  display: block;
  color: #f4f9ff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.category-chip span {
  display: block;
  margin-top: 7px;
  color: #b9c9dc;
  font-size: 14px;
  font-weight: 700;
}

.content-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  min-width: 0;
}

.panel-head {
  padding: 16px;
  border-bottom: 1px solid rgba(58, 86, 115, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.skill-list {
  max-height: 520px;
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.skill-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(35, 56, 76, 0.92), rgba(16, 30, 44, 0.92));
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.skill-card.active {
  border-color: var(--red);
}

.skill-card h4 {
  margin: 0 0 8px;
  font-size: 17px;
}

.skill-card p {
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.6;
}

.meta-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  color: var(--soft);
  background: rgba(101, 227, 255, 0.08);
  border: 1px solid rgba(101, 227, 255, 0.22);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

.card-actions {
  display: grid;
  gap: 8px;
  align-content: center;
}

.primary-btn, .ghost-btn, .danger-btn {
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  color: var(--text);
  font-weight: 900;
  padding: 0 14px;
}

.primary-btn {
  background: linear-gradient(#ff6049, #e72f26);
  border-color: #ff856d;
}

.ghost-btn {
  background: rgba(31, 49, 70, 0.82);
}

.danger-btn {
  background: rgba(255, 74, 55, 0.16);
  border-color: rgba(255, 74, 55, 0.7);
}

.detail-panel {
  min-height: 520px;
}

.skill-detail {
  padding: 16px;
}

.empty {
  color: var(--muted);
  padding: 28px 0;
}

.detail-title {
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 8px;
}

.detail-block {
  margin-top: 16px;
}

.detail-block strong {
  color: var(--cyan);
  display: block;
  margin-bottom: 8px;
}

.detail-block pre {
  white-space: pre-wrap;
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(7, 16, 26, 0.84);
  border: 1px solid var(--line);
  color: var(--soft);
  line-height: 1.55;
  max-height: 230px;
  overflow: auto;
}

.admin-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
}

.import-grid {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.import-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(31, 53, 75, 0.92), rgba(14, 28, 42, 0.92));
  padding: 16px;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
}

.import-card.wide {
  background: rgba(11, 25, 38, 0.92);
}

.import-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(#ff6049, #e72f26);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.import-card h4 {
  margin: 0 0 8px;
  font-size: 19px;
}

.import-card p {
  margin: 0;
  color: var(--soft);
  line-height: 1.65;
  font-size: 13px;
}

.import-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.native-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker {
  min-width: 0;
  height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 16, 26, 0.82);
  cursor: pointer;
}

.file-picker span {
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(#ff6049, #e72f26);
  font-size: 13px;
  font-weight: 900;
}

.file-picker em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #b9c9dc;
  font-style: normal;
  font-size: 13px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-size: 13px;
}

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

label input, label select, label textarea {
  width: 100%;
  padding: 0 12px;
  height: 42px;
}

label textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

.form-actions {
  padding: 0 16px 16px;
  display: flex;
  gap: 10px;
}

.notice-list {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.notice-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 34, 50, 0.86);
  padding: 14px;
}

.notice-item strong {
  display: block;
  color: var(--cyan);
  margin-bottom: 8px;
}

.notice-item span {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.6;
}

.api-list {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.api-list code {
  border: 1px solid var(--line);
  background: rgba(7, 16, 26, 0.84);
  padding: 14px;
  border-radius: 12px;
  color: var(--cyan);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: rgba(15, 28, 42, 0.96);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .sidebar {
    min-height: auto;
  }

  .content-grid, .admin-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
