/* ============================================
   米车 AI 萌宠工坊 - 用户中心样式
   ============================================ */

:root {
  --mi-orange: #FF6900;
  --mi-orange-dark: #E55D00;
  --deep-gray: #1A1A2E;
  --bg-light: #F5F5F7;
  --bg-white: #FFFFFF;
  --text-primary: #1A1A2E;
  --text-secondary: #666680;
  --border-color: #E8E8EF;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  min-height: 100vh;
}

/* 用户认证页 */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--deep-gray), #2D2D3F);
  padding: 20px;
}

.auth-box {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 400px;
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.5s ease;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.auth-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.auth-box .form-group {
  margin-bottom: 18px;
}

.auth-box .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.auth-box .form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.auth-box .form-group input:focus {
  border-color: var(--mi-orange);
  box-shadow: 0 0 0 3px rgba(255,105,0,0.1);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--mi-orange), var(--mi-orange-dark));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.auth-btn:hover {
  box-shadow: 0 8px 24px rgba(255,105,0,0.3);
}

.auth-error {
  color: #FA5151;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  min-height: 20px;
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--mi-orange);
  font-weight: 500;
}

.back-home {
  text-align: center;
  margin-top: 16px;
}

.back-home a {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  transition: var(--transition);
}

.back-home a:hover { color: #fff; }

/* 用户仪表盘布局 */
.user-layout {
  display: flex;
  min-height: 100vh;
}

.user-sidebar {
  width: 220px;
  background: var(--deep-gray);
  color: #fff;
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.user-sidebar .sidebar-hd {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
  text-align: center;
}

.user-sidebar .sidebar-hd .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mi-orange), var(--mi-orange-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 10px;
}

.user-sidebar .sidebar-hd .name {
  font-size: 16px;
  font-weight: 600;
}

.user-sidebar .sidebar-hd .role {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.user-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}

.user-sidebar nav a:hover,
.user-sidebar nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.user-sidebar nav a.active { border-left: 3px solid var(--mi-orange); }

.user-sidebar .logout-btn {
  margin: 20px;
  padding: 10px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  width: calc(100% - 40px);
  transition: var(--transition);
  font-family: inherit;
}

.user-sidebar .logout-btn:hover { background: rgba(255,0,0,0.15); color: #ff6b6b; }

.user-main {
  flex: 1;
  margin-left: 220px;
  padding: 32px;
}

.user-topbar { margin-bottom: 32px; }
.user-topbar h1 { font-size: 24px; font-weight: 700; }

/* 用户上传表单卡片 */
.upload-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  max-width: 600px;
}

.upload-card h2 {
  font-size: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-card .form-group {
  margin-bottom: 18px;
}

.upload-card .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

.upload-card .form-group input,
.upload-card .form-group select,
.upload-card .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.upload-card .form-group textarea { resize: vertical; min-height: 80px; }

.upload-card .form-group input:focus,
.upload-card .form-group select:focus,
.upload-card .form-group textarea:focus {
  border-color: var(--mi-orange);
}

.upload-card .form-group .hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.submit-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--mi-orange), var(--mi-orange-dark));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.submit-btn:hover { box-shadow: 0 8px 24px rgba(255,105,0,0.3); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 提交列表 */
.submission-list {
  display: grid;
  gap: 16px;
}

.submission-item {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 16px;
  align-items: center;
}

.submission-item .sub-preview {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  overflow: hidden;
}

.submission-item .sub-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.submission-item .sub-info {
  flex: 1;
  min-width: 0;
}

.submission-item .sub-info h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.submission-item .sub-info .sub-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.submission-item .sub-status {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.sub-status.pending { background: #FFF3E0; color: #E65100; }
.sub-status.approved { background: #E8F5E9; color: #2E7D32; }
.sub-status.rejected { background: #FFEBEE; color: #C62828; }

/* Toast */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 28px;
  border-radius: 24px;
  color: #fff;
  font-weight: 500;
  z-index: 9999;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-md);
}

.toast.success { background: #07C160; }
.toast.error { background: #FA5151; }
.toast.info { background: var(--mi-orange); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 响应式 */
@media (max-width: 768px) {
  .user-sidebar {
    width: 0;
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .user-sidebar.open { width: 220px; transform: translateX(0); }
  .user-main { margin-left: 0; padding: 20px; }
  .upload-card { max-width: 100%; }
  .submission-item { flex-direction: column; text-align: center; }
  .sidebar-mtoggle {
    display: block !important;
  }
}

.sidebar-mtoggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 40px;
  height: 40px;
  background: var(--mi-orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
}
