/* ========================================
   二手电子交易平台 v4.0 — 全局设计系统
   简洁精致 · 类闲鱼/转转风格
   ======================================== */

/* ===== CSS 变量 ===== */
:root {
  /* 主色 */
  --primary: #FF6B35;
  --primary-light: #FFF0EB;
  --primary-dark: #E55A2B;

  /* 功能色 */
  --success: #00B894;
  --success-light: #E6F9F4;
  --danger: #E17055;
  --danger-light: #FDF0ED;
  --warning: #FDCB6E;
  --info: #74B9FF;

  /* 中性色 */
  --text: #2D3436;
  --text-secondary: #636E72;
  --text-light: #B2BEC3;
  --bg: #F8F9FA;
  --bg-white: #FFFFFF;
  --border: #E8ECF0;
  --border-light: #F2F4F6;

  /* 尺寸 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

  /* 布局 */
  --max-width: 1200px;
  --header-height: 60px;
  --mobile-nav-height: 56px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--primary); }

img {
  max-width: 100%;
  vertical-align: middle;
}

button {
  cursor: pointer;
  font-family: var(--font);
  border: none;
  background: none;
  font-size: inherit;
}

input, textarea, select {
  font-family: var(--font);
  outline: none;
}

ul, ol { list-style: none; }

/* ===== Header ===== */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.logo:hover { color: var(--primary-dark); }
.logo span { color: var(--text); }

/* 搜索栏 */
.search-bar {
  flex: 1;
  max-width: 520px;
  position: relative;
}
.search-bar input {
  width: 100%;
  padding: 9px 42px 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  background: var(--bg);
  transition: all 0.25s;
}
.search-bar input:focus {
  border-color: var(--primary);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}
.search-bar .btn-search {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.2s;
}
.search-bar .btn-search:hover {
  background: var(--primary-dark);
}

/* 头部操作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--bg-white);
  color: var(--text);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-primary {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}
.btn-sm {
  padding: 5px 14px;
  font-size: 12px;
  border-radius: 16px;
}
.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
}
.btn-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-light);
}
.btn-block {
  width: 100%;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 24px;
  transition: background 0.2s;
}
.header-user:hover {
  background: var(--bg);
}
.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
}
.header-nickname {
  font-size: 14px;
  font-weight: 500;
}

.msg-btn {
  position: relative;
  padding: 8px;
  font-size: 20px;
  border-radius: 50%;
  transition: background 0.2s;
}
.msg-btn:hover {
  background: var(--bg);
}
.msg-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 700;
}
.msg-badge.show { display: flex; }

/* ===== Main Content ===== */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - var(--header-height) - 80px);
  padding-bottom: calc(20px + var(--mobile-nav-height));
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #FF8C42 100%);
  border-radius: var(--radius-lg);
  padding: 52px 40px;
  margin-bottom: 28px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -15%;
  width: 500px;
  height: 500px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.hero h1 {
  font-size: 30px;
  font-weight: 800;
  position: relative;
  letter-spacing: -0.5px;
}
.hero p {
  margin-top: 10px;
  opacity: 0.9;
  font-size: 15px;
  position: relative;
}

/* ===== Category Nav ===== */
.cats-wrapper {
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cats-wrapper::-webkit-scrollbar { display: none; }
.cats {
  display: flex;
  gap: 12px;
  padding: 4px 0;
}
.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text);
  min-width: 60px;
  transition: all 0.2s;
}
.cat:hover { color: var(--primary); }
.cat-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-white);
  border-radius: 50%;
  box-shadow: var(--shadow);
  font-size: 24px;
  transition: all 0.25s;
}
.cat:hover .cat-icon {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.cat-name {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  padding: 14px 0 14px 16px;
  margin-bottom: 14px;
  position: relative;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: var(--primary);
  border-radius: 2px;
}

/* ===== Goods Grid ===== */
.goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.goods-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  color: var(--text);
  display: block;
}
.goods-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.goods-card-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  background: var(--bg);
}
.goods-card-noimg {
  width: 100%;
  height: 190px;
  background: linear-gradient(135deg, var(--primary-light), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 40px;
}
.goods-card-body {
  padding: 14px;
}
.goods-card-title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
  line-height: 1.4;
}
.goods-card-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--danger);
}
.goods-card-price .original {
  font-size: 13px;
  color: var(--text-light);
  text-decoration: line-through;
  font-weight: 400;
  margin-left: 6px;
}
.goods-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-light);
}

/* ===== Detail Page ===== */
.detail-container {
  max-width: 800px;
  margin: 0 auto;
}
.detail-images {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 16px;
}
.detail-images img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  display: block;
}
.detail-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 4px;
}
.detail-thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2.5px solid transparent;
  flex-shrink: 0;
  transition: all 0.2s;
}
.detail-thumbs img:hover {
  opacity: 0.85;
}
.detail-thumbs img.active {
  border-color: var(--primary);
}
.detail-info h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
}
.detail-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 16px;
}
.detail-price .original {
  font-size: 16px;
  color: var(--text-light);
  text-decoration: line-through;
  font-weight: 400;
  margin-left: 10px;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}
.tag-location { background: #E8F6FF; color: #0984E3; }

.detail-seller {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-seller img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.detail-seller .name {
  font-weight: 600;
  font-size: 15px;
}
.detail-seller .meta {
  font-size: 12px;
  color: var(--text-light);
}

.detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
  padding: 16px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.detail-actions {
  position: sticky;
  bottom: var(--mobile-nav-height);
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  margin-top: 20px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.detail-actions .btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.btn-buy {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary) !important;
}
.btn-buy:hover {
  background: var(--primary-dark) !important;
}
.btn-chat {
  background: var(--bg);
  border-color: var(--border) !important;
}

.fav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.fav-btn:hover {
  border-color: var(--danger);
  background: var(--danger-light);
}
.fav-btn.active {
  border-color: var(--danger);
  background: var(--danger-light);
}

/* ===== Form ===== */
.form-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  max-width: 460px;
  margin: 40px auto;
}
.form-card.wide {
  max-width: 680px;
}
.form-card h2 {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 28px;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group .required::after {
  content: '*';
  color: var(--danger);
  margin-left: 4px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.25s;
  background: var(--bg-white);
  color: var(--text);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}
.form-control::placeholder {
  color: var(--text-light);
}
textarea.form-control {
  resize: vertical;
  min-height: 100px;
}
select.form-control {
  appearance: auto;
  cursor: pointer;
}
.form-tip {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}
.form-error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  display: none;
}
.form-success {
  background: var(--success-light);
  color: var(--success);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  display: none;
}
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}
.form-footer a {
  color: var(--primary);
  font-weight: 500;
}

/* ===== Image Upload ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--bg);
}
.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-area .icon {
  font-size: 40px;
  color: var(--text-light);
}
.upload-area .text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}
.upload-area .hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}
.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.upload-preview .item {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1.5px solid var(--border);
  background: var(--bg);
}
.upload-preview .item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-preview .item .del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.upload-preview .item .del:hover {
  background: rgba(0,0,0,0.8);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state .icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ===== Order Card ===== */
.order-card {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.order-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}
.order-status {
  color: var(--primary);
  font-weight: 600;
}
.order-body {
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.order-body .thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--bg);
}
.order-body .info {
  flex: 1;
  min-width: 0;
}
.order-body .title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-body .price {
  font-size: 16px;
  font-weight: 700;
  color: var(--danger);
  margin-top: 4px;
}
.order-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== Message Styles ===== */
.msg-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
  transition: background 0.2s;
}
.msg-item.unread {
  background: var(--primary-light);
}
.msg-item .from {
  font-size: 14px;
  font-weight: 600;
}
.msg-item .content {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-item .time {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ===== Notification ===== */
.notif-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
  cursor: pointer;
  transition: background 0.2s;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread {
  border-left: 3px solid var(--primary);
}
.notif-item .title {
  font-size: 14px;
  font-weight: 600;
}
.notif-item .content {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.notif-item .time {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px 0;
}
.pagination a, .pagination span {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  min-width: 40px;
  text-align: center;
}
.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: #FFF8E1; color: #F57F17; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: #E3F2FD; color: #1565C0; }
.badge-default { background: var(--bg); color: var(--text-secondary); }

.status-pending { color: var(--warning); }
.status-paid { color: var(--info); }
.status-shipped { color: var(--primary); }
.status-completed { color: var(--success); }
.status-cancelled { color: var(--text-light); }
.status-refund { color: var(--danger); }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ===== Review ===== */
.review-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.review-item .user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.review-item .user img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.review-item .stars {
  color: var(--warning);
  font-size: 16px;
}
.review-item .text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Stars ===== */
.star-rating {
  display: flex;
  gap: 4px;
  font-size: 28px;
  cursor: pointer;
}
.star-rating span {
  color: var(--text-light);
  transition: color 0.2s;
}
.star-rating span.active,
.star-rating span:hover {
  color: var(--warning);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 24px 16px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}

/* ===== Mobile Bottom Nav ===== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border-top: 1.5px solid var(--border);
  z-index: 99;
  padding: 6px 0 env(safe-area-inset-bottom, 6px) 0;
  justify-content: space-around;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}
.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-light);
  text-decoration: none;
  min-width: 56px;
  padding: 2px 0;
  transition: color 0.2s;
}
.mobile-nav a.active {
  color: var(--primary);
}
.mobile-nav a .nav-icon {
  font-size: 22px;
  line-height: 1;
}
.mobile-nav .publish-btn {
  position: relative;
}
.mobile-nav .publish-btn .nav-icon {
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-top: -12px;
  box-shadow: 0 2px 8px rgba(255,107,53,0.4);
}

/* ===== Loading & Toast ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
  font-size: 14px;
}
.loading::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(45, 52, 54, 0.92);
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Profile Nav ===== */
.profile-layout {
  display: flex;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}
.profile-sidebar {
  width: 200px;
  flex-shrink: 0;
}
.profile-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 2px;
}
.profile-sidebar .nav-item:hover {
  background: var(--bg);
  color: var(--text);
}
.profile-sidebar .nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.profile-content {
  flex: 1;
  min-width: 0;
}

/* ===== User Info Header ===== */
.user-info-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.user-info-header img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}
.user-info-header .name {
  font-size: 18px;
  font-weight: 700;
}
.user-info-header .meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.user-info-header .stats {
  display: flex;
  gap: 20px;
  margin-left: auto;
}
.user-info-header .stat {
  text-align: center;
}
.user-info-header .stat .num {
  font-size: 18px;
  font-weight: 700;
}
.user-info-header .stat .label {
  font-size: 12px;
  color: var(--text-light);
}

/* ===== Admin Page ===== */
.admin-page {
  max-width: 1000px;
  margin: 0 auto;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show {
  display: flex;
}
.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}
.modal .close-btn {
  float: right;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-light);
  transition: background 0.2s;
}
.modal .close-btn:hover {
  background: var(--bg);
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.w-full { width: 100%; }
.hidden { display: none; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Responsive ===== */

/* Mobile < 768px */
@media (max-width: 768px) {
  .header-inner { padding: 0 12px; gap: 10px; }
  .logo { font-size: 18px; }
  .search-bar { max-width: none; }
  .search-bar input { padding: 8px 36px 8px 12px; font-size: 13px; }
  .search-bar .btn-search { width: 28px; height: 28px; font-size: 13px; }
  .header-nickname { display: none; }
  .header-avatar { width: 30px; height: 30px; }

  .hero { padding: 32px 20px; margin-bottom: 20px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 13px; }

  .goods-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .goods-card-img, .goods-card-noimg { height: 150px; }
  .goods-card-body { padding: 10px 12px; }
  .goods-card-title { font-size: 13px; }
  .goods-card-price { font-size: 17px; }

  .main { padding: 12px; padding-bottom: calc(12px + var(--mobile-nav-height)); }
  .section-title { font-size: 16px; padding-left: 12px; }

  .detail-info h1 { font-size: 18px; }
  .detail-price { font-size: 24px; }
  .detail-images img { max-height: 350px; }
  .detail-actions { padding: 10px 12px; }

  .form-card { margin: 20px 12px; padding: 20px; }
  .form-card.wide { margin: 20px 12px; }

  .mobile-nav { display: flex; }
  .main { padding-bottom: calc(20px + var(--mobile-nav-height)); }
  .detail-actions { bottom: var(--mobile-nav-height); }

  .cat { min-width: 52px; }
  .cat-icon { width: 46px; height: 46px; font-size: 20px; }
  .cat-name { font-size: 11px; }

  .profile-layout { flex-direction: column; }
  .profile-sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 0 0 8px 0;
  }
  .profile-sidebar .nav-item {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 13px;
  }
  .user-info-header { flex-direction: column; text-align: center; }
  .user-info-header .stats { margin-left: 0; }

  .tabs { gap: 0; }
  .tab { padding: 10px 14px; font-size: 13px; }
  .upload-preview .item { width: 80px; height: 80px; }
}

/* Tablet 769-1024px */
@media (min-width: 769px) and (max-width: 1024px) {
  .goods-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop >= 1024px */
@media (min-width: 1024px) {
  .goods-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Wide >= 1400px */
@media (min-width: 1400px) {
  .goods-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
