/* 🍋 柠檬 AI Studio - High-End Distinctive Studio CSS */
:root {
  --bg-dark: #090D16;
  --bg-main: #0F172A;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-hover: rgba(40, 56, 80, 0.95);
  --bg-sidebar: rgba(15, 23, 42, 0.95);
  
  --border-color: rgba(255, 255, 255, 0.12);
  --border-highlight: rgba(255, 255, 255, 0.25);
  
  --text-primary: #FFFFFF;
  --text-secondary: #E2E8F0;
  --text-muted: #94A3B8;
  
  --accent-emerald: #34D399;
  --accent-emerald-bg: rgba(52, 211, 153, 0.15);
  --accent-cyan: #38BDF8;
  --accent-cyan-bg: rgba(56, 189, 248, 0.15);
  --accent-violet: #A78BFA;
  --accent-violet-bg: rgba(167, 139, 250, 0.15);
  --accent-amber: #FBBF24;
  --accent-amber-bg: rgba(251, 191, 36, 0.15);
  --accent-rose: #F472B6;
  --accent-rose-bg: rgba(244, 114, 182, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
  --shadow-emerald-glow: 0 0 20px rgba(52, 211, 153, 0.3);
  --shadow-cyan-glow: 0 0 20px rgba(56, 189, 248, 0.3);
  --shadow-modal: 0 30px 70px rgba(0, 0, 0, 0.85);
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Mesh Glow Background */
.mesh-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 600px;
  background: radial-gradient(circle at 50% -100px, #312E81 0%, #1E1B4B 40%, transparent 80%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

h1, h2, h3, .hero-title, .logo-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

code, pre, .mono, .card-title, .modal-title-row h2 {
  font-family: 'JetBrains Mono', monospace;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: 270px;
  background-color: var(--bg-sidebar);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 26px 22px;
  border-bottom: 1px solid var(--border-color);
}

.logo-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  font-size: 32px;
  background: var(--accent-emerald-bg);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--accent-emerald);
  box-shadow: var(--shadow-emerald-glow);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-subtitle {
  font-size: 12px;
  color: var(--accent-emerald);
  font-weight: 700;
}

.sidebar-menu {
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.menu-item .icon {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  transition: var(--transition);
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.menu-item:hover .icon {
  stroke: var(--text-primary);
}

.menu-item.active {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.2), rgba(52, 211, 153, 0.05));
  color: var(--accent-emerald);
  border: 1px solid rgba(52, 211, 153, 0.4);
  box-shadow: var(--shadow-emerald-glow);
}

.menu-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 4px;
  background-color: var(--accent-emerald);
  border-radius: 0 4px 4px 0;
}

.menu-item.active .icon {
  stroke: var(--accent-emerald);
}

.sidebar-footer {
  padding: 20px 16px;
  border-top: 1px solid var(--border-color);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38BDF8, #34D399);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #050B14;
  box-shadow: var(--shadow-cyan-glow);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-role {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Main Content */
.main-content {
  margin-left: 270px;
  flex: 1;
  padding: 36px 48px;
  max-width: 1750px;
}

/* Top Hero Banner */
.top-header {
  margin-bottom: 36px;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-emerald);
  background: var(--accent-emerald-bg);
  border: 1px solid var(--accent-emerald);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #FFFFFF 60%, #CBD5E1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
}

.stat-card.emerald-glow:hover { box-shadow: var(--shadow-emerald-glow); border-color: var(--accent-emerald); }
.stat-card.cyan-glow:hover { box-shadow: var(--shadow-cyan-glow); border-color: var(--accent-cyan); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.green { background: var(--accent-emerald-bg); border: 1px solid var(--accent-emerald); }
.stat-icon.blue { background: var(--accent-cyan-bg); border: 1px solid var(--accent-cyan); }
.stat-icon.purple { background: var(--accent-violet-bg); border: 1px solid var(--accent-violet); }
.stat-icon.amber { background: var(--accent-amber-bg); border: 1px solid var(--accent-amber); }

.stat-meta {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Search Box & Category Tabs */
.filter-section {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  stroke: var(--accent-cyan);
}

.search-box input {
  width: 100%;
  background-color: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 52px 18px 54px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.25);
}

.clear-search {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tab-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.tab-btn.active {
  background-color: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #050B14;
  font-weight: 800;
  box-shadow: var(--shadow-emerald-glow);
}

.tab-count {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Skills Grid Section */
.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.results-count {
  font-size: 14px;
  color: var(--accent-cyan);
  font-weight: 700;
}

.view-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* Skill Card */
.skill-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-emerald), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.skill-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-emerald);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.6), var(--shadow-emerald-glow);
  background-color: var(--bg-card-hover);
}

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

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.card-icon {
  font-size: 28px;
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-title-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  word-break: break-word;
}

.badge {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 700;
  display: inline-block;
  width: fit-content;
}

.badge-dev { background: var(--accent-cyan-bg); color: var(--accent-cyan); border: 1px solid var(--accent-cyan); }
.badge-design { background: var(--accent-violet-bg); color: var(--accent-violet); border: 1px solid var(--accent-violet); }
.badge-rdq { background: var(--accent-amber-bg); color: var(--accent-amber); border: 1px solid var(--accent-amber); }
.badge-workflow { background: var(--accent-emerald-bg); color: var(--accent-emerald); border: 1px solid var(--accent-emerald); }
.badge-content { background: var(--accent-rose-bg); color: var(--accent-rose); border: 1px solid var(--accent-rose); }
.badge-tools { background: var(--accent-cyan-bg); color: var(--accent-cyan); border: 1px solid var(--accent-cyan); }

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.trigger-badge {
  font-size: 12px;
  color: var(--accent-cyan);
  background: var(--accent-cyan-bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.card-action {
  font-size: 13px;
  color: var(--accent-emerald);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-action span {
  transition: transform 0.2s ease;
}

.skill-card:hover .card-action span {
  transform: translateX(6px);
}

/* Triggers View */
.triggers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.trigger-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trigger-name {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-emerald);
  font-weight: 700;
  font-size: 15px;
}

/* CORE Rules View */
.rules-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--accent-emerald);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-emerald-glow);
}

.rules-card h3 {
  font-size: 22px;
  color: var(--accent-emerald);
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.rules-content h4 {
  font-size: 17px;
  color: var(--accent-cyan);
  margin: 22px 0 10px 0;
}

.rules-content ul {
  padding-left: 24px;
  color: var(--text-secondary);
}

.rules-content li {
  margin-bottom: 8px;
}

/* Modal Drawer Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 11, 20, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #0F172A;
  border: 2px solid var(--accent-emerald);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 900px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-modal), 0 0 40px rgba(52, 211, 153, 0.3);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.open .modal-container {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 22px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #EF4444;
}

.modal-header {
  padding: 28px 36px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 20px;
}

.modal-icon {
  font-size: 38px;
  width: 64px;
  height: 64px;
  background: var(--accent-emerald-bg);
  border: 1.5px solid var(--accent-emerald);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-emerald-glow);
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-title-row h2 {
  font-size: 24px;
  font-weight: 800;
}

.modal-path {
  font-size: 13px;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 6px;
}

/* Modal Body & Tabs */
.modal-body {
  padding: 28px 36px;
  overflow-y: auto;
  flex: 1;
}

.modal-nav-tabs {
  display: flex;
  gap: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  padding-bottom: 12px;
}

.modal-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.modal-tab.active {
  color: var(--accent-emerald);
  background: var(--accent-emerald-bg);
  font-weight: 800;
  border: 1px solid var(--accent-emerald);
}

.modal-tab-content {
  display: none;
}

.modal-tab-content.active {
  display: block;
}

.desc-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.section-subtitle {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 22px 0 14px 0;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent-emerald);
  font-size: 14px;
  color: var(--text-primary);
}

.triggers-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.trigger-chip {
  background: var(--accent-cyan-bg);
  border: 1.5px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
}

.scenarios-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scenario-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border-color);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
}

/* Modal Playground Console */
.playground-box {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pg-label {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 700;
}

.pg-input-wrapper {
  position: relative;
}

.pg-input-wrapper textarea {
  width: 100%;
  background: #090E1A;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  outline: none;
  resize: vertical;
}

.pg-input-wrapper textarea:focus {
  border-color: var(--accent-emerald);
}

.btn-preset {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.btn-preset:hover {
  background: var(--accent-cyan);
  color: #000;
}

.btn-primary {
  background: var(--accent-emerald);
  color: #050B14;
  border: none;
  padding: 15px 28px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  width: fit-content;
  box-shadow: var(--shadow-emerald-glow);
}

.btn-primary:hover {
  background: #10B981;
  transform: translateY(-2px);
}

.pg-output-box {
  background: #060A12;
  border: 1.5px solid var(--accent-emerald);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 14px;
  box-shadow: var(--shadow-emerald-glow);
}

.pg-output-header {
  background: rgba(255, 255, 255, 0.06);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.status-tag {
  color: var(--accent-emerald);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 800;
}

.pg-output-content {
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: #6EE7B7;
  white-space: pre-wrap;
  line-height: 1.7;
}

.modal-footer {
  padding: 20px 36px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-footer-tip {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 992px) {
  .sidebar { width: 70px; }
  .logo-text, .menu-item span, .user-info { display: none; }
  .main-content { margin-left: 70px; padding: 20px; }
}
