/* GitHub 电商技能库 */
.skills-panel-page {
  min-width: 0;
  overflow: auto;
}

.skills-panel-page .skill-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.skill-source-note {
  margin: 14px 0 0;
  color: rgba(245, 224, 207, 0.48);
  font-size: 12px;
}

.skill-card {
  cursor: pointer;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.skill-card:hover,
.skill-card:focus-visible {
  border-color: rgba(240, 116, 66, 0.58);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(240, 116, 66, 0.08);
  transform: translateY(-2px);
}

.skill-card-category {
  width: max-content;
  padding: 3px 7px;
  border: 1px solid rgba(226, 127, 81, 0.24);
  border-radius: 999px;
  color: #d89570;
  font-size: 11px;
  line-height: 1;
}

.skill-card small {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.skill-card small span:first-child {
  color: #e8a47c;
  font-weight: 700;
}

.skill-card small span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-card .skill-card-install.installed,
.skill-card.featured .skill-card-install {
  border-color: rgba(237, 123, 72, 0.36);
  background: rgba(226, 103, 55, 0.18);
  color: #ffb18a;
}

.skill-empty {
  min-height: 280px;
  padding-top: 90px;
  color: rgba(245, 224, 207, 0.46);
  text-align: center;
}

.skill-picker-panel {
  left: 50%;
  display: grid;
  width: min(390px, calc(100vw - 32px));
  max-height: min(440px, calc(100vh - 180px));
  gap: 10px;
  padding: 14px;
  color: rgba(255, 241, 228, 0.88);
  transform: translate(-50%, -6px);
}

.toolbar-picker.open .skill-picker-panel {
  transform: translate(-50%, 0);
}

.skill-picker-panel header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 142px;
  align-items: center;
  gap: 12px;
}

.skill-picker-panel header > div {
  display: grid;
  gap: 3px;
}

.skill-picker-panel header strong {
  color: #fff0e4;
  font-size: 14px;
}

.skill-picker-panel header > div span {
  color: rgba(255, 220, 190, 0.5);
  font-size: 11px;
}

.skill-picker-search {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 226, 195, 0.14);
  border-radius: 8px;
  padding: 0 9px;
  background: rgba(5, 4, 3, 0.38);
}

.skill-picker-search input {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f7e6da;
}

.skill-picker-filters {
  display: flex;
  gap: 6px;
}

.skill-picker-filters button {
  min-height: 28px;
  border: 1px solid rgba(255, 226, 195, 0.14);
  border-radius: 8px;
  padding: 0 11px;
  background: rgba(255, 246, 235, 0.055);
  color: rgba(255, 235, 216, 0.68);
  font-size: 12px;
}

.skill-picker-filters button:hover,
.skill-picker-filters button.active {
  border-color: rgba(255, 151, 80, 0.48);
  background: rgba(236, 105, 47, 0.16);
  color: #ffc19b;
}

.skill-picker-list {
  display: grid;
  max-height: 310px;
  gap: 7px;
  overflow: auto;
  padding-right: 3px;
  scrollbar-color: rgba(255, 160, 92, 0.4) rgba(255, 246, 235, 0.06);
  scrollbar-width: thin;
}

.skill-picker-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  border: 1px solid rgba(255, 230, 205, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(255, 246, 235, 0.055);
  color: rgba(255, 239, 225, 0.78);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.skill-picker-item:hover,
.skill-picker-item:focus-visible {
  border-color: rgba(255, 151, 80, 0.48);
  background: linear-gradient(135deg, rgba(240, 106, 51, 0.2), rgba(244, 190, 104, 0.06));
  outline: none;
  transform: translateY(-1px);
}

.skill-picker-item-head {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.skill-picker-item-head strong {
  overflow: hidden;
  color: #f8e8dc;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-picker-item-head b {
  flex: none;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(230, 105, 53, 0.13);
  color: #e9a07b;
  font-size: 10px;
  font-weight: 600;
}

.skill-picker-empty {
  padding: 36px 0;
  color: rgba(245, 224, 207, 0.46);
  text-align: center;
}

.skill-detail-view {
  min-height: calc(var(--workbench-height) - 48px);
}

.skill-detail-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  border-bottom: 1px solid rgba(255, 220, 190, 0.1);
}

.skill-back,
.skill-source-link {
  border: 1px solid rgba(255, 220, 190, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: #d9c3b2;
  text-decoration: none;
}

.skill-back {
  padding: 9px 12px;
}

.skill-source-link {
  padding: 8px 11px;
  font-size: 12px;
}

.skill-back:hover,
.skill-source-link:hover {
  border-color: rgba(235, 124, 73, 0.5);
  color: #f2a57f;
}

.skill-detail-title {
  overflow: hidden;
  color: #f3e5db;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-detail-main {
  display: flex;
  min-height: calc(var(--workbench-height) - 110px);
  flex-direction: column;
  padding: 48px 10% 24px;
}

.skill-detail-hero {
  max-width: 720px;
  margin: auto auto 24px;
  text-align: center;
}

.skill-detail-category {
  display: inline-flex;
  padding: 5px 10px;
  border: 1px solid rgba(234, 124, 76, 0.28);
  border-radius: 999px;
  color: #ec9d76;
  font-size: 12px;
}

.skill-detail-hero h2 {
  margin: 18px 0 10px;
  color: #f7e9df;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(27px, 3vw, 40px);
  font-weight: 500;
}

.skill-detail-hero p {
  margin: 0;
  color: rgba(240, 222, 208, 0.66);
  line-height: 1.7;
}

.skill-detail-meta {
  margin-top: 12px;
  color: rgba(240, 172, 134, 0.66);
  font-size: 12px;
}

.skill-chat {
  display: grid;
  width: min(820px, 100%);
  gap: 10px;
  margin: 0 auto 16px;
}

.skill-message {
  max-width: 80%;
  padding: 12px 15px;
  border: 1px solid rgba(255, 220, 190, 0.1);
  border-radius: 14px;
  color: #e9d8cc;
  line-height: 1.6;
}

.skill-message.user {
  justify-self: end;
  border-color: rgba(235, 118, 65, 0.28);
  background: rgba(208, 88, 39, 0.16);
}

.skill-message.assistant {
  justify-self: start;
  background: rgba(255, 255, 255, 0.04);
}

.skill-message p {
  margin: 5px 0 0;
}

.skill-quick-prompts {
  display: flex;
  width: min(820px, 100%);
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto 14px;
}

.skill-quick-prompts button {
  padding: 8px 12px;
  border: 1px solid rgba(236, 124, 75, 0.24);
  border-radius: 999px;
  background: rgba(204, 89, 42, 0.08);
  color: #e5a17e;
  font-size: 12px;
}

.skill-quick-prompts button:hover {
  background: rgba(214, 95, 45, 0.18);
}

.skill-composer {
  position: relative;
  display: grid;
  width: min(820px, 100%);
  min-height: 150px;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 10px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid rgba(255, 220, 190, 0.16);
  border-radius: 17px;
  background: linear-gradient(150deg, rgba(55, 42, 34, 0.96), rgba(28, 22, 18, 0.96));
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.26);
}

.skill-attach {
  display: grid;
  width: 54px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(255, 220, 190, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: #e4cbb9;
  font-size: 22px;
}

.skill-composer textarea {
  min-height: 68px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f3e4d8;
  font: inherit;
  line-height: 1.6;
}

.skill-composer-footer {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 9px;
}

.skill-composer-footer span,
.skill-install-detail {
  padding: 7px 10px;
  border: 1px solid rgba(255, 220, 190, 0.14);
  border-radius: 9px;
  color: #d9c2b2;
  font-size: 12px;
}

.skill-install-detail.installed {
  border-color: rgba(231, 117, 66, 0.35);
  background: rgba(209, 91, 42, 0.15);
  color: #f0a17b;
}

.skill-send {
  display: grid;
  width: 40px;
  height: 40px;
  margin-left: auto;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #ef824f, #c95124);
  color: white;
  font-size: 19px;
}

body[data-theme="light"] .skill-source-note {
  color: rgba(72, 50, 34, 0.52);
}

body[data-theme="light"] .skill-detail-header {
  border-bottom-color: rgba(91, 62, 40, 0.12);
}

body[data-theme="light"] .skill-detail-title,
body[data-theme="light"] .skill-detail-hero h2 {
  color: #2f241c;
}

body[data-theme="light"] .skill-detail-hero p,
body[data-theme="light"] .skill-message,
body[data-theme="light"] .skill-back,
body[data-theme="light"] .skill-source-link {
  color: #665244;
}

body[data-theme="light"] .skill-composer {
  border-color: rgba(96, 64, 42, 0.15);
  background: rgba(255, 252, 247, 0.92);
  box-shadow: 0 22px 48px rgba(92, 59, 35, 0.12);
}

body[data-theme="light"] .skill-composer textarea {
  color: #33271f;
}

body[data-theme="light"] .skill-message.assistant {
  background: rgba(81, 53, 34, 0.05);
}

@media (max-width: 1100px) {
  .skill-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .skill-detail-main { padding-inline: 5%; }
}

@media (max-width: 760px) {
  .skill-grid { grid-template-columns: 1fr; }
  .skill-detail-header { grid-template-columns: auto 1fr; }
  .skill-source-link { display: none; }
  .skill-detail-main { padding: 30px 14px 18px; }
  .skill-message { max-width: 92%; }
}

/* Cohesive premium light surfaces for the Skills experience. */
body[data-theme="light"] :is(.skills-panel-page, .skill-detail-main) {
  color: #211a17;
  background:
    radial-gradient(circle at 92% 2%, rgba(255, 118, 63, 0.14), transparent 30%),
    linear-gradient(145deg, #faf9f6, #fff 52%, #fff5ed);
}

body[data-theme="light"] :is(.skill-card, .skill-detail-hero, .skill-composer, .skill-picker-panel) {
  border-color: rgba(68, 43, 29, 0.11);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 48px rgba(91, 55, 33, 0.08);
  backdrop-filter: blur(20px) saturate(125%);
}

body[data-theme="light"] .skill-card:hover {
  border-color: rgba(239, 87, 38, 0.25);
  background: #fffaf6;
  box-shadow: 0 22px 52px rgba(109, 60, 31, 0.12);
  transform: translateY(-2px);
}

body[data-theme="light"] :is(.skill-card h3, .skill-detail-title, .skill-detail-hero h2) {
  color: #241c18;
}

body[data-theme="light"] :is(.skill-card p, .skill-card small, .skill-detail-hero p, .skill-source-note) {
  color: #776a62;
}

body[data-theme="light"] :is(.skill-category-button.active, .skill-tab.active, .skill-install-detail.installed) {
  border-color: rgba(235, 82, 31, 0.3);
  background: linear-gradient(145deg, #fff6ef, #ffe3d3);
  color: #d84920;
}
