/**
 * app.css - 全新架构样式
 * 简洁、现代、响应式设计
 */

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

/* ===== 皮肤系统 ===== */
:root {
    /* 基础色板（经典·原石） */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: rgba(255,255,255,0.03);
    --border-card: rgba(255,255,255,0.08);
    --text-primary: #fff;
    --text-secondary: #888;
    --accent-blue: #3498db;
    --accent-green: #2ecc71;
    --accent-gold: #FFD700;
    --shadow-card: none;
    --card-radius: 10px;
    --glow-emoji: none;
}

/* 深邃·星海 */
body.theme-ocean {
    --bg-primary: #0d0d1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255,255,255,0.04);
    --border-card: rgba(255,255,255,0.06);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
    --card-radius: 12px;
    --glow-emoji: 0 0 20px currentColor;
}

body.theme-ocean {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 60%, #0f3460 100%) !important;
    background-attachment: fixed !important;
}

/* 卡片通用阴影 + 微抬升 */
body.theme-ocean [class*="card"],
body.theme-ocean [class*="panel"],
body.theme-ocean [class*="section"] > div,
body.theme-ocean .admin-container > div,
body.theme-ocean .pet-card,
body.theme-ocean .tower-stage-card,
body.theme-ocean .shop-goods > div,
body.theme-ocean .message-item {
    box-shadow: var(--shadow-card) !important;
    border-radius: var(--card-radius) !important;
    border-color: var(--border-card) !important;
}

/* emoji 柔光 */
body.theme-ocean [style*="font-size:48px"],
body.theme-ocean [style*="font-size:40px"],
body.theme-ocean [style*="font-size:36px"],
body.theme-ocean .emoji-large {
    text-shadow: var(--glow-emoji);
}

/* 进度条渐变 */
body.theme-ocean progress::-webkit-progress-value,
body.theme-ocean [style*="background: linear-gradient"] {
    filter: brightness(1.1);
}

/* ===== 暗红·夜幕 ===== */
body.theme-crimson {
    --bg-primary: #0a0505;
    --bg-secondary: #1a0a0a;
    --bg-card: rgba(180,20,20,0.04);
    --border-card: rgba(180,40,40,0.12);
    --shadow-card: 0 2px 12px rgba(180,0,0,0.2);
    --card-radius: 12px;
    --glow-emoji: 0 0 20px rgba(255,50,50,0.4);
}

body.theme-crimson {
    background: linear-gradient(135deg, #0a0505 0%, #1a0a0a 50%, #2a0a0a 100%) !important;
    background-attachment: fixed !important;
}

body.theme-crimson [class*="card"],
body.theme-crimson [class*="panel"],
body.theme-crimson [class*="section"] > div,
body.theme-crimson .admin-container > div,
body.theme-crimson .pet-card,
body.theme-crimson .tower-stage-card,
body.theme-crimson .shop-goods > div,
body.theme-crimson .message-item {
    box-shadow: var(--shadow-card) !important;
    border-radius: var(--card-radius) !important;
    border-color: var(--border-card) !important;
}

body.theme-crimson [style*="font-size:48px"],
body.theme-crimson [style*="font-size:40px"],
body.theme-crimson [style*="font-size:36px"],
body.theme-crimson .emoji-large {
    text-shadow: var(--glow-emoji);
}

body.theme-crimson progress::-webkit-progress-value,
body.theme-crimson [style*="background: linear-gradient"] {
    filter: brightness(1.1) saturate(1.3);
}

/* ===== 翠绿·幽谷 ===== */
body.theme-verdant {
    --bg-primary: #0a1a0a;
    --bg-secondary: #0f2a0f;
    --bg-card: rgba(46,204,113,0.04);
    --border-card: rgba(46,204,113,0.1);
    --shadow-card: 0 2px 12px rgba(0,50,0,0.3);
    --card-radius: 12px;
    --glow-emoji: 0 0 20px rgba(46,204,113,0.3);
}

body.theme-verdant {
    background: linear-gradient(135deg, #0a1a0a 0%, #0f2a0f 50%, #1a3a1a 100%) !important;
    background-attachment: fixed !important;
}

body.theme-verdant [class*="card"],
body.theme-verdant [class*="panel"],
body.theme-verdant [class*="section"] > div,
body.theme-verdant .admin-container > div,
body.theme-verdant .pet-card,
body.theme-verdant .tower-stage-card,
body.theme-verdant .shop-goods > div,
body.theme-verdant .message-item {
    box-shadow: var(--shadow-card) !important;
    border-radius: var(--card-radius) !important;
    border-color: var(--border-card) !important;
}

body.theme-verdant [style*="font-size:48px"],
body.theme-verdant [style*="font-size:40px"],
body.theme-verdant [style*="font-size:36px"],
body.theme-verdant .emoji-large {
    text-shadow: var(--glow-emoji);
}

body.theme-verdant progress::-webkit-progress-value,
body.theme-verdant [style*="background: linear-gradient"] {
    filter: brightness(1.1) hue-rotate(-20deg);
}

/* ===== 炽蓝·仙野 ===== */
body.theme-celestial {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0a1a2e;
    --bg-card: rgba(52,152,219,0.04);
    --border-card: rgba(52,152,219,0.1);
    --shadow-card: 0 2px 12px rgba(0,50,100,0.3);
    --card-radius: 12px;
    --glow-emoji: 0 0 20px rgba(52,152,219,0.3);
}

body.theme-celestial {
    background: linear-gradient(135deg, #0a0a1a 0%, #0a1a2e 50%, #0a2a3e 100%) !important;
    background-attachment: fixed !important;
}

body.theme-celestial [class*="card"],
body.theme-celestial [class*="panel"],
body.theme-celestial [class*="section"] > div,
body.theme-celestial .admin-container > div,
body.theme-celestial .pet-card,
body.theme-celestial .tower-stage-card,
body.theme-celestial .shop-goods > div,
body.theme-celestial .message-item {
    box-shadow: var(--shadow-card) !important;
    border-radius: var(--card-radius) !important;
    border-color: var(--border-card) !important;
}

body.theme-celestial [style*="font-size:48px"],
body.theme-celestial [style*="font-size:40px"],
body.theme-celestial [style*="font-size:36px"],
body.theme-celestial .emoji-large {
    text-shadow: var(--glow-emoji);
}

body.theme-celestial progress::-webkit-progress-value,
body.theme-celestial [style*="background: linear-gradient"] {
    filter: brightness(1.15) saturate(1.2);
}

/* ===== 皮肤系统结束 ===== */body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

/* 容器 */
#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 视图 */
.view {
    min-height: calc(100vh - 40px);
}

/* 登录容器 */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2.5em;
    color: #ff6b35;
    margin-bottom: 10px;
}

.login-header .subtitle {
    color: #aaa;
    font-size: 1.1em;
}

/* 登录标签 */
.login-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #ff6b35;
    border-bottom-color: #ff6b35;
}

.tab-btn:hover:not(.active) {
    color: #fff;
}

/* 表单 */
.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6b35;
    background: rgba(255, 255, 255, 0.15);
}

/* 按钮 */
.btn-primary, .btn-secondary {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b35, #ff8c5a);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.btn-secondary:hover {
    background: rgba(52, 152, 219, 0.3);
}

/* 登录链接 */
.login-links {
    text-align: center;
    margin-top: 20px;
}

.login-links a {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

.login-links a:hover {
    text-decoration: underline;
}

/* 状态消息 */
.login-status {
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    display: none;
}

.login-status.info {
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: #3498db;
}

.login-status.success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.login-status.error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* 系统状态 */
.system-status {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.system-status p {
    margin: 5px 0;
    color: #aaa;
    font-size: 14px;
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 10px;
}

.spinner-large {
    width: 40px;
    height: 40px;
    border-width: 4px;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 游戏容器 */
.game-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.game-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 18px;
}

.user-info span {
    font-weight: 600;
}

#header-banner {
    margin-left: auto;
    height: 68px;
    width: 680px;
    max-width: 680px;
    overflow: hidden;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    background: rgba(0,0,0,0.3);
}

#header-banner:hover {
    border-color: rgba(255,255,255,0.2);
}

.btn-small {
    padding: 8px 15px;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-small:hover {
    background: rgba(231, 76, 60, 0.3);
}

/* 游戏导航 */
.game-nav {
    display: flex;
    gap: 10px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.nav-btn:hover {
    background: rgba(255, 107, 53, 0.2);
}

.nav-btn.active {
    background: rgba(255, 107, 53, 0.3);
    border-color: #ff6b35;
}

/* 游戏内容 */
.game-content {
    padding: 30px;
    min-height: 500px;
}

.content-view {
    display: none;
}

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

.content-view h2 {
    color: #ff6b35;
    margin-bottom: 20px;
    font-size: 2em;
}

.content-view p {
    margin-bottom: 15px;
    color: #aaa;
    line-height: 1.8;
}

.features {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.features p {
    margin: 10px 0;
    padding-left: 10px;
    border-left: 3px solid #2ecc71;
}

/* 管理面板样式 */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
}

.admin-header {
    text-align: center;
    margin-bottom: 30px;
}

.admin-header h2 {
    color: #ff6b35;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.admin-subtitle {
    color: #aaa;
    font-size: 1.2em;
}

/* 加载状态 */
.admin-loading {
    text-align: center;
    padding: 50px;
}

.admin-loading p {
    color: #aaa;
    margin-top: 20px;
}

/* 管理区域 */
.admin-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-section h3 {
    color: #3498db;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(52, 152, 219, 0.3);
    font-size: 1.5em;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.05));
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #3498db;
    margin: 10px 0;
}

.stat-label {
    color: #aaa;
    font-size: 14px;
}

/* 用户管理 */
.admin-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-tiny {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-tiny:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-tiny.btn-warning {
    background: rgba(241, 196, 15, 0.2);
    border-color: rgba(241, 196, 15, 0.3);
    color: #f1c40f;
}

.btn-tiny.btn-warning:hover {
    background: rgba(241, 196, 15, 0.3);
}

.users-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.users-table th {
    background: rgba(52, 152, 219, 0.2);

/* ===== 拼豆画板 ===== */
.bead-container { max-width: 900px; margin: 0 auto; padding: 10px; }
.bead-header { margin-bottom: 12px; }
.bead-mode-tabs { display: flex; gap: 6px; }
.bead-mode-btn {
  padding: 8px 18px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 8px;
  color: #aaa; font-size: 14px; cursor: pointer; transition: 0.2s;
}
.bead-mode-btn.active { background: rgba(52,152,219,0.15); border-color: #3498db; color: #3498db; }
.bead-mode-btn:hover { background: rgba(255,255,255,0.08); color: #ddd; }

.bead-body { min-height: 400px; }
.bead-canvas-area { margin-bottom: 12px; }
.bead-canvas-wrap {
  background: #1a1a2e; border-radius: 12px; padding: 10px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}
#bead-canvas { display: block; margin: 0 auto; border-radius: 4px; cursor: crosshair; }

.bead-toolbar { background: rgba(255,255,255,0.03); border-radius: 12px; padding: 10px; }
.bead-tool-section { margin-bottom: 8px; }
.bead-tool-section:last-child { margin-bottom: 0; }
.bead-tool-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bead-tool-btn {
  padding: 6px 12px; background: rgba(255,255,255,0.06);
  border: 1px solid transparent; border-radius: 6px;
  color: #ccc; font-size: 13px; cursor: pointer; transition: 0.2s;
}
.bead-tool-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.bead-btn-primary { background: rgba(52,152,219,0.2); border-color: #3498db; color: #3498db; }
.bead-btn-primary:hover { background: rgba(52,152,219,0.3); }
.bead-stats { font-size: 12px; color: #888; margin-left: auto; }

.bead-color-palette {
  display: flex; flex-wrap: wrap; gap: 3px;
  max-height: 120px; overflow-y: auto;
  padding: 4px; background: rgba(0,0,0,0.2); border-radius: 8px;
}
.bead-color-palette::-webkit-scrollbar { width: 4px; }
.bead-color-palette::-webkit-scrollbar-track { background: transparent; }
.bead-color-palette::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.bead-color {
  width: 20px; height: 20px; border-radius: 4px; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.15s, transform 0.15s; flex-shrink: 0;
}
.bead-color:hover { border-color: rgba(255,255,255,0.4); transform: scale(1.15); }
.bead-color-active { border-color: #fff !important; }

/* 我的作品 / 画廊 */
.bead-grid-list { display: grid; gap: 10px; }
.bead-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  transition: background 0.2s;
}
.bead-card:hover { background: rgba(255,255,255,0.06); }
.bead-card h4 { margin: 0 0 4px; font-size: 15px; color: #e0e0ff; }
.bead-card p { margin: 0; font-size: 13px; color: #888; }
.bead-card-meta { font-size: 12px !important; color: #666 !important; margin-top: 2px !important; }
.bead-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.bead-card-btn {
  padding: 5px 12px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 6px;
  color: #ccc; font-size: 12px; cursor: pointer; transition: 0.2s;
}
.bead-card-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.bead-card-btn-danger:hover { background: rgba(231,76,60,0.2); border-color: #e74c3c; color: #e74c3c; }
.bead-empty { text-align: center; padding: 40px 20px; color: #888; font-size: 14px; }

@media (max-width: 600px) {
  .bead-tool-row { gap: 4px; }
  .bead-tool-btn { padding: 5px 8px; font-size: 12px; }
  .bead-card { flex-direction: column; align-items: flex-start; gap: 8px; }
}
