:root {
  --bg: #0f172a;
  --panel: #111827;
  --muted: #9ca3af;
  --text: #e5e7eb;
  --primary: #22c55e;
  --primary-700: #15803d;
  --border: #1f2937;
}

* { 
  box-sizing: border-box; 
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans,
    Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(180deg, #0b1020, #0f172a);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.card {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
}

header {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 18px 20px; 
  margin-bottom: 16px;
}

.title { 
  font-size: 18px; 
  font-weight: 700; 
  letter-spacing: .4px; 
}

.muted { 
  color: var(--muted); 
  font-size: 13px; 
}

.list { 
  padding: 10px; 
}

.list-item { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 14px 16px; 
  border-top: 1px solid var(--border); 
}

.list-item:first-child { 
  border-top: 0; 
}

.btn {
  background: var(--primary);
  color: #051b0d;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(34,197,94,0.25), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform .06s ease, filter .2s ease;
}

.btn:hover { 
  filter: brightness(1.05); 
}

.btn:active { 
  transform: translateY(1px); 
}

.btn.secondary { 
  background: #374151; 
  color: #e5e7eb; 
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12); 
}

.form { 
  padding: 18px; 
  border-top: 1px solid var(--border); 
}

.field { 
  margin-bottom: 14px; 
}

.label { 
  display: block; 
  font-size: 13px; 
  color: var(--muted); 
  margin-bottom: 8px; 
}

.input, .textarea {
  width: 100%;
  background: #0b1220;
  color: var(--text);
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.input:focus, .textarea:focus { 
  border-color: #334155; 
  box-shadow: 0 0 0 3px rgba(51,65,85,0.35); 
}

.textarea { 
  min-height: 90px; 
  resize: vertical; 
}

.row { 
  display: flex; 
  gap: 10px; 
  align-items: center; 
}

.row .input { 
  flex: 1; 
}

.row .btn { 
  flex: 1; 
}

.preview { 
  padding: 16px; 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
  gap: 12px; 
}

.imgbox { 
  background: #0b1220; 
  border: 1px solid #1f2937; 
  border-radius: 12px; 
  overflow: hidden; 
}

.imgbox img { 
  width: 100%; 
  display: block; 
}

.status { 
  padding: 10px 16px; 
  border-top: 1px solid var(--border); 
  color: var(--muted); 
  font-size: 13px; 
}

.danger { 
  color: #fca5a5; 
}

/* Login Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

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

.modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.modal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

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

.code-btn {
  background: var(--primary);
  color: #051b0d;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.2s;
}

.code-btn:hover { 
  filter: brightness(1.05); 
}

.code-btn:disabled {
  background: #374151;
  color: #9ca3af;
  cursor: not-allowed;
}

/* User Info Styles */
.user-info-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.user-phone {
  font-size: 14px;
  color: var(--muted);
}

.computing-power-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.computing-power-value {
  color: var(--primary);
  font-weight: 600;
}

.refresh-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: var(--primary);
}

.refresh-btn:active {
  transform: rotate(180deg);
}

/* Prevent template flashing before Vue initializes */
[v-cloak] {
  display: none !important;
}

/* Terms of Service Styles */
.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  margin-bottom: 12px;
}

.terms-checkbox input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
}

.terms-link {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

.terms-link:hover {
  color: #16a34a;
}

.terms-modal {
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
}

.terms-content {
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
}

.terms-content h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary);
}

.terms-content h2 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 12px;
  color: var(--text);
}

.terms-content strong {
  color: var(--primary);
  font-weight: 600;
}

/* Invite Code Styles */
.clickable {
  cursor: pointer;
  transition: color 0.2s;
}

.clickable:hover {
  color: var(--primary);
}

.invite-code-display {
  background: #0b1220;
  border: 2px dashed var(--primary);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.invite-code-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.invite-code-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 6px;
  font-family: 'Courier New', monospace;
  text-align: center;
}

.invite-description {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 10px;
  padding: 16px;
}

.invite-icon {
  font-size: 32px;
  line-height: 1;
}

.invite-text {
  flex: 1;
}

.invite-text strong {
  display: block;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}

.invite-text p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.invite-text .highlight {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

/* Invite Tip in Register Form */
.invite-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.1);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: 13px;
}

.tip-icon {
  font-size: 16px;
  line-height: 1;
}

.tip-text {
  color: var(--muted);
  line-height: 1.4;
}

.tip-text strong {
  color: var(--primary);
  font-weight: 600;
}

/* Progress bar styles */
.progress-container {
  margin-top: 16px;
  width: 100%;
}

.progress-bar-wrapper {
  width: 100%;
  height: 24px;
  background: rgba(16, 24, 48, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #16a34a);
  border-radius: 12px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.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);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-text {
  text-align: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}



.progress-time {
  font-weight: 600;
  color: var(--primary);
}

/* Scene layout with textarea on the left */
.scene-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.scene-textarea-left {
  flex: 1;
  min-width: 0;
}

.scene-buttons-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* Video Results Styles */
.results {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-item .btn {
  margin-top: 8px;
  width: 100%;
  max-width: 240px;
}

.btn-full {
  width: 100%;
  display: inline-flex;
  justify-content: center;
}

/* ICP备案信息 */
.icp-footer {
  padding: 16px 20px;
  text-align: center;
  margin-top: 20px;
  width: 100%;
  display: block;
}

.icp-footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.3s ease;
  display: inline-block;
}

.icp-footer a:hover {
  color: var(--text);
}