* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; background: #f5f7fa; color: #333; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 12px; }
h2 { font-size: 20px; margin: 16px 0; }

/* 移动端优先网格 */
.grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 600px) {
    .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 900px) {
    .grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}

/* 卡片样式 */
.card {
    background: #fff; padding: 12px; border-radius: 12px;
    text-align: center; cursor: pointer; transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 2px solid transparent;
}

.card:hover { transform: translateY(-4px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.card.selected { border-color: #1e40af; background: #f0f4ff; }

.card img { width: 100%; aspect-ratio: 1/1; object-fit: contain; border-radius: 6px; background: #f0f2f5; }
.card .name { font-weight: 600; font-size: 15px; margin-top: 8px; display: block; }
.card .price { color: #b91c1c; font-weight: 500; margin-top: 4px; font-size: 14px; }

/* 底部固定栏 */
.footer-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; padding: 12px 16px;
    border-top: 1px solid #eee;
    display: flex; flex-wrap: wrap;
    justify-content: space-between; align-items: center;
    gap: 8px;
    font-size: 14px;
}

@media (min-width: 768px) {
    .footer-bar { position: sticky; bottom: 0; padding: 16px 24px; }
}

input, select, button {
    font-size: 16px;
}

/* 后台表格样式 */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; }
.admin-table th { background: #f1f1f1; }
.admin-table input { width: 100%; padding: 6px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
.admin-btn { padding: 4px 12px; border: none; border-radius: 4px; cursor: pointer; }
.admin-btn-warning { background: #eab308; color: #fff; }
.admin-btn-danger { background: #dc2626; color: #fff; }
.admin-btn-success { background: #16a34a; color: #fff; }
.admin-status { padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.admin-status.on { background: #dcfce7; color: #166534; }
.admin-status.off { background: #fee2e2; color: #991b1b; }

/* 强横屏提示 */
#rotate-message {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: #1e40af; color: #fff;
    flex-direction: column; justify-content: center; align-items: center;
    font-size: 24px; text-align: center; padding: 40px;
}
@media screen and (orientation:portrait) {
    #rotate-message { display: flex !important; }
    body > *:not(#rotate-message) { display: none !important; }
}