/* LeoLemon 通用样式 - 全宽布局 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-card: #222222;
  --bg-hover: #2a2a2a;
  --text-primary: #e0e0e0;
  --text-secondary: #888888;
  --accent: #fbbf24;
  --accent-hover: #f59e0b;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --border: #333333;
  --success: #22c55e;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

.container {
  width: 80vw;
  max-width: 1600px;
  min-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.hidden { display: none !important; }

/* ─── 头部 ─── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.header-left { display: flex; align-items: center; gap: 12px; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}

.header-right.collapsed {
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  gap: 0;
  padding: 0;
}

.header-right:not(.collapsed) {
  max-width: 600px;
  opacity: 1;
}

.header-nav-toggle {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.header-nav-toggle:hover { border-color: var(--accent); color: var(--accent); }

.brand-icon { font-size: 32px; }
header h1 { font-size: 20px; color: var(--accent); }

.btn-love {
  padding: 8px 16px;
  border: 1px solid #ff69b4;
  border-radius: 8px;
  background: transparent;
  color: #ff69b4;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-love:hover { background: #ff69b4; color: #fff; }

.btn-back {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-back:hover { border-color: var(--accent); color: var(--accent); }

.btn-logout {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ─── 验证码 ─── */
.auth-card {
  max-width: 400px;
  margin: 120px auto;
  text-align: center;
  background: var(--bg-card);
  padding: 40px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.brand { font-size: 64px; margin-bottom: 16px; }
.auth-card h1 { font-size: 24px; margin-bottom: 8px; color: var(--accent); }
.auth-card p { color: var(--text-secondary); margin-bottom: 24px; }

.input-group { display: flex; gap: 8px; }

.input-group input {
  flex: 1; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-primary); color: var(--text-primary);
  font-size: 16px; outline: none; transition: border-color 0.2s;
}

.input-group input:focus { border-color: var(--accent); }

.input-group button {
  padding: 12px 24px; border: none; border-radius: 8px;
  background: var(--accent); color: #000;
  font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}

.input-group button:hover { background: var(--accent-hover); }

.error { color: var(--danger); margin-top: 12px; font-size: 14px; }

/* ─── 上传区域 ─── */
.upload-area {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 48px; text-align: center; cursor: pointer;
  transition: all 0.3s; margin-bottom: 24px;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent); background: rgba(251, 191, 36, 0.05);
}

.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-content p { color: var(--text-secondary); margin-bottom: 8px; }
.upload-hint { font-size: 13px; }

/* ─── 上传进度 ─── */
#upload-progress { margin-bottom: 24px; }

.progress-bar {
  height: 6px; background: var(--bg-card);
  border-radius: 3px; overflow: hidden;
}

.progress-fill {
  height: 100%; background: var(--accent);
  width: 0; transition: width 0.3s; border-radius: 3px;
}

#progress-text { font-size: 14px; color: var(--text-secondary); margin-top: 8px; }

/* ─── 图片列表 ─── */
.section-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 16px;
}

.section-header h2 { font-size: 18px; }

.btn-refresh {
  padding: 6px 12px; border: 1px solid var(--border);
  border-radius: 6px; background: transparent;
  color: var(--text-secondary); cursor: pointer;
  font-size: 14px; transition: all 0.2s;
}

.btn-refresh:hover { border-color: var(--accent); color: var(--accent); }

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.image-card {
  background: var(--bg-card); border-radius: 10px;
  overflow: hidden; border: 1px solid var(--border);
  transition: transform 0.2s, border-color 0.2s;
}

.image-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.image-thumb {
  width: 100%; height: 160px; object-fit: cover;
  cursor: pointer; display: block; background: var(--bg-primary);
}

.image-info { padding: 12px; }

.image-name {
  font-size: 13px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}

.image-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }

.image-actions { display: flex; gap: 8px; }

.image-actions button {
  flex: 1; padding: 6px; border: 1px solid var(--border);
  border-radius: 6px; background: transparent;
  color: var(--text-secondary); cursor: pointer;
  font-size: 12px; transition: all 0.2s;
}

.image-actions .btn-copy:hover { border-color: var(--accent); color: var(--accent); }
.image-actions .btn-delete:hover { border-color: var(--danger); color: var(--danger); }

.empty-hint {
  grid-column: 1 / -1; text-align: center;
  color: var(--text-secondary); padding: 40px;
}

/* ─── 模态框 ─── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}

.modal-content { max-width: 90%; max-height: 90vh; text-align: center; }
.modal-content img { max-width: 100%; max-height: 75vh; border-radius: 8px; margin-bottom: 12px; }

.modal-info {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: wrap;
}

.modal-info p { color: var(--text-secondary); font-size: 14px; word-break: break-all; max-width: 500px; }

.modal-info button {
  padding: 8px 16px; border: none; border-radius: 6px;
  background: var(--accent); color: #000; font-weight: 600; cursor: pointer;
}

/* ─── 通知 ─── */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-primary); font-size: 14px;
  z-index: 2000; animation: fadeInUp 0.3s ease;
}

.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.info { border-color: #38bdf8; color: #38bdf8; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── 功能标签页 ─── */
.func-tabs {
  display: flex; gap: 6px; margin-bottom: 24px;
  background: var(--bg-card); padding: 4px;
  border-radius: 10px; border: 1px solid var(--border);
}

.func-tab {
  flex: 1; padding: 10px 16px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-secondary);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}

.func-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.func-tab.active { background: var(--accent); color: #000; font-weight: 600; }

/* ─── Base64 转换 ─── */
.b64-section {
  background: var(--bg-card); padding: 24px;
  border-radius: 12px; border: 1px solid var(--border); margin-bottom: 24px;
}

.b64-input-group label { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }

.b64-upload-area {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 24px; text-align: center; cursor: pointer; transition: all 0.3s;
}

.b64-upload-area:hover, .b64-upload-area.drag-over {
  border-color: var(--accent); background: rgba(251,191,36,0.05);
}

.b64-divider { text-align: center; padding: 16px 0; position: relative; }
.b64-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.b64-divider span { background: var(--bg-card); padding: 0 16px; color: var(--text-secondary); font-size: 13px; position: relative; z-index: 1; }

.b64-url-row { display: flex; gap: 8px; }

.b64-url-row input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-primary); color: var(--text-primary);
  font-size: 14px; outline: none; transition: border-color 0.2s;
}

.b64-url-row input:focus { border-color: var(--accent); }

.btn-b64-convert {
  padding: 10px 20px; border: none; border-radius: 8px;
  background: var(--accent); color: #000; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: background 0.2s; white-space: nowrap;
}

.btn-b64-convert:hover { background: var(--accent-hover); }

.b64-result { background: var(--bg-card); padding: 24px; border-radius: 12px; border: 1px solid var(--border); }
.b64-preview { text-align: center; margin-bottom: 16px; }
.b64-preview img { max-width: 100%; max-height: 300px; border-radius: 8px; background: #fff; padding: 8px; }
.b64-info { text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 16px; }

.b64-actions { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

.b64-actions .btn-action {
  flex: 1; min-width: 140px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--text-secondary);
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}

.b64-actions .btn-action:hover { border-color: var(--accent); color: var(--accent); }

.b64-output label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }

.b64-output textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-primary); color: var(--text-primary);
  font-family: 'Courier New', monospace; font-size: 12px; resize: vertical; outline: none;
}

/* ─── 响应式 ─── */
@media (max-width: 768px) {
  .container { width: 95vw; min-width: auto; padding: 12px; }
  .auth-card { margin: 60px auto; padding: 24px; }
  .brand { font-size: 48px; }
  .upload-area { padding: 24px; }
  .images-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .image-thumb { height: 120px; }
  header h1 { font-size: 16px; }
  .header-right { gap: 6px; }
  .btn-love, .btn-back { padding: 6px 10px; font-size: 12px; }
}
