/* ===== 全局重置与布局 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--mc-font);
  font-size: var(--mc-fs-base);
  color: var(--mc-text);
  background-color: var(--mc-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--mc-bg-elevated);
  box-shadow: 0 0 24px rgba(0,0,0,0.08);
}

#page-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* ===== 页面通用容器 ===== */
.page {
  min-height: 100%;
  padding: var(--mc-gap-md);
  padding-top: calc(var(--mc-gap-md) + var(--safe-top));
  padding-bottom: calc(80px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--mc-gap-md);
  animation: fadeIn 0.2s ease;
}

/* 内容不足一屏时：让占位容器伸展填满剩余空间，避免内容挤在顶部、下方大片空白 */
#list-container,
#review-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 列表/审批卡片不要被 flex 压缩 */
#list-container > .skin-card,
#review-container > .review-card {
  flex-shrink: 0;
}

/* 空状态在剩余空间中垂直居中 */
#list-container > .empty-state,
#review-container > .empty-state {
  flex: 1;
  align-self: stretch;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 页面标题 ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--mc-gap-sm);
}

.page-title {
  font-size: var(--mc-fs-xl);
  font-weight: 600;
  color: var(--mc-text);
}

.page-subtitle {
  font-size: var(--mc-fs-sm);
  color: var(--mc-text-dim);
  margin-top: var(--mc-gap-xs);
}

/* ===== 底部 Tab 栏（悬浮胶囊导航） ===== */
.tab-bar {
  position: fixed;
  bottom: calc(8px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.tab-bar.hidden {
  display: none;
}

/* 胶囊容器：药丸形 + 磨砂透明底 + 投影 */
.tab-capsule {
  display: flex;
  position: relative;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--mc-radius-pill);
  padding: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 6px rgba(0, 0, 0, 0.06);
}

/* 跟随指示器（高亮背景层） */
.tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: var(--mc-radius-pill);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 0;
  pointer-events: none;
  will-change: transform, width;
}

/* tab 项固定宽度，不拉伸填满 */
.tab-item {
  flex: 0 0 auto;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--mc-text-muted);
  font-size: var(--mc-fs-xs);
  transition: color 0.2s ease;
  min-height: 48px;
  position: relative;
  z-index: 1;
  border-radius: var(--mc-radius-pill);
}

.tab-item.active {
  color: var(--mc-grass);
  font-weight: 600;
}

.tab-icon {
  width: 22px;
  height: 22px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-item.active .tab-icon {
  transform: scale(1.08);
}

/* ===== 工具类 ===== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-dim {
  color: var(--mc-text-dim);
}

.text-error {
  color: var(--mc-redstone);
}

.text-success {
  color: var(--mc-grass);
}

.mt-sm { margin-top: var(--mc-gap-sm); }
.mt-md { margin-top: var(--mc-gap-md); }
.mt-lg { margin-top: var(--mc-gap-lg); }

/* ===== 表单通用 ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: var(--mc-fs-sm);
  font-weight: 500;
  color: var(--mc-text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mc-gap-xs);
}

.form-label .required-mark {
  color: var(--mc-redstone);
}

.form-hint {
  font-size: var(--mc-fs-xs);
  color: var(--mc-text-muted);
}

/* 提交页顶部通知提示（上架结果在群内通知） */
.submit-notice {
  margin: -6px 0 16px;
  padding: 8px 12px;
  font-size: var(--mc-fs-xs);
  color: var(--mc-text);
  background: rgba(251, 189, 8, 0.08);
  border: 1px dashed var(--mc-gold);
  border-radius: 8px;
}

.form-error {
  font-size: var(--mc-fs-xs);
  color: var(--mc-redstone);
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px var(--mc-gap-md);
  background: var(--mc-bg-input);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius-sm);
  color: var(--mc-text);
  font-size: var(--mc-fs-base);
  font-family: var(--mc-font);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--mc-grass);
  box-shadow: 0 0 0 2px rgba(15, 110, 86, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--mc-text-faint);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.6;
}

.form-input.error,
.form-textarea.error {
  border-color: var(--mc-redstone);
}

/* 密码可见切换：输入框 + 眼睛按钮 */
.pwd-field {
  position: relative;
  width: 100%;
}

.pwd-field .pwd-input {
  padding-right: 44px;
}

.pwd-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: var(--mc-radius-sm);
  cursor: pointer;
  color: var(--mc-text-muted);
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.pwd-toggle:active {
  background: rgba(15, 110, 86, 0.10);
}

.pwd-toggle.active {
  color: var(--mc-grass);
}

/* 眼睛图标（SVG 描边，闭眼=隐藏 / 睁眼=显示） */
.pwd-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 默认密文状态：显示"闭眼"图标（点击后看明文）；active 时显示"睁眼"图标 */
.pwd-toggle .pwd-eye-open { display: none; }
.pwd-toggle.active .pwd-eye-open { display: block; }
.pwd-toggle.active .pwd-eye-closed { display: none; }

/* 自定义展开式下拉（投稿工坊）：手机端不再弹系统选择器，与网页端一致展开 */
.workshop-select {
  position: relative;
  width: 100%;
}

.workshop-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.workshop-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.workshop-select-trigger .workshop-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--mc-text-faint);
}

.workshop-select-trigger.selected .workshop-select-value {
  color: var(--mc-text);
}

.workshop-select-arrow {
  flex: none;
  font-size: 12px;
  color: var(--mc-text-muted);
  transition: transform 0.15s;
}

.workshop-select-trigger.open .workshop-select-arrow {
  transform: rotate(180deg);
}

.workshop-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--mc-bg-input);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius-sm);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.workshop-select-item {
  padding: 10px var(--mc-gap-md);
  border-radius: calc(var(--mc-radius-sm) - 2px);
  font-size: var(--mc-fs-base);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.workshop-select-item:active,
.workshop-select-item:hover {
  background: rgba(15, 110, 86, 0.12);
}

.workshop-select-item.is-disabled {
  color: var(--mc-text-faint);
  cursor: default;
}

.workshop-select-item.is-disabled:hover {
  background: none;
}

/* 字符计数 */
.char-counter {
  text-align: right;
  font-size: var(--mc-fs-xs);
  color: var(--mc-text-muted);
}

.char-counter.over-limit {
  color: var(--mc-redstone);
}

/* ===== 滚动条隐藏（移动端） ===== */
#page-container::-webkit-scrollbar {
  width: 0;
  display: none;
}

#page-container {
  scrollbar-width: none;
}
