* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif; background: #f0f2f5; color: #1a1a1a; line-height: 1.6; }
a { text-decoration: none; color: inherit; }

.top-bar { background: #064e3b; color: rgba(255,255,255,.7); font-size: 13px; padding: 6px 0; }
.top-bar-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; }

.header { background: #fff; border-bottom: 3px solid #059669; }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.logo { font-size: 28px; font-weight: 900; color: #064e3b; letter-spacing: -1px; }
.logo span { color: #059669; }
.search-box { display: flex; border: 2px solid #059669; border-radius: 24px; overflow: hidden; }
.search-box input { border: none; padding: 8px 16px; font-size: 14px; outline: none; width: 260px; }
.search-box button { background: #059669; color: #fff; border: none; padding: 8px 20px; font-size: 14px; cursor: pointer; font-weight: 600; }

.nav-bar { background: #059669; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; gap: 0; }
.nav-inner a { color: #fff; padding: 12px 24px; font-size: 15px; font-weight: 500; transition: background .2s; }
.nav-inner a:hover, .nav-inner a.active { background: rgba(0,0,0,.15); }

.main-wrap { max-width: 1200px; margin: 24px auto; padding: 0 20px; display: grid; grid-template-columns: 220px 1fr; gap: 24px; }

.sidebar { position: sticky; top: 0; align-self: start; }
.sidebar-box { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.sidebar-title { background: #047857; color: #fff; padding: 14px 16px; font-size: 16px; font-weight: 700; }
.sidebar-list a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #f5f5f5; font-size: 14px; color: #444; transition: all .15s; }
.sidebar-list a:hover { background: #ecfdf5; color: #059669; padding-left: 22px; }
.sidebar-list a .icon { font-size: 18px; width: 24px; text-align: center; }

.content { min-width: 0; }

.cat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cat-header h2 { font-size: 22px; font-weight: 800; color: #064e3b; display: flex; align-items: center; gap: 10px; }
.cat-header h2::before { content: ''; display: inline-block; width: 4px; height: 24px; background: #059669; border-radius: 2px; }
.cat-count { font-size: 13px; color: #999; background: #f5f5f5; padding: 4px 12px; border-radius: 20px; }

.list-box { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 32px; overflow: hidden; }
.list-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #f0f0f0; align-items: center; transition: background .15s; }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #f0fdf4; }
.list-item-title { font-size: 16px; font-weight: 600; color: #222; display: block; margin-bottom: 4px; }
.list-item-title:hover { color: #059669; }
.list-item-desc { font-size: 13px; color: #888; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.list-item-right { text-align: right; white-space: nowrap; }
.list-price { color: #059669; font-size: 20px; font-weight: 800; }
.list-date { font-size: 12px; color: #bbb; margin-top: 2px; }

.list-item-tag { display: inline-block; background: #d1fae5; color: #059669; font-size: 11px; padding: 1px 8px; border-radius: 3px; margin-right: 8px; font-weight: 600; }

/* Detail page */
.detail-wrap { max-width: 900px; margin: 24px auto; padding: 0 20px; }
.breadcrumb { font-size: 13px; color: #999; margin-bottom: 16px; }
.breadcrumb a { color: #059669; }
.breadcrumb a:hover { text-decoration: underline; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 16px; padding: 8px 18px; background: #064e3b; color: #fff; border-radius: 6px; font-size: 13px; font-weight: 500; transition: background .2s; }
.back-btn:hover { background: #065f46; }
.detail-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.detail-btns .back-btn { margin-bottom: 0; }
.back-btn-light { background: #e5e7eb; color: #374151; }
.back-btn-light:hover { background: #d1d5db; }

.detail-card { background: #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.06); overflow: hidden; }
.detail-top { padding: 32px; border-bottom: 1px solid #f0f0f0; }
.detail-top h1 { font-size: 26px; font-weight: 800; margin-bottom: 16px; color: #064e3b; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-tags span { background: #d1fae5; color: #059669; padding: 3px 12px; border-radius: 4px; font-size: 13px; font-weight: 600; }
.detail-meta { display: flex; gap: 24px; flex-wrap: wrap; font-size: 14px; color: #888; }
.detail-meta span { display: flex; align-items: center; gap: 4px; }
.detail-meta .price-big { color: #059669; font-size: 28px; font-weight: 800; }

.detail-body { padding: 32px; }
.detail-body h3 { font-size: 18px; color: #064e3b; margin: 28px 0 14px; padding-left: 12px; border-left: 3px solid #059669; }
.detail-body h3:first-child { margin-top: 0; }
.detail-body ul { padding-left: 20px; margin: 12px 0; }
.detail-body li { margin-bottom: 8px; font-size: 15px; color: #444; }
.detail-body p { font-size: 15px; line-height: 1.9; color: #444; margin-bottom: 12px; }

.detail-contact { margin: 0 32px 32px; padding: 24px; background: linear-gradient(135deg, #064e3b, #047857); border-radius: 10px; color: #fff; }
.detail-contact h3 { font-size: 18px; margin-bottom: 14px; color: #6ee7b7; border: none; padding: 0; }
.detail-contact p { font-size: 14px; margin-bottom: 6px; color: rgba(255,255,255,.85); }

.footer { background: #022c20; color: rgba(255,255,255,.5); text-align: center; padding: 36px 20px; margin-top: 48px; font-size: 13px; }
.footer a { color: #6ee7b7; }
.footer p { margin-bottom: 6px; }
.footer .f-brand { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.footer .f-brand span { color: #059669; }

/* Auth / User area */
#user-area { display: flex; align-items: center; gap: 12px; }
.btn-login, .btn-register { padding: 6px 18px; border-radius: 20px; font-size: 14px; font-weight: 500; transition: all .2s; }
.btn-login { color: #059669; border: 1px solid #059669; }
.btn-login:hover { background: #059669; color: #fff; }
.btn-register { background: #059669; color: #fff; }
.btn-register:hover { background: #047857; }
.user-greeting { font-size: 14px; color: #064e3b; font-weight: 600; }
.btn-publish { padding: 6px 16px; background: #ff6b35; color: #fff; border-radius: 20px; font-size: 13px; font-weight: 600; transition: background .2s; }
.btn-publish:hover { background: #e55a25; }
.btn-logout { font-size: 13px; color: #999; cursor: pointer; }
.btn-logout:hover { color: #e53935; }

/* Auth forms */
.auth-wrap { max-width: 440px; margin: 48px auto; padding: 0 20px; }
.auth-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); overflow: hidden; }
.auth-header { background: linear-gradient(135deg, #064e3b, #047857); padding: 32px; text-align: center; color: #fff; }
.auth-header h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.auth-header p { font-size: 14px; opacity: .8; }
.auth-form { padding: 32px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: #333; margin-bottom: 6px; }
.form-group input { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; outline: none; transition: border-color .2s; }
.form-group input:focus { border-color: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,.1); }
.auth-submit { width: 100%; padding: 14px; background: #059669; color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 700; cursor: pointer; transition: background .2s; }
.auth-submit:hover { background: #047857; }
.auth-msg { text-align: center; padding: 10px; font-size: 14px; border-radius: 6px; margin-bottom: 16px; display: none; }
.auth-msg.error { display: block; background: #fef2f2; color: #dc2626; }
.auth-msg.success { display: block; background: #ecfdf5; color: #059669; }
.auth-link { text-align: center; margin-top: 20px; font-size: 14px; color: #888; }
.auth-link a { color: #059669; font-weight: 600; }
.auth-link a:hover { text-decoration: underline; }

/* Publish page */
.publish-wrap { max-width: 700px; margin: 32px auto; padding: 0 20px; }
.publish-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); overflow: hidden; }
.publish-header { background: linear-gradient(135deg, #064e3b, #047857); padding: 28px 32px; color: #fff; }
.publish-header h2 { font-size: 22px; font-weight: 800; }
.publish-header p { font-size: 14px; opacity: .8; margin-top: 4px; }
.publish-form { padding: 32px; }
.form-group select, .form-group textarea { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; outline: none; transition: border-color .2s; font-family: inherit; }
.form-group select:focus, .form-group textarea:focus { border-color: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,.1); }
.form-group textarea { min-height: 140px; resize: vertical; }
.form-group select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center; }

.my-list-wrap { max-width: 900px; margin: 32px auto; padding: 0 20px; }
.my-list-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #f0f0f0; }
.my-list-item:last-child { border-bottom: none; }
.my-list-info h4 { font-size: 16px; color: #222; margin-bottom: 4px; }
.my-list-info p { font-size: 13px; color: #888; }
.my-list-meta { text-align: right; }
.my-list-meta .price { color: #059669; font-weight: 700; font-size: 18px; }
.my-list-meta .date { font-size: 12px; color: #bbb; }

@media (max-width: 768px) {
  .main-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .header-inner { flex-direction: column; gap: 12px; }
  .search-box input { width: 180px; }
  .nav-inner { flex-wrap: wrap; }
  .nav-inner a { padding: 10px 16px; font-size: 14px; }
  .list-item { grid-template-columns: 1fr; }
  .list-item-right { text-align: left; display: flex; gap: 12px; align-items: baseline; }
  .detail-top { padding: 20px; }
  .detail-body { padding: 20px; }
  .detail-contact { margin: 0 20px 20px; }
}
