/* =========================================
   AI YIZHAN - MASTER UI SYSTEM (REMASTERED)
   ========================================= */

:root {
  /* --- Theme: Nebula (Default/Cyber) - 暗夜极光 --- */
  --bg-body: #0f111a;
  --bg-glass: rgba(15, 17, 26, 0.7);
  --bg-card: #1a1d29;
  --bg-input: #13151f;
  --bg-hover: #24283b;
  
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-highlight: #e2e8f0;

  --primary: #6366f1;       /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.4);
  --accent: #8b5cf6;        /* Violet */
  --accent-glow: rgba(139, 92, 246, 0.4);
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-theme="light"] {
  /* --- Theme: Daylight (Clean/Pro) - 清晨白日 --- */
  --bg-body: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --bg-hover: #e2e8f0;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-highlight: #334155;

  --primary: #2563eb;       /* Royal Blue */
  --primary-glow: rgba(37, 99, 235, 0.2);
  --accent: #0ea5e9;        /* Sky */
  --accent-glow: rgba(14, 165, 233, 0.2);
  
  --border: #e2e8f0;
  --border-focus: #2563eb;
  
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

[data-theme="blue"] {
  /* --- Theme: Deep Sea (Tech/Blue) - 深海科技 --- */
  --bg-body: #020617;
  --bg-glass: rgba(2, 6, 23, 0.8);
  --bg-card: #0f172a;
  --bg-input: #1e293b;
  --bg-hover: #334155;

  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-highlight: #f8fafc;

  --primary: #0ea5e9;       /* Sky Blue */
  --primary-glow: rgba(14, 165, 233, 0.4);
  --accent: #38bdf8;        /* Light Sky */
  --accent-glow: rgba(56, 189, 248, 0.4);
  
  --border: #1e293b;
  --border-focus: #0ea5e9;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

[data-theme="green"] {
  /* --- Theme: Forest (Nature/Green) - 自然森系 --- */
  --bg-body: #1a2e1a;
  --bg-glass: rgba(26, 46, 26, 0.8);
  --bg-card: #243c24;
  --bg-input: #2f4f2f;
  --bg-hover: #3a5f3a;

  --text-main: #f0fff0;
  --text-muted: #a8cda8;
  --text-highlight: #ffffff;

  --primary: #4ade80;       /* Green */
  --primary-glow: rgba(74, 222, 128, 0.4);
  --accent: #22c55e;        /* Darker Green */
  --accent-glow: rgba(34, 197, 94, 0.4);
  
  --border: #2f4f2f;
  --border-focus: #4ade80;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

[data-theme="cyber"] {
  /* --- Theme: Cyberpunk (Neon/Pink) - 赛博朋克 --- */
  --bg-body: #050505;
  --bg-glass: rgba(5, 5, 5, 0.9);
  --bg-card: #111;
  --bg-input: #222;
  --bg-hover: #333;

  --text-main: #eee;
  --text-muted: #888;
  --text-highlight: #fff;

  --primary: #ff00ff;       /* Magenta */
  --primary-glow: rgba(255, 0, 255, 0.5);
  --accent: #00ffff;        /* Cyan */
  --accent-glow: rgba(0, 255, 255, 0.5);
  
  --border: #333;
  --border-focus: #ff00ff;
  
  --shadow-card: 0 0 20px rgba(255, 0, 255, 0.15);
}

/* --- Global Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out);
  overflow-x: hidden;
}

body:not([data-role="admin"]) .admin-only {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a { text-decoration: none; color: inherit; transition: 0.2s; cursor: pointer; }
button, input, select, textarea { font-family: inherit; outline: none; }

/* --- Header (Glassmorphism) --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
  box-shadow: 0 1px 0 0 rgba(0,0,0,0.05);
}

.brand {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L2 7l10 5 10-5-10-5zm0 9l2.5-1.25L12 8.5l-2.5 1.25L12 11zm0 2.5l-5-2.5-5 2.5L12 22l10-8.5-5-2.5-5 2.5z"/></svg>') no-repeat center/contain;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L2 7l10 5 10-5-10-5zm0 9l2.5-1.25L12 8.5l-2.5 1.25L12 11zm0 2.5l-5-2.5-5 2.5L12 22l10-8.5-5-2.5-5 2.5z"/></svg>') no-repeat center/contain;
}

/* Header Actions Area */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 在线客服按钮 */
.customer-service-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.customer-service-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.customer-service-btn svg {
  width: 18px;
  height: 18px;
}
.customer-service-btn span {
  font-weight: 500;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.theme-selector-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.theme-selector {
  appearance: none;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 32px 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.theme-selector:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-muted);
}
.theme-selector:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* --- Layout & Sections --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  min-height: calc(100vh - 64px);
}

.section {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.section.active { display: block; }

@keyframes fadeIn { 
  from { opacity: 0; transform: translateY(20px); filter: blur(4px); } 
  to { opacity: 1; transform: translateY(0); filter: blur(0); } 
}

h2 {
  font-size: 32px;
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 16px;
  max-width: 600px;
  line-height: 1.5;
}

.feature-workbench {
  padding-top: 24px;
}
.feature-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.feature-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.feature-group + .feature-group {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.feature-group-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.feature-nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.02);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  text-align: left;
}
.feature-nav-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  transition: all 0.2s var(--ease-out);
  flex-shrink: 0;
}
.feature-nav-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.feature-nav-item:hover {
  border-color: rgba(255,255,255,0.1);
  background: var(--bg-hover);
  transform: translateX(4px);
}
.feature-nav-item:hover .feature-nav-icon {
  background: rgba(255,255,255,0.15);
  color: var(--text-main);
}
.feature-nav-item:hover .feature-nav-title {
  color: var(--text-main);
}
.feature-nav-item.active {
  border-color: var(--primary);
  background: linear-gradient(90deg, rgba(0, 152, 246, 0.15), rgba(0, 152, 246, 0.05));
  box-shadow: 0 4px 12px rgba(0, 152, 246, 0.15);
}
.feature-nav-item.active .feature-nav-icon {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 152, 246, 0.4);
}
.feature-nav-item.active .feature-nav-title {
  color: var(--primary);
  font-weight: 700;
}
.feature-nav-item.active .feature-nav-desc {
  color: var(--text-main);
  opacity: 0.8;
}
.feature-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}
.feature-nav-desc {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}
.feature-main {
  flex: 1;
  min-width: 0;
}
.feature-pane {
  display: none;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  animation: fadeIn 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.feature-pane::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.5;
}
.feature-pane.active {
  display: block;
}
.feature-pane + .feature-pane {
  margin-top: 24px;
}

@media (max-width: 960px) {
  .feature-layout {
    flex-direction: column;
  }
  .feature-sidebar {
    position: static;
    width: 100%;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px;
  }
  .feature-group {
    flex: 1;
    min-width: 220px;
  }
  .feature-group + .feature-group {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
}

/* --- Hero (Home) --- */
.home-world { text-align: center; padding-top: 60px; }
.world-hero { margin-bottom: 80px; position: relative; }
.world-hero::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  background: var(--primary);
  filter: blur(120px);
  opacity: 0.2;
  transform: translate(-50%, -50%);
  z-index: -1;
  border-radius: 50%;
}

.world-title {
  font-size: 56px;
  font-weight: 900;
  margin: 0 0 20px;
  line-height: 1.1;
  background: linear-gradient(to right bottom, var(--text-main) 30%, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}
.world-subtitle {
  font-size: 20px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  font-weight: 400;
}

/* --- World Grid (Cards) --- */
.world-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.world-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.world-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s;
}

.world-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-focus);
  box-shadow: 0 20px 40px -10px var(--primary-glow);
}
.world-card:hover::before { opacity: 1; }

.world-card-visual {
  height: 160px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.world-card-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.2));
}

/* SVG Styles inside cards - ANIMATED */
.world-card-visual svg { width: 100%; height: 100%; transition: transform 0.5s ease; }
.world-card:hover .world-card-visual svg { transform: scale(1.05); }
.world-card-visual .bg { fill: transparent; }
.world-card-visual .img, .world-card-visual .vid, .world-card-visual .line { fill: var(--border); transition: fill 0.3s; }
.world-card-visual .sun, .world-card-visual .play { fill: var(--accent); }
.world-card-visual .arrow { stroke: var(--text-muted); fill: none; stroke-width: 2; stroke-dasharray: 4; animation: dash 20s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -100; } }

/* 图生视频动画 - 扫描线效果 */
.fx-img2video .scan {
  animation: scanMove 3s ease-in-out infinite;
  transform-origin: center;
}
@keyframes scanMove {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(64px); opacity: 1; }
}
.fx-img2video .img { animation: imgPulse 4s ease-in-out infinite; }
@keyframes imgPulse {
  0%, 100% { fill: var(--border); }
  50% { fill: var(--primary); }
}
.fx-img2video .vid { animation: vidFadeIn 4s ease-in-out infinite; }
@keyframes vidFadeIn {
  0%, 40% { opacity: 0.3; }
  60%, 100% { opacity: 1; }
}
.fx-img2video .play { animation: playRotate 4s ease-in-out infinite; }
@keyframes playRotate {
  0%, 50% { transform: scale(0.8); opacity: 0; }
  70%, 100% { transform: scale(1); opacity: 1; }
}

/* 文生视频动画 - 打字机效果 */
.fx-t2v .line { animation: lineTyping 5s ease-in-out infinite; transform-origin: left; }
.fx-t2v .l1 { animation-delay: 0s; }
.fx-t2v .l2 { animation-delay: 0.3s; }
.fx-t2v .l3 { animation-delay: 0.6s; }
@keyframes lineTyping {
  0%, 20% { transform: scaleX(0); opacity: 0; }
  30%, 70% { transform: scaleX(1); opacity: 1; }
  80%, 100% { transform: scaleX(1); opacity: 0.3; }
}
.fx-t2v .caret { animation: caretBlink 1.2s step-end infinite; }
@keyframes caretBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.fx-t2v .vid { animation: vidSlideIn 5s ease-in-out infinite; }
@keyframes vidSlideIn {
  0%, 40% { transform: translateX(30px); opacity: 0; }
  50%, 100% { transform: translateX(0); opacity: 1; }
}

/* 文生图动画 - 绘制效果 */
.fx-t2i .line { animation: lineDrawIn 4s ease-in-out infinite; transform-origin: left; }
.fx-t2i .l1 { animation-delay: 0s; }
.fx-t2i .l2 { animation-delay: 0.2s; }
@keyframes lineDrawIn {
  0%, 30% { transform: scaleX(0); }
  40%, 100% { transform: scaleX(1); }
}
.fx-t2i .img { animation: imgReveal 4s ease-in-out infinite; }
@keyframes imgReveal {
  0%, 50% { opacity: 0; transform: scale(0.8); }
  60%, 100% { opacity: 1; transform: scale(1); }
}
.fx-t2i .mount { animation: mountDraw 4s ease-in-out infinite; }
@keyframes mountDraw {
  0%, 55% { opacity: 0; transform: translateY(10px); }
  65%, 100% { opacity: 1; transform: translateY(0); }
}
.fx-t2i .sun { animation: sunGlow 3s ease-in-out infinite; }
@keyframes sunGlow {
  0%, 100% { fill: var(--accent); filter: drop-shadow(0 0 0 var(--accent)); }
  50% { fill: var(--warning); filter: drop-shadow(0 0 8px var(--warning)); }
}

.world-card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}
.world-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Forms & Inputs --- */
.form {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  max-width: 800px;
  margin-bottom: 40px;
}

label {
  display: block;
  margin-bottom: 24px;
  color: var(--text-highlight);
  font-size: 14px;
  font-weight: 600;
}

input[type="text"], input[type="number"], input[type="password"], input[type="email"], input[type="url"], select, textarea, input[type="file"] {
  width: 100%;
  display: block;
  margin-top: 8px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 15px;
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

input:hover, select:hover, textarea:hover {
  border-color: var(--text-muted);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-body);
}

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

/* Checkbox & Radio Customization */
input[type="checkbox"], input[type="radio"] {
  width: auto;
  display: inline-block;
  margin-right: 8px;
  transform: scale(1.2);
  accent-color: var(--primary);
}

/* --- Buttons --- */
button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Primary Button */
button[type="submit"], .primary-btn, .btn-connect {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
  border: 1px solid transparent;
}
button[type="submit"]:hover, .primary-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--primary-glow);
}
button[type="submit"]:active { transform: translateY(0); }

/* Secondary Button */
button.secondary, button[type="button"] {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border);
}
button.secondary:hover, button[type="button"]:not(.primary):not(.auth-btn):not(.theme-btn):hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
  color: var(--text-highlight);
}

/* Auth Buttons (Header) */
.auth-btn {
  padding: 8px 16px;
  font-size: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-sm);
}
.auth-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

/* Theme Switch Button (Login Area) */
.theme-btn {
  padding: 8px 12px;
  font-size: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
}
.theme-btn:hover { color: var(--text-main); }

/* --- Admin Panel --- */
.admin-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  overflow-x: auto;
  padding: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.admin-toolbar button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  flex-shrink: 0;
  font-size: 14px;
}
.admin-toolbar button:hover {
  color: var(--text-main);
  background: rgba(255,255,255,0.05);
}
.admin-toolbar button.active {
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-weight: 600;
}

.admin-panel { display: none; }
.admin-panel.active { display: block; animation: fadeIn 0.3s; }

.admin-wallet-layout, .admin-payment-layout, .admin-users-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 1024px) {
  .admin-wallet-layout { grid-template-columns: 1fr 2fr; }
}

.admin-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.admin-table-actions {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-table-scroll {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}
.admin-table th {
  background: var(--bg-hover);
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-hover); }

/* --- Works Board --- */
.works-hero {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-body));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  gap: 40px;
  align-items: center;
  margin-bottom: 40px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.works-hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, var(--bg-hover));
  opacity: 0.1;
  transform: skewX(-20deg);
}

.works-hero-visual { flex-shrink: 0; }
.works-hero-visual svg .fx { fill: var(--bg-input); stroke: var(--border); stroke-width: 2; }
.works-hero-text { z-index: 1; }
.works-hero h2 { font-size: 36px; margin-bottom: 16px; }
.works-badge { 
  display: inline-block; 
  background: var(--primary-glow); 
  color: var(--primary); 
  padding: 4px 12px; 
  border-radius: 20px; 
  font-size: 12px; 
  font-weight: 700; 
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.works-hero-actions { display: flex; gap: 12px; margin-top: 24px; }

.works-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.works-filter-group {
  display: flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.works-filter-chip {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: none;
}
.works-filter-chip:hover { color: var(--text-main); }
.works-filter-chip.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-weight: 600;
}

.works-search-bar {
  display: flex;
  gap: 8px;
  background: var(--bg-input);
  padding: 4px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  align-items: center;
}
.works-search-bar input {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px;
  width: 240px;
  margin: 0;
}
.works-search-bar input:focus { background: transparent; box-shadow: none; }

.works-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: start;
}
.works-column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.works-column--hidden { display: none; }

.works-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.works-chip {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.works-chip--text { background: rgba(255, 99, 132, 0.15); color: #ff6384; }
.works-chip--image { background: rgba(54, 162, 235, 0.15); color: #36a2eb; }
.works-chip--video { background: rgba(75, 192, 192, 0.15); color: #4bc0c0; }
.works-chip--music { background: rgba(153, 102, 255, 0.15); color: #9966ff; }

.work-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.work-card:hover { 
  border-color: var(--primary); 
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.work-card-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.work-card-preview {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}
.work-card-preview img { width: 100%; height: auto; display: block; }
.work-card-title { font-size: 14px; font-weight: 600; color: var(--text-main); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.work-card-detail { width: 100%; margin-top: 8px; font-size: 12px; padding: 6px; }

/* --- Modals (REDESIGNED) --- */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.4s ease;
  padding: 20px;
}
.modal.hidden { display: none; opacity: 0; pointer-events: none; }

.modal-content {
  background: linear-gradient(145deg, rgba(26, 29, 41, 0.98), rgba(15, 17, 26, 0.95));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 28px;
  padding: 48px 42px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 0 60px rgba(99, 102, 241, 0.12);
  animation: modalSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content--work { max-width: 900px; border-radius: var(--radius-lg); }

.modal-content::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
  background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.12) 0%, transparent 60%);
  animation: modalGlow 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.modal-content > * { position: relative; z-index: 1; }

@keyframes modalSlideIn { 
  from { transform: translateY(-50px) scale(0.88); opacity: 0; filter: blur(10px); } 
  to { transform: translateY(0) scale(1); opacity: 1; filter: blur(0); } 
}
@keyframes modalGlow {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  50% { transform: translate(15%, 15%) scale(1.15); opacity: 1; }
}

.modal-content h3 {
  margin: 0 0 36px;
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
  text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.modal-content--wallet {
  max-width: 720px;
  padding: 48px;
}
.wallet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.wallet-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.wallet-header h3 {
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  text-shadow: none;
}
.wallet-rate {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 13px;
  color: var(--text-highlight);
}
.wallet-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.wallet-panel {
  flex: 1;
  min-width: 260px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.wallet-balance-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.25));
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.wallet-balance-card span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}
.wallet-balance-card strong {
  font-size: 22px;
  color: #fff;
  letter-spacing: 0.5px;
}
.wallet-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.wallet-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.wallet-quick button {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-weight: 600;
  transition: all 0.2s ease;
}
.wallet-quick button.active,
.wallet-quick button:hover {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
  color: var(--primary);
}
.wallet-form label {
  display: block;
  font-size: 14px;
  color: var(--text-highlight);
}
.wallet-form input {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 16px;
}
.wallet-actions {
  display: flex;
  gap: 12px;
  margin: 18px 0 8px;
}
.wallet-actions button {
  flex: 1;
  height: 48px;
  border-radius: 12px;
}
.wallet-qr {
  margin-top: 28px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  padding: 24px 16px;
}
.wallet-qr-title {
  margin: 0 0 10px;
  font-weight: 600;
  color: #ffb347;
}
.wallet-qr-code {
  display: inline-flex;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  margin: 10px 0;
}
.wallet-qr-amount {
  margin: 10px 0 4px;
  font-size: 18px;
  color: #ffb347;
}
.wallet-qr-status {
  margin: 0;
  color: var(--text-muted);
}
.wallet-qr-close {
  margin-top: 14px;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-highlight);
  cursor: pointer;
}
.wallet-qr-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 640px) {
  .wallet-layout { flex-direction: column; }
}


.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: 0.2s;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-main); }

/* Work Detail Styles */
.work-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.work-detail-preview { margin-bottom: 24px; background: var(--bg-body); border-radius: var(--radius-md); overflow: hidden; text-align: center; }
.work-detail-preview img, .work-detail-preview video { max-width: 100%; max-height: 500px; }
.work-detail-info { display: grid; grid-template-columns: auto 1fr; gap: 12px 24px; margin-bottom: 24px; font-size: 14px; }
.work-detail-info dt { color: var(--text-muted); font-weight: 500; }
.work-detail-info dd { color: var(--text-main); margin: 0; font-family: monospace; }
.work-detail-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.work-detail-raw { background: var(--bg-input); padding: 16px; border-radius: var(--radius-md); font-size: 12px; color: var(--text-muted); overflow-x: auto; margin-top: 24px; }

/* --- Auth View Styles (Login Modal) --- */
.auth-view { position: relative; z-index: 1; }
.auth-buttons-vertical button {
  font-size: 16px;
  font-weight: 600;
  height: 54px;
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.auth-buttons-vertical button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}
.auth-buttons-vertical button:hover::after {
  width: 400px;
  height: 400px;
}
.auth-form { animation: formSlideIn 0.4s ease; }
.auth-form.hidden { display: none; }
.auth-form label {
  display: block;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-highlight);
}
.auth-form input {
  width: 100%;
  padding: 14px 18px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 15px;
  transition: all 0.3s ease;
}
.auth-form input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.modal-actions button {
  height: 48px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
}
@keyframes formSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Utilities --- */
.status { font-size: 14px; margin-left: 12px; color: var(--text-muted); animation: fadeIn 0.2s; }
.warning { color: var(--warning); font-size: 13px; margin-top: 12px; display: flex; align-items: center; gap: 6px; }
.video-warning { 
  background: rgba(245, 158, 11, 0.1); 
  color: var(--warning); 
  padding: 16px; 
  border-radius: var(--radius-md); 
  margin-bottom: 24px; 
  border: 1px solid rgba(245, 158, 11, 0.2); 
  display: flex;
  align-items: center;
  gap: 12px;
}
.video-warning::before { content: '⚠️'; font-size: 20px; }

/* Progress Bar */
.progress {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  margin-top: 20px;
  overflow: hidden;
  display: none;
}
.progress[aria-hidden="false"] { display: block; }
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  transition: width 0.3s linear;
  position: relative;
}
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Result Areas */
.result { margin-top: 32px; display: grid; gap: 20px; }
.result img, .result video, .result audio { max-width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: var(--shadow-card); }

.storyboard-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.storyboard-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 15px 30px -15px rgba(0, 0, 0, 0.6);
}
.storyboard-card h4 {
  margin: 0;
  font-size: 16px;
  color: var(--text-highlight);
}
.storyboard-prompt {
  margin: 0;
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.6;
}
.storyboard-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.storyboard-summary {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.storyboard-summary h4 {
  margin: 0;
  font-size: 15px;
  color: var(--text-highlight);
}
.storyboard-summary textarea {
  width: 100%;
  min-height: 140px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  padding: 12px;
  resize: vertical;
}
.storyboard-summary button {
  align-self: flex-start;
  padding: 8px 16px;
}

/* Admin Specific */
.admin-form { background: var(--bg-input); padding: 24px; border-radius: var(--radius-md); margin-top: 24px; border: 1px solid var(--border); }
.admin-db-status-list { list-style: none; padding: 0; margin: 16px 0; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.admin-db-status-list li { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-highlight); display: flex; justify-content: space-between; }
.admin-db-status-list li:last-child { border-bottom: none; }

.admin-inline-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  padding: 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.admin-inline-checkbox input { margin: 0; transform: scale(1.2); }

/* Site Footer */
.site-footer {
  margin-top: 60px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-glass);
}
.site-footer #site-footer-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.site-footer #site-footer-info {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .container { padding: 16px; }
  .customer-service-btn span {
    display: none;
  }
  .customer-service-btn {
    padding: 8px;
  }
  .world-title { font-size: 36px; }
  .grid { grid-template-columns: 1fr; }
  .admin-toolbar { padding-bottom: 12px; }
  .works-hero { flex-direction: column; text-align: center; padding: 24px; }
  .works-hero-visual { display: none; }
  .works-toolbar { flex-direction: column; align-items: stretch; }
  .works-search-bar input { width: 100%; }
  .header-actions .auth-info { display: none; } /* Hide auth text on mobile, keep button */
  .site-header { padding: 0 16px; }
  .theme-selector { padding: 6px 24px 6px 8px; font-size: 12px; }
}
