:root {
    --primary: #0052D9;
    --primary-light: #E1EDFF;
    --bg: #F2F3F5;
    --card-bg: #FFFFFF;
    --text: #1D2129;
    --text-sec: #86909C;
    --border: #E5E6EB;
    --red: #F53F3F;
    --green: #00B42A;
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }

/* Header */
.app-header { background: #fff; padding: 16px; text-align: center; border-bottom: 1px solid var(--border); font-weight: 700; position: sticky; top: 0; z-index: 50; }

.app-content { padding: 12px 12px 120px; }

/* Components */
.card-box { background: white; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }

.info-box { display: flex; gap: 12px; }
.info-box .field { flex: 1; }
.field label { display: block; font-size: 12px; color: var(--text-sec); margin-bottom: 4px; }
select, input { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; font-size: 14px; background: #F9FAFB; }

.action-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.select-container { flex: 1; }
.action-bar select { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 700; }

/* Member Card */
.member-card { background: white; border-radius: var(--radius); padding: 16px; margin-bottom: 16px; transition: transform 0.2s; position: relative; border-left: 5px solid var(--primary); box-shadow: 0 6px 16px rgba(0,0,0,0.04); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.card-top .name { font-size: 18px; font-weight: 700; }
.card-top .tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #F2F3F5; color: var(--text-sec); }
.tag.ext { background: #FFF7E8; color: #FF7D00; }

.card-mid { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px dashed #E5E6EB; border-bottom: 1px dashed #E5E6EB; }
.hour-label { font-size: 14px; font-weight: 500; }
.stepper { display: flex; align-items: center; gap: 16px; }
.step-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--primary); color: var(--primary); background: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.step-val { font-size: 18px; font-weight: 800; min-width: 40px; text-align: center; }

.card-bottom { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; }
.quick-info { font-size: 13px; color: var(--text-sec); }
.btn-detail { font-size: 13px; color: var(--primary); font-weight: 700; background: var(--primary-light); border: none; padding: 6px 12px; border-radius: 20px; }
.btn-del { position: absolute; top: -8px; right: -8px; background: #fff; border: 1px solid var(--border); width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--red); font-size: 16px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }

/* Drawer */
.drawer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer-overlay { width: 100%; height: 100%; background: rgba(0,0,0,0.6); opacity: 0; transition: opacity 0.3s; }
.drawer.open .drawer-overlay { opacity: 1; }
.drawer-content { position: absolute; bottom: -100%; left: 0; width: 100%; height: 85%; background: #fff; border-top-left-radius: 20px; border-top-right-radius: 20px; transition: bottom 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; flex-direction: column; }
.drawer.open .drawer-content { bottom: 0; }

.drawer-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.close-icon { font-size: 28px; color: var(--text-sec); }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 4px; height: 16px; background: var(--primary); border-radius: 2px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 13px; color: var(--text-sec); margin-bottom: 6px; }

.input-with-attr { display: flex; gap: 4px; align-items: center; }
.input-with-attr input { flex: 2; }
.input-with-attr select { flex: 1; font-size: 11px; }

.drawer-footer { padding: 12px 20px 30px; border-top: 1px solid var(--border); }

/* Buttons & Alerts */
.btn { border: none; border-radius: 8px; font-weight: 700; cursor: pointer; transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
.btn:active { transform: scale(0.94); opacity: 0.8; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(0, 82, 217, 0.15); }
.btn-outline { border: 1px solid var(--primary); color: var(--primary); background: transparent; }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.btn-primary:disabled { background: #CFD3DC; box-shadow: none; cursor: not-allowed; }

.bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; padding: 10px 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; box-shadow: 0 -4px 12px rgba(0,0,0,0.06); z-index: 900; }
.summary-info p { font-size: 12px; color: var(--text-sec); }
.summary-info .price { font-size: 18px; font-weight: 800; color: var(--primary); margin-top: 1px; }
.bottom-bar .btn-primary { padding: 0 20px; height: 38px; font-size: 14px; border-radius: 19px; }

.empty-state { text-align: center; padding: 60px 0; color: var(--text-sec); }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1500; animation: fadeIn 0.3s; }
.modal-content { background: #fff; padding: 24px; border-radius: 20px; width: 88%; max-width: 340px; box-shadow: 0 20px 40px rgba(0,0,0,0.15); animation: scaleUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
.modal-content h3 { margin-bottom: 20px; text-align: center; font-size: 18px; font-weight: 700; color: var(--text); }
.modal-content select, .modal-content input { margin-bottom: 16px; border-radius: 10px; background: #f7f8fa; border: 1px solid #eee; height: 42px; }
.modal-btns { display: flex; gap: 12px; margin-top: 10px; }
.modal-btns .btn { flex: 1; height: 42px; border-radius: 21px; font-size: 14px; }
.btn-sec { background: #F2F3F5; color: var(--text-sec); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleUp { 
    from { opacity: 0; transform: scale(0.85); } 
    to { opacity: 1; transform: scale(1); } 
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastSlideUp { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.modal-content { 
    background: #fff; 
    padding: 24px; 
    border-radius: 20px; 
    width: 88%; 
    max-width: 320px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.12); 
    animation: scaleUp 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28); 
    transform-origin: center center;
}

.toast { 
    position: fixed; 
    bottom: 80px; 
    left: 50%; 
    top: auto; /* 关键：取消 top 限制，防止垂直拉长 */
    transform: translateX(-50%); 
    background: rgba(0,0,0,0.85); 
    color: white; 
    padding: 10px 24px; 
    border-radius: 30px; 
    display: none; 
    z-index: 3000; 
    font-size: 14px; 
    font-weight: 500; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.25); 
    pointer-events: none; 
    animation: toastSlideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28), fadeIn 0.3s;
    white-space: nowrap;
    width: auto;
    min-width: 100px;
    height: auto; /* 关键：固定高度为自适应 */
}

/* Custom Select 模拟下拉 */
.custom-select { position: relative; width: 100%; -webkit-user-select: none; user-select: none; }
.select-trigger { 
    height: 32px; border: 1px solid var(--border); border-radius: 6px; 
    padding: 0 10px; display: flex; align-items: center; justify-content: space-between; 
    background: #fff; font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.select-trigger:active { background: #f7f8fa; }
.select-trigger::after { content: '▼'; font-size: 8px; opacity: 0.4; margin-left: 6px; transition: transform 0.2s; }
.custom-select.open .select-trigger::after { transform: rotate(180deg); }
.custom-select.open .select-trigger { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 82, 217, 0.1); }

.select-options { 
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; 
    background: #fff; border: 1px solid var(--border); border-radius: 10px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.12); z-index: 2000; display: none; 
    padding: 4px; animation: slideUp 0.2s ease-out;
}
.custom-select.open .select-options { display: block; }
.option { 
    padding: 10px 12px; font-size: 13px; color: var(--text); border-radius: 6px; 
    transition: all 0.2s; display: flex; justify-content: space-between; align-items: center;
}
.option:active { background: #f0f5ff; color: var(--primary); }
.option.selected { background: #f0f5ff; color: var(--primary); font-weight: 700; }
.option.selected::after { content: '✓'; font-size: 12px; }
.multi-attr-group { margin-top: 10px; border-top: 1px dashed #eee; padding-top: 10px; }
.double-input { display: flex; flex-direction: row; gap: 6px; flex: 1; margin-left: 0; }
.sub-input { flex: 1; display: flex; align-items: center; background: #fff; border-radius: 6px; padding: 0 8px; border: 1px solid var(--border); transition: all 0.2s; }
.sub-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 82, 217, 0.1); }
.sub-input span { font-size: 11px; color: var(--text-sec); margin-right: 6px; white-space: nowrap; font-weight: 500; }
.sub-input input { border: none !important; background: transparent !important; padding: 6px 0 !important; height: 32px !important; font-size: 14px !important; width: 100%; outline: none; }
