/* ============================================================
   DualStar · 面具 app
   ============================================================ */

.mask-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.mask-shell {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  max-height: 100vh;
  background: var(--bg);
  border-radius: var(--phone-radius);
  box-shadow:
    0 0 0 12px var(--bg-elevated),
    0 0 0 13px var(--border-strong),
    var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .mask-shell {
    width: 100vw;
    height: 100vh;
    height: 100lvh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* —— 全屏模式 —— */
/* 基础样式已由 base.css 统一处理（窗口化） */

/* 平板/桌面端全屏模式：内容居中优化 */
@media (min-width: 769px) {
  [data-display-mode="fullscreen"] .mask-list,
  [data-display-mode="fullscreen"] .mask-editor-content {
    max-width: 720px;
    margin: 0 auto;
  }
}

/* —— 顶部导航 —— */
.mask-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  padding-top: calc(14px + var(--safe-area-top, env(safe-area-inset-top, 0px)));
  flex-shrink: 0;
}

.mask-nav-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
}

.mask-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
}
.mask-nav-btn:hover { background: var(--surface); }

.mask-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 10px 20px 4px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  line-height: 1.5;
}
.mask-subtitle strong {
  color: var(--accent-deep);
  font-weight: 600;
}

/* —— 列表 —— */
.mask-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.mask-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.mask-item:hover {
  background: var(--bg-soft);
  transform: translateY(-1px);
}
.mask-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mask-item-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  flex-shrink: 0;
  overflow: hidden;
}
.mask-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mask-item-body {
  flex: 1;
  min-width: 0;
}

.mask-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: 0.3px;
}

.mask-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mask-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mask-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--text-inverse);
  letter-spacing: 0.3px;
}
.mask-active-pill svg {
}

.mask-action {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-fast), transform var(--dur-fast);
}
.mask-action:hover {
  background: var(--surface);
  color: var(--text);
}
.mask-action-danger:hover {
  color: var(--danger);
  background: rgba(201, 168, 160, 0.15);
}

/* —— 空状态 —— */
.mask-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-tertiary);
}
.mask-empty-icon {
  margin: 0 auto 16px;
}
.mask-empty p {
  font-size: 14px;
  margin: 0 0 4px;
}
.mask-empty .micro {
  font-size: 12px;
  opacity: 0.7;
}

/* —— 提示卡片 —— */
.mask-tip {
  margin: 12px 16px 24px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: var(--r-md);
  border-left: 3px solid var(--highlight);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.mask-tip strong {
  color: var(--text);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.mask-tip p { margin: 0 0 6px; }
.mask-tip p:last-child { margin-bottom: 0; }

/* —— 编辑器 —— */
.mask-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 32px;
}

.mask-avatar-upload {
  width: 96px;
  height: 96px;
  border-radius: var(--r-full);
  margin: 8px auto 12px;
  background: var(--bg-soft);
  border: 2px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  overflow: hidden;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.mask-avatar-upload:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.02);
}
.mask-avatar-upload.has-image {
  border-style: solid;
  border-color: var(--border-strong);
}
.mask-avatar-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mask-active-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  margin-top: 16px;
}

.caption {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
  letter-spacing: 0.2px;
}
