/* ===============================================
   穿越鳌太线 - 游戏样式
   =============================================== */

/* CSS 变量 - 设计系统 */
:root {
  /* 颜色 - 山野探险主题 */
  --color-bg-primary: #0a0f1a;
  --color-bg-secondary: #121a2d;
  --color-bg-tertiary: #1a2540;
  --color-bg-card: rgba(26, 37, 64, 0.8);

  --color-text-primary: #e8edf5;
  --color-text-secondary: #a0aec0;
  --color-text-muted: #6c7a94;

  --color-accent-primary: #4fd1c5;
  --color-accent-secondary: #68d391;
  --color-accent-warning: #f6ad55;
  --color-accent-danger: #fc8181;
  --color-accent-info: #63b3ed;

  /* 渐变 */
  --gradient-mountain: linear-gradient(135deg, #1a2540 0%, #2d3748 50%, #1a202c 100%);
  --gradient-sky: linear-gradient(180deg, #0a0f1a 0%, #1a2540 50%, #2d3748 100%);
  --gradient-health: linear-gradient(90deg, #fc8181 0%, #f6ad55 50%, #68d391 100%);
  --gradient-cold: linear-gradient(90deg, #63b3ed 0%, #4fd1c5 100%);

  /* 阴影 */
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(79, 209, 197, 0.2);

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* 过渡 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* 字体 */
  --font-primary: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;
}

/* 基础重置 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--gradient-sky);
  color: var(--color-text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(79, 209, 197, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(99, 179, 237, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* 游戏容器 */
#game-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===============================================
   状态栏
   =============================================== */
#status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
  animation: slideDown 0.5s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 140px;
}

.status-item.compact {
  flex: 0 0 auto;
  min-width: auto;
  padding: 6px 12px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

.status-item.weather {
  background: linear-gradient(135deg, var(--color-bg-tertiary), rgba(99, 179, 237, 0.2));
}

.status-icon {
  font-size: 1.2rem;
}

.status-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  min-width: 32px;
}

.status-bar-container {
  flex: 1;
  height: 8px;
  background: var(--color-bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.status-bar {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-normal);
  width: 100%;
}

#health-bar {
  background: var(--color-accent-secondary);
}

#morale-bar {
  background: var(--color-accent-info);
}

#hunger-bar {
  background: var(--color-accent-warning);
  width: 0%;
}

#warmth-bar {
  background: var(--color-accent-primary);
}

.status-value {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 28px;
  text-align: right;
}

.unit {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ===============================================
   主内容区域
   =============================================== */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#story-container {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#scene-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#story-text {
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--color-text-primary);
}

#story-text p {
  margin-bottom: 16px;
}

#story-text .highlight {
  color: var(--color-accent-primary);
  font-weight: 500;
}

#story-text .warning {
  color: var(--color-accent-warning);
}

#story-text .danger {
  color: var(--color-accent-danger);
}

/* ===============================================
   商店界面
   =============================================== */
#shop-container {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#shop-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
}

#budget-display {
  font-size: 1.2rem;
  padding: 8px 16px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

#budget-value {
  font-weight: 700;
  color: var(--color-accent-secondary);
}

#shop-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.category-btn {
  padding: 8px 16px;
  border: none;
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

.category-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.category-btn.active {
  background: var(--color-accent-primary);
  color: var(--color-bg-primary);
  font-weight: 600;
}

#shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 20px;
}

#shop-items::-webkit-scrollbar {
  width: 6px;
}

#shop-items::-webkit-scrollbar-track {
  background: var(--color-bg-primary);
  border-radius: 3px;
}

#shop-items::-webkit-scrollbar-thumb {
  background: var(--color-bg-tertiary);
  border-radius: 3px;
}

.shop-item {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.shop-item:hover {
  border-color: var(--color-accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.shop-item.selected {
  border-color: var(--color-accent-secondary);
  background: rgba(104, 211, 145, 0.1);
}

.shop-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.shop-item-name {
  font-weight: 600;
  font-size: 1rem;
}

.shop-item-price {
  color: var(--color-accent-warning);
  font-weight: 700;
}

.shop-item-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.shop-item-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.effect-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--color-accent-primary);
}

#cart-summary {
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px;
}

#cart-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 32px;
}

.cart-item-tag {
  font-size: 0.8rem;
  padding: 4px 12px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-item-tag .remove-btn {
  cursor: pointer;
  color: var(--color-accent-danger);
  font-weight: bold;
}

#cart-total {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

#cart-cost {
  font-weight: 700;
  color: var(--color-accent-warning);
}

/* ===============================================
   选项按钮
   =============================================== */
#choices-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-btn {
  padding: 16px 24px;
  background: var(--color-bg-card);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.choice-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-accent-primary);
  transform: scaleY(0);
  transition: transform var(--transition-fast);
}

.choice-btn:hover {
  border-color: var(--color-accent-primary);
  background: var(--color-bg-tertiary);
  transform: translateX(4px);
}

.choice-btn:hover::before {
  transform: scaleY(1);
}

.choice-btn:active {
  transform: translateX(4px) scale(0.98);
}

.choice-btn.primary {
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
  border: none;
  color: var(--color-bg-primary);
  font-weight: 600;
  text-align: center;
}

.choice-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 209, 197, 0.3);
}

.choice-btn.primary::before {
  display: none;
}

.choice-btn.danger {
  border-color: rgba(252, 129, 129, 0.3);
}

.choice-btn.danger:hover {
  border-color: var(--color-accent-danger);
  background: rgba(252, 129, 129, 0.1);
}

/* ===============================================
   页脚
   =============================================== */
#game-footer {
  text-align: center;
  padding: 20px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

#game-footer p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ===============================================
   工具类
   =============================================== */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.4s ease;
}

.slide-up {
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===============================================
   响应式布局
   =============================================== */
@media (max-width: 768px) {
  #game-container {
    padding: 12px;
  }

  #status-bar {
    gap: 10px;
    padding: 12px;
  }

  .status-item {
    min-width: 120px;
  }

  .status-item.compact {
    padding: 4px 8px;
    font-size: 0.85rem;
  }

  #story-container {
    padding: 20px;
  }

  #scene-title {
    font-size: 1.4rem;
  }

  #story-text {
    font-size: 1rem;
  }

  #shop-items {
    grid-template-columns: 1fr;
    max-height: 300px;
  }

  .choice-btn {
    padding: 14px 18px;
  }
}

@media (max-width: 480px) {
  .status-item {
    flex: 1 1 45%;
    min-width: 100px;
  }

  .status-label {
    display: none;
  }

  #shop-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  #shop-categories {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }

  .category-btn {
    flex-shrink: 0;
  }
}

/* ===============================================
   结局页面样式
   =============================================== */
.ending-container {
  text-align: center;
  padding: 40px 20px;
}

.ending-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.ending-title {
  font-size: 2rem;
  margin-bottom: 16px;
}

.ending-title.success {
  color: var(--color-accent-secondary);
}

.ending-title.failure {
  color: var(--color-accent-danger);
}

.ending-title.neutral {
  color: var(--color-accent-warning);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: 30px 0;
}

.stat-card {
  background: var(--color-bg-tertiary);
  padding: 16px;
  border-radius: var(--radius-md);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent-primary);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* ===============================================
   模态框
   =============================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-soft);
  animation: slideUp 0.3s ease;
}

.modal-content h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-info));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-desc {
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-primary);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.2);
}

.form-group input::placeholder {
  color: var(--color-text-muted);
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.btn-primary {
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-bg-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 209, 197, 0.3);
}

.btn-secondary {
  padding: 14px 24px;
  background: var(--color-bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--color-bg-card);
  color: var(--color-text-primary);
}

.modal-warning {
  font-size: 0.8rem;
  color: var(--color-accent-warning);
  text-align: center;
  margin-top: 20px;
}

/* ===============================================
   加载遮罩
   =============================================== */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 26, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-bg-tertiary);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#loading-text {
  color: var(--color-text-secondary);
  font-size: 1rem;
}

/* ===============================================
   AI事件标记
   =============================================== */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 3px 8px;
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.2), rgba(99, 179, 237, 0.2));
  border-radius: var(--radius-sm);
  color: var(--color-accent-info);
  margin-left: 8px;
}

/* ===============================================
   主题切换按钮
   =============================================== */
#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#theme-toggle:hover {
  transform: scale(1.1);
  background: var(--color-bg-tertiary);
}

#theme-toggle:active {
  transform: scale(0.95);
}

/* ===============================================
   办公主题 (摸鱼模式)
   VS Code Light 主题 + 三栏布局
   =============================================== */

/* 办公主题 - 隐藏默认布局，显示VS Code布局 */
[data-theme="office"] #default-layout {
  display: none !important;
}

[data-theme="office"] #vscode-layout {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  font-family: 'Segoe UI', 'Consolas', sans-serif;
  background: #f3f3f3;
}

[data-theme="office"] #theme-toggle {
  display: none;
}

[data-theme="office"] #game-container {
  max-width: none;
  padding: 0;
}

/* VS Code 标题栏 */
#vscode-titlebar {
  display: flex;
  align-items: center;
  height: 30px;
  background: #dddddd;
  border-bottom: 1px solid #cccccc;
  font-size: 12px;
  color: #333333;
  user-select: none;
}

.vscode-menu {
  display: flex;
  gap: 4px;
  padding: 0 8px;
}

.menu-item {
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
}

.menu-item:hover {
  background: #c5c5c5;
}

.vscode-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #666666;
}

.vscode-window-controls {
  display: flex;
  height: 100%;
}

.win-btn {
  width: 46px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
}

.win-btn:hover {
  background: #c5c5c5;
}

.win-btn.win-close:hover {
  background: #e81123;
  color: white;
}

/* VS Code 主体区域 */
#vscode-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 活动栏 */
#vscode-activity-bar {
  width: 48px;
  background: #2c2c2c;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
}

.activity-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #858585;
  cursor: pointer;
  font-size: 20px;
  border-left: 2px solid transparent;
}

.activity-icon:hover {
  color: #ffffff;
}

.activity-icon.active {
  color: #ffffff;
  border-left-color: #ffffff;
}

.activity-spacer {
  flex: 1;
}

#vscode-theme-toggle {
  font-size: 11px;
  font-weight: bold;
}

/* 侧边栏 */
#vscode-sidebar {
  width: 220px;
  background: #f3f3f3;
  border-right: 1px solid #e5e5e5;
  overflow-y: auto;
  font-size: 13px;
}

.sidebar-header {
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 600;
  color: #6f6f6f;
  letter-spacing: 0.5px;
}

.sidebar-section {
  margin-bottom: 4px;
}

.section-title {
  padding: 4px 8px 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-title:hover {
  background: #e8e8e8;
}

.collapse-icon {
  font-size: 8px;
  color: #666666;
}

.section-content {
  padding-left: 16px;
}

.file-item {
  padding: 3px 8px 3px 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #333333;
  font-size: 13px;
  font-family: 'Consolas', 'Courier New', monospace;
}

.file-item:hover {
  background: #e8e8e8;
}

.file-item.empty {
  color: #6a9955;
  font-style: italic;
}

.file-icon {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 3px;
  border-radius: 2px;
  font-family: 'Segoe UI', sans-serif;
}

.file-icon.ts {
  background: #3178c6;
  color: white;
}

.file-icon.js,
.file-icon.json {
  background: #f7df1e;
  color: #333;
}

.file-icon.md {
  background: #083fa1;
  color: white;
}

.file-value {
  margin-left: auto;
  color: #098658;
  font-weight: 600;
}

/* 编辑器区域 */
#vscode-editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow: hidden;
}

/* 标签栏 */
#vscode-tabs {
  display: flex;
  background: #ececec;
  border-bottom: 1px solid #e5e5e5;
  height: 35px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: #ececec;
  border-right: 1px solid #e5e5e5;
  font-size: 13px;
  color: #333333;
  cursor: pointer;
}

.tab.active {
  background: #ffffff;
  border-bottom: 1px solid #ffffff;
  margin-bottom: -1px;
}

.tab-icon {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 3px;
  border-radius: 2px;
  background: #f7df1e;
  color: #333;
}

.tab-close {
  font-size: 10px;
  color: #666666;
  padding: 2px;
  border-radius: 3px;
}

.tab-close:hover {
  background: #d0d0d0;
}

/* 编辑器 */
#vscode-editor {
  flex: 1;
  display: flex;
  overflow-y: auto;
  background: #ffffff;
  font-family: 'Consolas', 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
}

#vscode-line-numbers {
  width: 50px;
  background: #ffffff;
  color: #858585;
  text-align: right;
  padding: 8px 12px 8px 0;
  font-size: 13px;
  line-height: 1.6;
  border-right: 1px solid #e5e5e5;
  user-select: none;
}

#vscode-code {
  flex: 1;
  padding: 8px 16px;
  overflow-x: auto;
}

.code-line {
  white-space: pre-wrap;
  min-height: 22px;
}

.keyword {
  color: #0000ff;
}

.function {
  color: #795e26;
}

.punctuation {
  color: #333333;
}

.comment,
.comment-text {
  color: #008000;
}

.string {
  color: #a31515;
}

.variable {
  color: #001080;
}

#vscode-choices {
  padding: 8px 0;
}

.vscode-choice {
  padding: 4px 0 4px 16px;
  cursor: pointer;
  color: #0000ff;
  display: flex;
  align-items: center;
}

.vscode-choice:hover {
  background: #e8e8e8;
}

.vscode-choice::before {
  content: '>';
  color: #795e26;
  margin-right: 8px;
  font-weight: bold;
}

.vscode-choice.selected {
  background: #d4edda;
}

.vscode-choice.selected .keyword {
  color: #28a745;
}

.vscode-choice.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vscode-choice.confirm-btn {
  margin-top: 16px;
  padding: 8px 16px;
  background: #e3f2fd;
  border-radius: 4px;
}

.vscode-choice.confirm-btn:hover {
  background: #bbdefb;
}

/* 商店分类标题 */
.vscode-category-header {
  padding: 6px 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e8e8e8;
  border-radius: 3px;
  margin: 8px 0 4px 0;
}

.vscode-category-header:first-child {
  margin-top: 0;
}

.vscode-category-header:hover {
  background: #d8d8d8;
}

.vscode-category-header .collapse-icon {
  font-size: 10px;
  color: #666;
  width: 12px;
}

.vscode-category-header .category-name {
  color: #0000ff;
  font-weight: 600;
}

.vscode-category-header .category-count {
  color: #098658;
  font-size: 11px;
  margin-left: auto;
}

/* 商店子项 */
.vscode-choice.vscode-shop-item {
  padding-left: 28px;
}

.vscode-choice.vscode-shop-item::before {
  content: '';
}

/* 终端面板 */
#vscode-terminal {
  height: 150px;
  background: #f3f3f3;
  border-top: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
}

.terminal-tabs {
  display: flex;
  background: #f3f3f3;
  padding: 0 8px;
  border-bottom: 1px solid #e5e5e5;
}

.terminal-tab {
  padding: 6px 12px;
  font-size: 11px;
  color: #666666;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.terminal-tab.active {
  color: #333333;
  border-bottom: 1px solid #333333;
  margin-bottom: -1px;
}

.terminal-content {
  flex: 1;
  padding: 8px 16px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  color: #333333;
  background: #ffffff;
  overflow-y: auto;
}

.terminal-line {
  line-height: 1.5;
}

.terminal-line::before {
  content: '';
}

/* 状态栏 */
#vscode-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 22px;
  background: #007acc;
  color: #ffffff;
  font-size: 12px;
  padding: 0 8px;
}

.statusbar-left,
.statusbar-right {
  display: flex;
  align-items: center;
}

.statusbar-item {
  padding: 0 8px;
  cursor: pointer;
}

.statusbar-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.statusbar-item.branch::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="white"><path d="M9 2.5A2.5 2.5 0 1 1 4 2.5a2.5 2.5 0 0 1 5 0zm3 11A2.5 2.5 0 1 1 7 13.5a2.5 2.5 0 0 1 5 0zM5.5 5a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 1 0v-5a.5.5 0 0 0-.5-.5z"/></svg>') center/contain no-repeat;
}

/* 办公主题 - 模态框适配 */
[data-theme="office"] .modal {
  font-family: 'Segoe UI', 'Consolas', sans-serif;
}

[data-theme="office"] .modal-content {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 0;
  color: #333333;
}

[data-theme="office"] .modal-content h2 {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: #333333;
  font-family: 'Segoe UI', sans-serif;
}

[data-theme="office"] .form-group label {
  color: #333333;
}

[data-theme="office"] .form-group input {
  background: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 0;
  color: #333333;
  font-family: 'Consolas', monospace;
}

[data-theme="office"] .form-group input:focus {
  border-color: #007acc;
  outline: 1px solid #007acc;
}

[data-theme="office"] .form-hint {
  color: #666666;
}

[data-theme="office"] .btn-primary {
  background: #007acc;
  border-radius: 0;
}

[data-theme="office"] .btn-primary:hover {
  background: #005a9e;
}

[data-theme="office"] .btn-secondary {
  background: #e5e5e5;
  border: 1px solid #cccccc;
  border-radius: 0;
  color: #333333;
}

[data-theme="office"] .modal-warning {
  color: #d83b01;
}

/* 办公主题 - 加载遮罩 */
[data-theme="office"] #loading-overlay {
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="office"] .loading-content {
  color: #333333;
}

[data-theme="office"] .loading-spinner {
  border-color: #e5e5e5;
  border-top-color: #007acc;
}

[data-theme="office"] #loading-text {
  color: #333333;
}

--color-bg-primary: #1e1e1e;
--color-bg-secondary: #252526;
--color-bg-tertiary: #2d2d30;
--color-bg-card: #1e1e1e;

--color-text-primary: #d4d4d4;
--color-text-secondary: #808080;
--color-text-muted: #6a6a6a;

/* 代码高亮配色 */
--color-accent-primary: #569cd6;
/* 关键字蓝 */
--color-accent-secondary: #4ec9b0;
/* 类型青 */
--color-accent-warning: #dcdcaa;
/* 函数黄 */
--color-accent-danger: #f14c4c;
/* 错误红 */
--color-accent-info: #ce9178;
/* 字符串橙 */

/* 平铺渐变替换为纯色 */
--gradient-mountain: #1e1e1e;
--gradient-sky: #1e1e1e;
--gradient-health: var(--color-accent-secondary);
--gradient-cold: var(--color-accent-primary);

/* 减小圆角 */
--radius-sm: 3px;
--radius-md: 4px;
--radius-lg: 6px;

/* 等宽字体 */
--font-primary: 'Consolas',
'Fira Code',
'Monaco',
'Courier New',
monospace;
}

/* 办公主题 - 隐藏背景装饰 */
[data-theme="office"] body::before {
  display: none;
}

/* 办公主题 - 背景纯色 */
[data-theme="office"] body {
  background: #1e1e1e;
}

/* 办公主题 - 状态栏 (模拟 VS Code 底部状态栏) */
[data-theme="office"] #status-bar {
  background: #007acc;
  border-radius: 0;
  border: none;
  padding: 4px 12px;
  gap: 16px;
  box-shadow: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  z-index: 50;
}

[data-theme="office"] .status-item {
  min-width: auto;
  gap: 4px;
}

[data-theme="office"] .status-icon {
  font-size: 0.9rem;
}

[data-theme="office"] .status-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
}

[data-theme="office"] .status-value {
  color: #fff;
  font-size: 0.75rem;
}

[data-theme="office"] .status-bar-container {
  display: none;
}

[data-theme="office"] .status-item.compact {
  background: transparent;
  padding: 0;
}

[data-theme="office"] .status-item.weather {
  background: transparent;
}

/* 办公主题 - 留出底部状态栏空间 */
[data-theme="office"] #game-container {
  padding-bottom: 50px;
}

/* 办公主题 - 故事容器 (模拟代码编辑器) */
[data-theme="office"] #story-container {
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  border-radius: 0;
  font-family: var(--font-primary);
  position: relative;
  padding: 20px 20px 20px 60px;
}

/* 行号装饰 */
[data-theme="office"] #story-container::before {
  content: '1\A2\A3\A4\A5\A6\A7\A8\A9\A10\A11\A12';
  white-space: pre;
  position: absolute;
  left: 0;
  top: 20px;
  width: 40px;
  padding-right: 10px;
  text-align: right;
  color: #858585;
  font-size: 0.85rem;
  line-height: 1.9;
  border-right: 1px solid #3c3c3c;
  font-family: var(--font-primary);
}

/* 办公主题 - 场景标题 (模拟函数定义) */
[data-theme="office"] #scene-title {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: #dcdcaa;
  background-clip: unset;
  font-size: 1rem;
  font-weight: normal;
}

[data-theme="office"] #scene-title::before {
  content: 'function ';
  color: #569cd6;
}

[data-theme="office"] #scene-title::after {
  content: '() {';
  color: #d4d4d4;
}

/* 办公主题 - 故事文本 (模拟注释) */
[data-theme="office"] #story-text {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #6a9955;
}

[data-theme="office"] #story-text::before {
  content: '/* ';
  color: #6a9955;
}

[data-theme="office"] #story-text::after {
  content: ' */';
  color: #6a9955;
}

[data-theme="office"] #story-text p {
  margin-bottom: 8px;
}

[data-theme="office"] #story-text .highlight {
  color: #4ec9b0;
}

[data-theme="office"] #story-text .warning {
  color: #dcdcaa;
}

[data-theme="office"] #story-text .danger {
  color: #f14c4c;
}

/* 办公主题 - 选项按钮 (模拟代码行) */
[data-theme="office"] #choices-container {
  gap: 4px;
}

[data-theme="office"] .choice-btn {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 12px 6px 60px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  color: #9cdcfe;
  position: relative;
  text-align: left;
}

[data-theme="office"] .choice-btn::before {
  content: '>';
  position: absolute;
  left: 44px;
  color: #569cd6;
  font-weight: bold;
  transform: none;
  background: none;
  width: auto;
  top: 6px;
  bottom: auto;
}

[data-theme="office"] .choice-btn:hover {
  background: #264f78;
  transform: none;
  border: none;
}

[data-theme="office"] .choice-btn:hover::before {
  transform: none;
}

[data-theme="office"] .choice-btn.primary {
  background: #0e639c;
  color: #fff;
  text-align: left;
  padding-left: 60px;
}

[data-theme="office"] .choice-btn.primary:hover {
  background: #1177bb;
  transform: none;
  box-shadow: none;
}

[data-theme="office"] .choice-btn.danger {
  color: #f14c4c;
}

[data-theme="office"] .choice-btn.danger:hover {
  background: rgba(241, 76, 76, 0.2);
}

/* 办公主题 - 商店界面 (模拟设置面板) */
[data-theme="office"] #shop-container {
  background: #252526;
  border: 1px solid #3c3c3c;
  border-radius: 0;
}

[data-theme="office"] #shop-header {
  border-bottom-color: #3c3c3c;
}

[data-theme="office"] #shop-header h2 {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: normal;
}

[data-theme="office"] .category-btn {
  border-radius: 0;
  font-family: var(--font-primary);
  font-size: 0.85rem;
}

[data-theme="office"] .category-btn.active {
  background: #0e639c;
  color: #fff;
}

[data-theme="office"] .shop-item {
  background: #2d2d30;
  border-color: #3c3c3c;
  border-radius: 0;
}

[data-theme="office"] .shop-item:hover {
  border-color: #007acc;
  transform: none;
  box-shadow: none;
}

[data-theme="office"] .shop-item.selected {
  border-color: #007acc;
  background: rgba(14, 99, 156, 0.3);
}

/* 办公主题 - 模态框 */
/* 办公主题 - 模态框 */
[data-theme="office"] .modal {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="office"] .modal-content {
  background: #ffffff;
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  color: #333;
}

[data-theme="office"] .modal-content h2 {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: #333;
  font-family: var(--font-primary);
  font-weight: 600;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

[data-theme="office"] .modal-desc {
  color: #666;
}

[data-theme="office"] .form-group input {
  background: #ffffff;
  border: 1px solid #cecece;
  border-radius: 2px;
  font-family: var(--font-primary);
  color: #333;
}

[data-theme="office"] .form-group input:focus {
  border-color: #007acc;
  outline: 1px solid #007acc;
  box-shadow: none;
}

[data-theme="office"] .btn-primary {
  background: #007acc;
  color: #fff;
  border-radius: 2px;
  border: none;
}

[data-theme="office"] .btn-primary:hover {
  background: #0062a3;
  transform: none;
  box-shadow: none;
}

[data-theme="office"] .btn-primary:disabled {
  background: #cccccc;
  cursor: not-allowed;
}

[data-theme="office"] .btn-secondary {
  background: #e1e1e1;
  border: 1px solid #cecece;
  color: #333;
  border-radius: 2px;
}

[data-theme="office"] .btn-secondary:hover {
  background: #d4d4d4;
}

/* 办公主题 - 加载遮罩 */
[data-theme="office"] #loading-overlay {
  background: rgba(30, 30, 30, 0.95);
}

[data-theme="office"] .loading-spinner {
  border-color: #3c3c3c;
  border-top-color: #007acc;
}

/* 办公主题 - 页脚 */
[data-theme="office"] #game-footer {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  color: #6a6a6a;
}

/* 办公主题 - 结局页面 */
[data-theme="office"] .ending-title {
  font-family: var(--font-primary);
}

[data-theme="office"] .ending-title.success {
  color: #4ec9b0;
}

[data-theme="office"] .ending-title.failure {
  color: #f14c4c;
}

[data-theme="office"] .stat-card {
  background: #2d2d30;
  border-radius: 0;
}

/* 办公主题 - AI标记 */
[data-theme="office"] .ai-badge {
  background: rgba(14, 99, 156, 0.3);
  border-radius: 0;
  color: #569cd6;
}

/* 办公主题 - 主题切换按钮 */
[data-theme="office"] #theme-toggle {
  background: #252526;
  border: 1px solid #3c3c3c;
  border-radius: 0;
}/* VS Code Embedded Settings & Loading */
[data-theme='office'] .vscode-settings-form {
    padding: 20px;
    color: #333;
    font-family: 'Consolas', 'Courier New', monospace;
    overflow-y: auto;
    height: 100%;
}

[data-theme='office'] .vscode-setting-item {
    margin-bottom: 20px;
}

[data-theme='office'] .vscode-setting-label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

[data-theme='office'] .vscode-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cecece;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 13px;
}

[data-theme='office'] .vscode-input:focus {
    border-color: #007acc;
    outline: 1px solid #007acc;
}

[data-theme='office'] .vscode-setting-desc {
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

[data-theme='office'] .vscode-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    padding-bottom: 20px;
}

[data-theme='office'] .vscode-loading {
    padding: 20px;
    color: #666;
    font-family: 'Consolas', 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 10px;
}

[data-theme='office'] .vscode-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #007acc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading Animation */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-spin { display: inline-block; animation: spin 1s linear infinite; margin-right: 5px; }

/* VS Code Settings Tab */
#vscode-settings-tab {
  height: 100%;
  padding: 20px;
  background: #ffffff;
  overflow-y: auto;
  font-family: var(--font-primary);
  color: #333;
}

#vscode-settings-tab .modal-content {
  box-shadow: none;
  border: none;
  background: transparent;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
}

#vscode-settings-tab h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}


/* Force Hide Default Game Layout */
#default-layout {
  display: none !important;
}


.file-icon.log { color: #666666; }
.tab-icon.log { color: #666666; }
