/* ROUZHEN Studio — 简洁 / 安静 / 自然 / 留白 */

:root {
  --color-bg: #fafaf8;
  --color-text: #2b2b28;
  --color-muted: #8a8a82;
  --color-line: #e3e2dd;
  --color-accent: #2b2b28;
  --radius: 10px;
  --space-unit: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  min-height: 100vh;
}

/* 标题区 */

.header {
  text-align: center;
  margin-bottom: 56px;
}

.header h1 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin: 0;
  color: var(--color-text);
}

/* 导航 */

.nav {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 13px;
  color: var(--color-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--color-text);
  border-color: var(--color-line);
}

.nav-link.active {
  color: var(--color-text);
  background: #f0f0ec;
  border-color: var(--color-line);
}

/* 上传区 */

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: 40px;
}

.size-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

/* 上传队列 */

.queue-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  background: #f5f5f1;
}

.queue-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eaeae5;
}

.queue-name {
  flex: 1;
  font-size: 12px;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.queue-status {
  font-size: 11px;
  flex-shrink: 0;
  white-space: nowrap;
}

.queue-status--waiting {
  color: var(--color-muted);
}

.queue-status--generating,
.queue-status--uploading {
  color: var(--color-text);
}

.queue-status--done {
  color: #5a8a5a;
}

.queue-status--error {
  color: #a85a5a;
}

/* 结果列表 */

.result-list {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

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

.result-item-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.result-item-name {
  font-size: 10px;
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  text-align: center;
}

/* 按钮 */

.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius);
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  width: 100%;
  max-width: 280px;
}

.btn:active {
  opacity: 0.7;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-line);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

/* 结果区 */

.result-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* 状态提示 */

.status-msg {
  text-align: center;
  font-size: 12px;
  color: var(--color-muted);
  min-height: 16px;
  margin-top: 32px;
}

/* 口令浮层 */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

.overlay-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overlay-text {
  margin: 0;
  font-size: 14px;
  text-align: center;
  color: var(--color-text);
}

.token-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--color-line);
  background: #fff;
  font-size: 14px;
  text-align: center;
}

.overlay-actions {
  display: flex;
  gap: 12px;
}

.overlay-actions .btn {
  max-width: none;
}

/* Asset Library 卡片样式 */
.asset-card {
  border: 1px solid var(--color-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.asset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.asset-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f5f5f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.asset-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.85rem;
}

.asset-info {
  padding: 8px 10px;
}

.asset-filename {
  font-size: 0.85rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.asset-meta {
  display: flex;
  gap: 6px;
  font-size: 0.7rem;
}

.asset-source,
.asset-status {
  padding: 2px 6px;
  border-radius: 4px;
  background: #f0f0ec;
  color: var(--color-muted);
}

.asset-status {
  background: #fff3e0;
  color: #b76e00;
}

.meta-pre {
  background: #fafaf7;
  padding: 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--color-line);
}

.action-buttons {
  margin: 12px 0;
  display: flex;
  gap: 8px;
}

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: 16px;
}

.tab-bar .tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s ease;
}

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

.tab-bar .tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}
