* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; background: #f6f7fb; color: #1f2430; }
a { color: inherit; text-decoration: none; }

.topbar { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid #eceef3;
  display: flex; align-items: center; justify-content: space-between; padding: 14px 32px; }
.logo { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.logo span { color: #4f6ef7; }
.topbar nav a { margin-left: 20px; color: #6b7280; font-size: 14px; }
.topbar nav a:hover { color: #4f6ef7; }
.cart-btn { background: #4f6ef7; color: #fff; border: none; border-radius: 20px; padding: 8px 18px;
  font-size: 14px; cursor: pointer; }

.hero { background: linear-gradient(120deg, #4f6ef7, #8b5cf6); color: #fff; padding: 56px 32px; text-align: center; }
.hero h1 { font-size: 34px; margin-bottom: 10px; }
.hero p { opacity: .85; }

.container { max-width: 1100px; margin: 0 auto; padding: 32px; }
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(30,40,80,.06);
  transition: transform .15s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); }
.card .thumb { height: 160px; display: flex; align-items: center; justify-content: center; font-size: 56px; }
.card .body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card .cat { font-size: 12px; color: #9aa1b2; }
.card .name { font-weight: 700; margin: 4px 0 6px; }
.card .desc { font-size: 13px; color: #6b7280; flex: 1; }
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.price { color: #e0533d; font-weight: 800; font-size: 18px; }
.btn { background: #4f6ef7; color: #fff; border: none; border-radius: 8px; padding: 8px 14px;
  font-size: 13px; cursor: pointer; }
.btn.ghost { background: #eef1fd; color: #4f6ef7; }
.btn.danger { background: #fdecea; color: #d33; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 购物车抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(20,24,40,.4); display: none; z-index: 20; }
.drawer { position: fixed; top: 0; right: -420px; width: 420px; max-width: 92vw; height: 100vh; background: #fff;
  z-index: 21; transition: right .25s ease; display: flex; flex-direction: column; }
.drawer.open { right: 0; }
.drawer-mask.show { display: block; }
.drawer h3 { padding: 18px 20px; border-bottom: 1px solid #eceef3; }
.drawer .items { flex: 1; overflow: auto; padding: 12px 20px; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f2f3f7; }
.cart-item .mini { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 24px; }
.cart-item .info { flex: 1; }
.cart-item .info .n { font-size: 14px; font-weight: 600; }
.cart-item .info .p { font-size: 13px; color: #e0533d; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 22px; height: 22px; border: 1px solid #e3e6ee; background: #fff; border-radius: 6px; cursor: pointer; }
.drawer .footer { padding: 16px 20px; border-top: 1px solid #eceef3; }
.drawer .total { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; }
#paypal-area { margin-top: 8px; }
.notice { font-size: 13px; color: #9aa1b2; text-align: center; padding: 10px 0; }
.notice.ok { color: #1a9c6b; }
.notice.err { color: #d33; }

/* 管理后台 */
.admin-layout { max-width: 1100px; margin: 0 auto; padding: 32px; }
.panel { background: #fff; border-radius: 14px; padding: 24px; margin-bottom: 24px; box-shadow: 0 2px 10px rgba(30,40,80,.06); }
.panel h2 { font-size: 17px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #f0f1f6; }
th { color: #9aa1b2; font-weight: 600; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.badge.COMPLETED { background: #e6f7ef; color: #1a9c6b; }
.badge.PENDING, .badge.CREATED, .badge.APPROVED { background: #fff7e6; color: #d9930d; }
.badge.FAILED, .badge.CANCELED { background: #fdecea; color: #d33; }
form .field { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
input, select { border: 1px solid #e3e6ee; border-radius: 8px; padding: 8px 10px; font-size: 13px; flex: 1; min-width: 120px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-on { background: #1a9c6b; } .dot-off { background: #c3c8d4; }
footer { text-align: center; color: #9aa1b2; font-size: 13px; padding: 40px 0 24px; }
