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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

/* ===== Layout ===== */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  background: #fff;
}

/* ===== Placeholder view styles ===== */
.view-placeholder {
  padding: 32px 16px;
  text-align: center;
}

.view-placeholder h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

/* ===== 拼单列表 ===== */
.list-empty {
  padding: 48px 16px;
  text-align: center;
  color: #999;
  font-size: 1rem;
}

.groupbuy-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.groupbuy-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  transition: background 0.15s ease;
  cursor: pointer;
}

.groupbuy-item:hover {
  background: #fafafa;
}

.groupbuy-item:active {
  background: #f0f0f0;
}

.groupbuy-item:last-child {
  border-bottom: none;
}

.groupbuy-item__product {
  font-size: 1.05rem;
  font-weight: 600;
  color: #333;
}

.groupbuy-item__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #666;
}

.groupbuy-item__price {
  color: #e8590c;
  font-weight: 600;
}

.groupbuy-item__progress {
  color: #888;
  font-size: 0.85rem;
}

.groupbuy-item--completed {
  background: #f0fdf4;
}

.groupbuy-item--completed:hover {
  background: #e6f9ed;
}

.groupbuy-item__badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #16a34a;
  background: #dcfce7;
  border-radius: 4px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Create View ===== */
.create-view {
  padding: 24px 16px;
}

.create-view__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
  color: #222;
}

.create-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.create-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.create-form__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
}

.create-form__input {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease;
}

.create-form__input:focus {
  border-color: #e8590c;
  box-shadow: 0 0 0 2px rgba(232, 89, 12, 0.15);
}

.create-form__submit {
  margin-top: 8px;
  padding: 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #e8590c;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.create-form__submit:hover {
  background: #d9480f;
}

.create-form__submit:active {
  background: #c73e0a;
}

/* ===== Detail View ===== */
.detail-not-found {
  padding: 48px 16px;
  text-align: center;
  color: #999;
  font-size: 1.1rem;
}

.detail-view {
  padding: 24px 16px;
}

.detail-view__back {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: #e8590c;
  text-decoration: none;
  transition: color 0.15s ease;
}

.detail-view__back:hover {
  color: #d9480f;
  text-decoration: underline;
}

.detail-view__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #222;
}

.detail-view__badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #16a34a;
  background: #dcfce7;
  border-radius: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-view__info {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.detail-info-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #eee;
}

.detail-info-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-info-card__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
}

.detail-view__members {
  margin-top: 8px;
}

.detail-view__members-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #444;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.detail-table thead th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #ddd;
  font-weight: 600;
  color: #666;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  color: #333;
}

.detail-table tbody tr:last-child td {
  border-bottom: none;
}

.detail-table__name {
  font-weight: 500;
}

.detail-table__qty {
  color: #666;
}

.detail-table__empty {
  padding: 16px 12px;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
}

/* ===== Join Form ===== */
.detail-join {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.detail-join__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: #444;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.join-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.join-form__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
}

.join-form__input {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease;
}

.join-form__input:focus {
  border-color: #e8590c;
  box-shadow: 0 0 0 2px rgba(232, 89, 12, 0.15);
}

.join-form__submit {
  margin-top: 4px;
  padding: 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #e8590c;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.join-form__submit:hover {
  background: #d9480f;
}

.join-form__submit:active {
  background: #c73e0a;
}
