/* 猫游记 - 主样式 */

:root {
  /* 配色方案 - 古风暖色调 */
  --color-bg: #1a1612;
  --color-bg-light: #2a2420;
  --color-bg-panel: #322a24;
  --color-border: #4a3f35;
  --color-border-light: #5a4f45;
  
  --color-text: #e8dcc8;
  --color-text-dim: #a89888;
  --color-text-bright: #fff8e8;
  
  --color-primary: #d4a574;
  --color-primary-dark: #b48554;
  --color-secondary: #7a9e7e;
  --color-accent: #c9a86c;
  
  --color-hp: #c75050;
  --color-hp-bg: #4a2525;
  --color-sp: #5080c7;
  --color-sp-bg: #25354a;
  
  --color-fire: #ff6b35;
  --color-ice: #35b8ff;
  --color-wind: #35ff8b;
  --color-dark: #8b35ff;
  --color-holy: #ffeb35;
  
  /* 字体 */
  --font-title: 'Ma Shan Zheng', cursive;
  --font-body: 'ZCOOL XiaoWei', serif;
  --font-ui: system-ui, -apple-system, sans-serif;
  
  /* 尺寸 */
  --header-height: 60px;
  --footer-height: 50px;
}

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

body {
  font-family: var(--font-ui);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow: hidden;
}

/* 屏幕容器 */
#app {
  width: 100vw;
  height: 100vh;
  position: relative;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.screen.active {
  display: flex;
}

/* ===== 登录界面 ===== */
#login-screen {
  background: linear-gradient(135deg, var(--color-bg) 0%, #2d2318 50%, var(--color-bg) 100%);
  justify-content: center;
  align-items: center;
}

.login-container {
  text-align: center;
  padding: 40px;
  background: var(--color-bg-panel);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  min-width: 360px;
}

.game-title {
  font-family: var(--font-title);
  font-size: 4rem;
  color: var(--color-accent);
  text-shadow: 0 4px 20px rgba(201, 168, 108, 0.3);
  margin-bottom: 0;
  letter-spacing: 0.2em;
}

.game-subtitle {
  font-family: var(--font-body);
  color: var(--color-text-dim);
  font-size: 1rem;
  margin-bottom: 40px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--color-text-dim);
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group input::placeholder {
  color: var(--color-text-dim);
  opacity: 0.5;
}

.button-group {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.btn {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-bg);
  font-weight: bold;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-primary:disabled {
  background: var(--color-border);
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.login-tips {
  margin-top: 30px;
  color: var(--color-text-dim);
  font-size: 0.85rem;
}

/* ===== 角色创建界面 ===== */
#create-character-screen {
  background: linear-gradient(135deg, var(--color-bg) 0%, #2d2318 50%, var(--color-bg) 100%);
  justify-content: center;
  align-items: center;
}

.create-container {
  padding: 40px;
  background: var(--color-bg-panel);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  min-width: 500px;
}

.create-container h2 {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--color-accent);
  text-align: center;
  margin-bottom: 30px;
}

.class-selection h3 {
  color: var(--color-text-dim);
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.class-options {
  display: flex;
  gap: 20px;
}

.class-option {
  flex: 1;
  padding: 20px;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.class-option:hover {
  border-color: var(--color-border-light);
}

.class-option.selected {
  border-color: var(--color-primary);
  background: var(--color-bg-light);
}

.class-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.class-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--color-text-bright);
  margin-bottom: 8px;
}

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

.class-skills {
  color: var(--color-secondary);
  font-size: 0.8rem;
}

/* ===== 游戏主界面 ===== */
.game-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 顶部状态栏 */
.game-header {
  height: var(--header-height);
  background: var(--color-bg-panel);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 30px;
}

.char-info {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.char-name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--color-accent);
}

.char-class {
  color: var(--color-text-dim);
  font-size: 0.85rem;
}

.char-level {
  color: var(--color-primary);
  font-weight: bold;
}

.char-stats {
  display: flex;
  gap: 20px;
  flex: 1;
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  width: 24px;
}

.stat-bar {
  width: 120px;
  height: 12px;
  background: var(--color-hp-bg);
  border-radius: 6px;
  overflow: hidden;
}

.stat.sp .stat-bar {
  background: var(--color-sp-bg);
}

.stat-fill {
  height: 100%;
  background: var(--color-hp);
  transition: width 0.3s;
}

.stat.sp .stat-fill {
  background: var(--color-sp);
}

.stat-value {
  font-size: 0.8rem;
  color: var(--color-text);
  min-width: 70px;
}

.char-currency {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
}

/* 主内容区 */
.game-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 地图区域 */
.map-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px;
  background: var(--color-bg-light);
}

.map-header {
  margin-bottom: 10px;
}

.location-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--color-accent);
}

.map-container {
  flex: 1;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.map-placeholder {
  color: var(--color-text-dim);
  text-align: center;
}

.map-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 15px;
}

.move-row {
  display: flex;
  gap: 5px;
}

.btn-move, .btn-action {
  width: 50px;
  height: 40px;
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-move:hover, .btn-action:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
}

.btn-action {
  width: 60px;
  font-size: 0.8rem;
}

/* 信息面板 */
.info-panel {
  width: 350px;
  background: var(--color-bg-panel);
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
}

.tab {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--color-text-dim);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.tab:hover {
  color: var(--color-text);
}

.tab.active {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.tab-content {
  display: none;
}

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

/* 剧情日志 */
.story-log {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.story-entry {
  padding: 10px;
  background: var(--color-bg);
  border-radius: 6px;
  margin-bottom: 10px;
  font-family: var(--font-body);
  line-height: 1.6;
}

.story-entry p {
  margin-bottom: 8px;
}

.story-entry p:last-child {
  margin-bottom: 0;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-buttons .btn {
  text-align: left;
  padding: 10px 15px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.action-buttons .btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* 状态面板 */
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.status-item {
  padding: 10px;
  background: var(--color-bg);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
}

.status-item .label {
  color: var(--color-text-dim);
}

.status-item .value {
  color: var(--color-text-bright);
  font-weight: bold;
}

.resist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.resist-item {
  padding: 8px;
  background: var(--color-bg);
  border-radius: 4px;
  font-size: 0.85rem;
}

/* 技能列表 */
.skills-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-item {
  padding: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.skill-name {
  color: var(--color-primary);
  font-weight: bold;
  margin-bottom: 4px;
}

.skill-desc {
  color: var(--color-text-dim);
  font-size: 0.85rem;
}

.empty-hint {
  color: var(--color-text-dim);
  text-align: center;
  padding: 20px;
}

/* 底部菜单 */
.game-footer {
  height: var(--footer-height);
  background: var(--color-bg-panel);
  border-top: 1px solid var(--color-border);
}

.main-menu {
  display: flex;
  height: 100%;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.menu-btn {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.menu-btn:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ===== 模态框 ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--color-bg-panel);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 30px;
  min-width: 500px;
}

/* 战斗界面 */
.battle-header {
  text-align: center;
  margin-bottom: 20px;
}

.battle-header h2 {
  font-family: var(--font-title);
  color: var(--color-accent);
  font-size: 2rem;
}

.battle-arena {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.battle-side {
  flex: 1;
}

.battle-vs {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--color-hp);
  padding: 0 20px;
}

.combatant {
  padding: 15px;
  background: var(--color-bg);
  border-radius: 8px;
  text-align: center;
}

.combatant-name {
  margin-bottom: 10px;
  font-weight: bold;
}

.combatant-hp-bar {
  height: 16px;
  background: var(--color-hp-bg);
  border-radius: 8px;
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  background: var(--color-hp);
  transition: width 0.3s;
}

.battle-log {
  height: 120px;
  overflow-y: auto;
  background: var(--color-bg);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.battle-log p {
  margin-bottom: 5px;
}

.battle-actions {
  display: flex;
  gap: 10px;
}

.battle-actions .btn {
  flex: 1;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.battle-actions .btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Toast提示 */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
}

.toast {
  padding: 12px 20px;
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin-bottom: 10px;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-color: var(--color-secondary);
}

.toast.error {
  border-color: var(--color-hp);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-light);
}
