/* ========================================
   米咖MV 手机端公共样式 - 剪映黑白版
   严格两色：黑色页面 + 白色图标文字
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #000;
  color: #fff;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== 通用变量（严格黑白灰）===== */
:root {
  --bg: #000000;
  --card: #161618;
  --card-light: #232326;
  --text: #ffffff;
  --text-secondary: rgba(255,255,255,0.65);
  --text-muted: rgba(255,255,255,0.4);
  --border: rgba(255,255,255,0.08);
  --white: #ffffff;
  --black: #000000;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ===== 白色线条图标 ===== */
.m-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.m-icon svg { width: 100%; height: 100%; }

/* ===== 通用组件 ===== */

/* 按钮 */
.m-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.m-btn:active { opacity: 0.85; transform: scale(0.98); }

/* 主按钮：白底黑字（剪映风格） */
.m-btn-primary {
  background: var(--white);
  color: var(--black);
}

/* 次按钮：深灰底白字 */
.m-btn-secondary {
  background: var(--card-light);
  color: var(--text);
}

/* 描边按钮 */
.m-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text);
}

.m-btn-block { width: 100%; }

/* 顶部导航栏 */
.m-header {
  background: var(--bg);
  padding: 10px 16px;
  padding-top: max(10px, var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.m-header-title {
  font-size: 17px;
  font-weight: 600;
}

.m-header-back {
  color: var(--text);
  text-decoration: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 底部导航 - 白色线条图标 */
.m-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 6px;
  z-index: 100;
}

.m-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  text-decoration: none;
  padding: 4px 10px;
  min-width: 52px;
}

.m-tab-item.active { color: var(--white); }

.m-tab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-tab-icon svg { width: 22px; height: 22px; }

/* 中间创作按钮：白圆黑+（反色突出） */
.m-tab-create {
  width: 46px;
  height: 46px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  margin-top: -14px;
  box-shadow: 0 4px 16px rgba(255,255,255,0.25);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.m-tab-create svg { width: 24px; height: 24px; }

/* 输入框 */
.m-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  background: var(--card);
  color: var(--text);
}

.m-input::placeholder { color: var(--text-muted); }

.m-input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.4);
}

.m-textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.6;
  resize: none;
  background: var(--card);
  color: var(--text);
}

.m-textarea::placeholder { color: var(--text-muted); }

.m-textarea:focus {
  outline: none;
  border-color: rgba(255,255,255,0.4);
}

/* 卡片 */
.m-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
}

/* 空状态 */
.m-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.m-empty-icon {
  margin-bottom: 16px;
  opacity: 0.4;
  display: flex;
  justify-content: center;
}
.m-empty-icon svg { width: 48px; height: 48px; }

.m-empty-text {
  font-size: 14px;
}

/* 加载中 */
.m-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}

.m-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 页面容器 */
.m-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: calc(56px + var(--safe-bottom));
}

.m-page.no-tabbar {
  padding-bottom: var(--safe-bottom);
}

/* 弹窗 */
.m-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.m-modal {
  width: 100%;
  max-height: 80vh;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.m-modal-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-modal-title {
  font-size: 17px;
  font-weight: 600;
}

.m-modal-close {
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-modal-close svg { width: 20px; height: 20px; }

.m-modal-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 16px;
}

/* Toast 提示 */
.m-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(30,30,30,0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 300;
  animation: fadeIn 0.2s ease;
  border: 1px solid var(--border);
  max-width: 80vw;
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 进度条 */
.m-progress {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.m-progress-bar {
  height: 100%;
  background: var(--white);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* 滚动条隐藏 */
::-webkit-scrollbar { display: none; }

/* 图片懒加载占位 */
.m-img-placeholder {
  background: var(--card-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* 分隔线 */
.m-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* 标签 */
.m-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--card-light);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 选中态：白底黑字反色 */
.m-tag.active {
  background: var(--white);
  color: var(--black);
}

/* 头像 */
.m-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 徽章 */
.m-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: var(--white);
  border-radius: 8px;
  font-size: 10px;
  color: var(--black);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
