/**
 * 玩家端 H5 遥控器样式（独立目录，不复用 /cok/ 代理后台样式）
 */
* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 12px;
  background: #f0f2f5;
  color: #222;
  position: relative;
  min-height: 100vh;
}

/* Login page background (仅在登录状态显示) */
body:not(.yk-logged-in)::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('/assets/login-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
}

/* Add overlay when logged out */
body:not(.yk-logged-in)::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: -1;
  pointer-events: none;
}

h1 { font-size: 1.125rem; margin: 0; }

.yk-card {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.yk-res-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
  font-size: 0.75rem;
  text-align: center;
}

@media (min-width: 400px) {
  .yk-res-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.yk-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.yk-filter-row input {
  flex: 1;
  min-width: 80px;
  padding: 8px;
  font-size: 0.875rem;
}

.yk-backpack-pre {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.75rem;
  max-height: 50vh;
  overflow: auto;
  background: #f7f8fa;
  padding: 8px;
  border-radius: 6px;
  margin: 0 0 10px;
}

.yk-card.yk-card-selected {
  outline: 3px solid #07c160;
  outline-offset: 1px;
  background: #f0fff4;
}

.yk-res-grid span {
  background: #f7f8fa;
  padding: 4px 2px;
  border-radius: 4px;
}

label {
  display: block;
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 6px;
}

input[type="text"],
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

#code-input {
  font-size: 1.125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 12px;
}

button {
  padding: 8px 12px;
  font-size: 0.875rem;
  border: none;
  border-radius: 6px;
  background: #07c160;
  color: #fff;
  cursor: pointer;
}

button.yk-secondary { background: #888; }
button.yk-secondary.yk-btn-active {
  background: #07c160;
  color: #fff;
}
button.yk-warn { background: #fa9d3b; }

button.yk-ghost {
  background: #fff;
  color: #07c160;
  border: 1px solid #07c160;
  padding: 4px 10px;
}

button.yk-ghost.yk-active {
  background: #07c160;
  color: #fff;
}

.yk-hidden { display: none !important; }

.yk-title {
  font-weight: 600;
  font-size: 1rem;
}

.yk-online { color: #07c160; }
.yk-offline { color: #999; }

.yk-err {
  color: #e54;
  font-size: 0.875rem;
  margin-top: 8px;
}

.yk-login-wrap {
  max-width: 400px;
  margin: 40px auto 0;
}

.yk-login-title {
  text-align: center;
  margin-bottom: 16px;
}

.yk-btn-block {
  width: 100%;
  margin-top: 12px;
}

.yk-login-lang {
  text-align: center;
  margin-top: 16px;
  font-size: 0.875rem;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.yk-login-lang button { margin: 0 4px; }
.yk-login-lang span { margin: 0 4px; }

.yk-top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin: -12px -12px 10px -12px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.yk-top-nav::-webkit-scrollbar { display: none; }

#header-account-select {
  flex: 1 1 120px;
  min-width: 0;
  max-width: 42vw;
  height: 40px;
  padding: 8px 28px 8px 10px;
  font-size: 0.875rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #f7f8fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  -webkit-appearance: none;
}

.yk-nav-btn {
  flex: 0 0 auto;
  height: 40px;
  min-width: 44px;
  padding: 8px 10px;
  font-size: 0.8125rem;
  border-radius: 8px;
  white-space: nowrap;
  touch-action: manipulation;
}

.yk-nav-btn.yk-lang {
  min-width: 40px;
  padding: 8px;
  margin-left: auto;
}

.yk-nav-sep {
  color: #ddd;
  flex: 0 0 auto;
  user-select: none;
  font-size: 0.75rem;
}

#btn-logout {
  flex-shrink: 0;
  color: #666;
}

.yk-session-note {
  font-size: 0.75rem;
  color: #999;
  margin-bottom: 8px;
  padding: 0 2px;
}

.yk-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* 批量操作按钮行中的按钮平均分布 */
.yk-btn-row > button {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
}

/* 第一行4个按钮 */
.yk-btn-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 0;
}

/* 第二行3个按钮 */
.yk-btn-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.yk-info-row {
  font-size: 0.8125rem;
  color: #444;
  margin-top: 8px;
  line-height: 1.6;
}

.yk-modal:not(.yk-hidden) {
  display: flex;
}

.yk-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: flex-end;
  z-index: 100;
}

.yk-modal-panel {
  background: #fff;
  width: 100%;
  max-height: 85vh;
  border-radius: 12px 12px 0 0;
  padding: 16px;
  overflow-y: auto;
}

.yk-cover-item {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.875rem;
}

.yk-search-row {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.yk-search-row input {
  flex: 1;
  letter-spacing: 0;
  text-transform: none;
}

.yk-hint {
  font-size: 0.75rem;
  color: #999;
  margin: 6px 0;
}

.yk-btn-full {
  width: 100%;
  margin-top: 8px;
}

.yk-cover-uid {
  color: #999;
}

.yk-gather-list {
  margin: 8px 0 12px;
}

.yk-gather-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  font-size: 0.9375rem;
  cursor: pointer;
}

.yk-gather-option:last-child {
  border-bottom: none;
}

.yk-gather-option input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.yk-backpack-option {
  margin: 8px 0 12px;
}

.yk-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.yk-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.yk-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 28px;
  transition: background 0.2s;
}

.yk-switch-slider::before {
  position: absolute;
  content: '';
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.yk-switch input:checked + .yk-switch-slider {
  background: #07c160;
}

.yk-switch input:checked + .yk-switch-slider::before {
  transform: translateX(20px);
}

.yk-switch input:disabled + .yk-switch-slider {
  opacity: 0.6;
  cursor: wait;
}

.yk-upgrade-level-label {
  display: block;
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 6px;
}

.yk-upgrade-select {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* 迁城模态框样式 */
.yk-relocate-isbuy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  font-size: 14px;
  cursor: pointer;
}
.yk-relocate-isbuy input {
  width: 18px;
  height: 18px;
}
.yk-cover-add-section.yk-hidden {
  display: none;
}
.yk-open-shield-option {
  margin: 12px 0 16px;
}
.yk-relocate-inputs {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.yk-relocate-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.yk-relocate-input-group label {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 6px;
}

.yk-relocate-input {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.yk-batch-operation-bar {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.yk-card-checkbox {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 2;
}

.yk-card {
  position: relative;
  padding-left: 36px;
}

/* 语言选择弹窗样式 */
.yk-lang-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.yk-lang-option {
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  color: #222;
  cursor: pointer;
  transition: all 0.2s;
}

.yk-lang-option:hover {
  border-color: #1890ff;
  background: #f0f7ff;
}

.yk-lang-option:active {
  transform: scale(0.98);
}

.yk-lang-option-text {
  font-weight: 500;
  color: #222;
}
