This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
carwash_order/style.css
T
wsh5485 8ffad04df3 feat: 重构洗车预约系统,新增套餐管理和时间段选择功能
- 新增套餐管理模块,支持套餐的增删改查
- 重构预约表结构,支持时间段选择和套餐关联
- 实现日历视图和时间段网格选择界面
- 更新数据库结构,添加套餐表和相关字段
- 优化移动端体验,增强触摸交互
- 更新文档和样式,匹配新功能
2025-11-19 01:06:35 +08:00

793 lines
14 KiB
CSS

/* style.css - 样式文件 */
body {
font-family: 'Microsoft YaHei', Arial, sans-serif;
line-height: 1.6;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
text-align: center;
padding: 2rem 0;
margin-bottom: 2rem;
border-radius: 8px;
}
h1 {
margin: 0;
font-size: 2.5em;
}
.booking-form {
background: white;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
margin-bottom: 2rem;
}
.form-group {
margin-bottom: 1.5rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
font-weight: bold;
color: #333;
}
.form-group input,
.form-group select,
.form-group textarea {
width: 100%;
padding: 0.75rem;
border: 2px solid #ddd;
border-radius: 4px;
font-size: 1rem;
transition: border-color 0.3s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
outline: none;
border-color: #667eea;
}
.btn {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 1rem 2rem;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
transition: transform 0.2s;
}
.btn:hover {
transform: translateY(-2px);
}
.bookings-list {
background: white;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.booking-item {
border: 1px solid #ddd;
padding: 1rem;
margin-bottom: 1rem;
border-radius: 4px;
background: #f9f9f9;
}
.booking-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.5rem;
}
.status {
padding: 0.25rem 0.75rem;
border-radius: 20px;
font-size: 0.8rem;
font-weight: bold;
}
.status.pending {
background: #fff3cd;
color: #856404;
}
.status.confirmed {
background: #d4edda;
color: #155724;
}
.status.completed {
background: #d1ecf1;
color: #0c5460;
}
.status.cancelled {
background: #f8d7da;
color: #721c24;
}
.success-message {
background: #d4edda;
color: #155724;
padding: 1rem;
border-radius: 4px;
margin-bottom: 1rem;
border: 1px solid #c3e6cb;
}
nav {
text-align: center;
margin-bottom: 2rem;
}
nav a {
display: inline-block;
margin: 0 1rem;
padding: 0.5rem 1rem;
text-decoration: none;
color: #667eea;
border: 2px solid #667eea;
border-radius: 4px;
transition: all 0.3s;
}
nav a:hover {
background: #667eea;
color: white;
}
/* 新增:预约页面布局 */
.booking-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
margin-top: 2rem;
}
.calendar-section, .booking-form-section {
background: var(--card-background);
padding: 1.5rem;
border-radius: 12px;
box-shadow: var(--card-shadow);
}
/* 日历样式 */
.calendar {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 1rem;
margin-bottom: 2rem;
}
.calendar-day {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 1rem;
border-radius: 12px;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.calendar-day::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
transition: left 0.5s;
}
.calendar-day:hover::before {
left: 100%;
}
.calendar-day.today {
box-shadow: 0 0 0 3px var(--primary-color);
transform: scale(1.05);
}
.calendar-day.selected {
background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
transform: scale(1.08);
}
.calendar-day.available {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.calendar-day.busy {
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.calendar-day.full {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.day-number {
font-size: 1.5rem;
font-weight: bold;
margin-bottom: 0.5rem;
}
.day-week {
font-size: 0.9rem;
opacity: 0.9;
margin-bottom: 0.3rem;
}
.day-status {
font-size: 0.8rem;
opacity: 0.8;
}
.booking-count {
font-size: 0.75rem;
margin-top: 0.5rem;
opacity: 0.9;
}
/* 时间段选择 */
.time-slots {
margin-top: 2rem;
}
.quick-duration {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 1.5rem;
flex-wrap: wrap;
}
.quick-duration span {
font-weight: 600;
color: var(--text-color);
white-space: nowrap;
}
.duration-btn {
padding: 0.5rem 1rem;
border: 2px solid var(--primary-color);
background: white;
color: var(--primary-color);
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 0.9rem;
white-space: nowrap;
}
.duration-btn:hover {
background: var(--primary-color);
color: white;
transform: translateY(-2px);
}
.duration-btn.selected {
background: var(--primary-color);
color: white;
box-shadow: 0 4px 12px rgba(52, 144, 220, 0.3);
}
.time-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
gap: 0.8rem;
}
.time-slot {
padding: 1rem 0.5rem;
text-align: center;
border: 2px solid #e0e0e0;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 0.9rem;
font-weight: 500;
background: white;
}
.time-slot.available:hover {
border-color: var(--primary-color);
color: var(--primary-color);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(52, 144, 220, 0.2);
}
.time-slot.selected {
background: var(--primary-color);
color: white;
border-color: var(--primary-color);
box-shadow: 0 4px 12px rgba(52, 144, 220, 0.3);
}
.time-slot.booked {
background: #f8f9fa;
color: #6c757d;
border-color: #dee2e6;
cursor: not-allowed;
text-decoration: line-through;
}
.time-slot.past {
background: #f8f9fa;
color: #adb5bd;
border-color: #e9ecef;
cursor: not-allowed;
}
/* 套餐信息展示 */
.package-info {
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
padding: 1.5rem;
border-radius: 12px;
margin-top: 1rem;
border-left: 4px solid var(--primary-color);
}
.package-details h4 {
margin: 0 0 0.5rem 0;
color: var(--text-color);
font-size: 1.2rem;
}
.package-details p {
margin: 0 0 1rem 0;
color: #666;
font-size: 0.95rem;
}
.package-meta {
display: flex;
gap: 1rem;
margin-bottom: 1rem;
flex-wrap: wrap;
}
.package-meta span {
background: white;
padding: 0.3rem 0.8rem;
border-radius: 20px;
font-size: 0.9rem;
font-weight: 600;
color: var(--primary-color);
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
#packageServices {
font-size: 0.9rem;
color: #555;
line-height: 1.5;
}
/* 模态框 */
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
}
.modal-content {
background: white;
border-radius: 12px;
max-width: 500px;
width: 100%;
max-height: 80vh;
overflow-y: auto;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5rem;
border-bottom: 1px solid #eee;
}
.modal-header h3 {
margin: 0;
color: var(--text-color);
}
.close {
font-size: 2rem;
cursor: pointer;
color: #999;
transition: color 0.3s ease;
}
.close:hover {
color: #333;
}
.modal-body {
padding: 1.5rem;
}
/* 表单操作按钮 */
.form-actions {
display: flex;
gap: 1rem;
margin-top: 2rem;
}
.form-actions .btn {
flex: 1;
}
.btn-primary {
background: var(--primary-color);
color: white;
border: none;
transition: all 0.3s ease;
}
.btn-primary:hover:not(:disabled) {
background: var(--primary-hover);
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(52, 144, 220, 0.3);
}
.btn-primary:disabled {
background: #ccc;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
.btn-sm {
padding: 0.5rem 1rem;
font-size: 0.9rem;
}
/* 移动端响应式设计 */
/* 平板设备优化 */
@media (max-width: 768px) {
body { font-size: 14px; }
.container {
padding: 15px;
max-width: 100%;
}
.booking-container {
grid-template-columns: 1fr;
gap: 1.5rem;
}
.calendar {
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
gap: 0.8rem;
}
.calendar-day {
padding: 0.8rem;
}
.day-number {
font-size: 1.3rem;
}
.quick-duration {
justify-content: center;
}
.time-grid {
grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
gap: 0.6rem;
}
.time-slot {
padding: 0.8rem 0.4rem;
font-size: 0.8rem;
}
.package-meta {
justify-content: center;
}
.form-actions {
flex-direction: column;
}
header {
padding: 1.5rem 0;
margin-bottom: 1.5rem;
}
h1 {
font-size: 2em;
}
.booking-form,
.bookings-list {
padding: 1.5rem;
}
.booking-header {
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}
.status {
align-self: flex-end;
}
.form-group {
margin-bottom: 1rem;
}
input, select, textarea {
padding: 12px;
font-size: 16px; /* 防止iOS缩放 */
}
.btn {
padding: 15px 25px;
min-height: 48px; /* 触摸友好的最小尺寸 */
font-size: 16px;
}
nav a {
margin: 0.5rem;
padding: 0.75rem 1rem;
}
}
/* 手机设备优化 */
@media (max-width: 480px) {
.container {
padding: 10px;
}
header {
padding: 1rem 0;
margin-bottom: 1rem;
border-radius: 0;
}
h1 {
font-size: 1.8em;
}
.booking-form,
.bookings-list {
padding: 1rem;
border-radius: 0;
box-shadow: none;
margin-bottom: 1rem;
}
.form-row {
flex-direction: column;
}
.form-row .form-group {
flex: none;
width: 100%;
}
.calendar {
grid-template-columns: repeat(2, 1fr);
}
.duration-btn {
padding: 0.4rem 0.8rem;
font-size: 0.8rem;
}
.modal-content {
margin: 1rem;
}
.form-group {
margin-bottom: 1rem;
}
.form-group input,
.form-group select,
.form-group textarea {
padding: 1rem;
font-size: 16px; /* 防止iOS缩放 */
border-radius: 6px;
}
.btn {
padding: 1rem 2rem;
font-size: 16px;
width: 100%;
margin-bottom: 0.5rem;
}
.booking-item {
padding: 0.75rem;
}
.booking-item div {
margin-bottom: 0.5rem;
}
/* 预约信息网格改为单列布局 */
.booking-item > div[style*="grid"] {
grid-template-columns: 1fr !important;
gap: 0.5rem !important;
}
nav {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
nav a {
margin: 0;
padding: 1rem;
text-align: center;
}
.success-message {
padding: 0.75rem;
margin-bottom: 1rem;
border-radius: 0;
}
}
/* 小屏幕手机优化 */
@media (max-width: 360px) {
.container {
padding: 5px;
}
header {
padding: 0.75rem 0;
}
h1 {
font-size: 1.5em;
}
.booking-form,
.bookings-list {
padding: 0.75rem;
}
.calendar {
grid-template-columns: 1fr;
}
.quick-duration {
flex-direction: column;
align-items: stretch;
}
.btn {
width: 100%;
margin-bottom: 10px;
}
.calendar-day {
padding: 0.6rem;
}
.time-grid {
grid-template-columns: repeat(2, 1fr);
}
.form-group input,
.form-group select,
.form-group textarea {
padding: 0.875rem;
}
.btn {
padding: 0.875rem 1.5rem;
}
}
/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
.btn {
min-height: 44px; /* Apple人机界面指南建议的最小触摸目标 */
}
.form-group input,
.form-group select,
.form-group textarea {
min-height: 44px;
}
nav a {
min-height: 44px;
display: flex;
align-items: center;
justify-content: center;
}
}
/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
.container {
padding: 10px;
}
header {
padding: 0.75rem 0;
margin-bottom: 1rem;
}
h1 {
font-size: 1.5em;
}
.booking-form,
.bookings-list {
padding: 1rem;
}
}
/* 打印样式 */
@media print {
body {
background: white;
}
.container {
max-width: none;
padding: 0;
}
header {
background: none;
color: black;
border-bottom: 2px solid #333;
}
.btn,
nav {
display: none;
}
.booking-form,
.bookings-list {
box-shadow: none;
border: 1px solid #333;
}
}