/* 星停自助开票 H5 样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 750px;
    margin: 10px auto;
    padding: 0 15px;
}

/* 顶部导航 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

.header .back-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    text-decoration: none;
    font-size: 20px;
}

/* 页面内容 - 使用弹性布局一屏显示 */
.page {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 75px;
    overflow-y: auto;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    padding: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.form-label.required::before {
    content: '*';
    color: #ff4444;
    margin-right: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-outline {
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
}

/* 列表样式 */
.list-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.list-item-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 5px;
}

.list-item-extra {
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
}

/* 订单列表项（可点击） */
.order-item {
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-item:active {
    background-color: #f8f8f8;
}

.order-amount {
    font-size: 18px;
    font-weight: 600;
    color: #ff6b6b;
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-issued {
    background: #d4edda;
    color: #155724;
}

.badge-failed {
    background: #f8d7da;
    color: #721c24;
}

.badge-approved {
    background: #d1ecf1;
    color: #0c5460;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 20px 20px;
    color: #999;
}

.empty-state-icon {
    margin-bottom: 3px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 15px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 底部导航 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    max-width: 750px;
    margin: 0 auto;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    color: #999;
    text-decoration: none;
    font-size: 12px;
}

.tab-item.active {
    color: #667eea;
}

.tab-item-icon {
    font-size: 22px;
    margin-bottom: 3px;
}

/* 提示信息 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    display: none;
}

.toast.show {
    display: block;
}

/* 金额显示 */
.amount {
    font-size: 24px;
    font-weight: 600;
    color: #ff4444;
}

.amount-small {
    font-size: 16px;
}

/* 间距工具类 */
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

/* 文本工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #999; }
.text-primary { color: #667eea; }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }

/* 表单提示文字 */
.form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 订单列表项（带复选框） */
.order-list-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.order-list-item:last-child {
    border-bottom: none;
}

.order-list-item:active {
    background-color: #f8f8f8;
}

.order-list-item.invoiced {
    opacity: 0.6;
}

.order-list-item.invoiced .order-amount {
    color: #999;
}

/* 订单复选框 */
.order-checkbox {
    flex-shrink: 0;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
}

.order-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.order-checkbox.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.order-checkbox.disabled .checkbox-custom {
    background-color: #f0f0f0;
    border-color: #ddd;
}

.checkbox-custom {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 4px;
    background-color: white;
    position: relative;
    transition: all 0.2s;
}

.order-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #667eea;
}

.order-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.order-checkbox.disabled input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #ccc;
    border-color: #999;
}

/* 订单信息区域 */
.order-info {
    flex: 1;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.order-plate {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.order-time {
    font-size: 13px;
    color: #999;
}

.order-extra {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.order-extra .order-amount {
    font-size: 16px;
    font-weight: 600;
    color: #ff6b6b;
}

/* 选中摘要 */
.selected-summary {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.summary-text {
    font-size: 15px;
    color: #667eea;
    text-align: center;
    font-weight: 500;
}

/* 订单列表卡片 - 根据内容自然撑开 */
#order-list-card {
    display: flex;
    flex-direction: column;
}

/* 订单列表容器 - 无滚动条，自然撑开 */
#order-list-container {
    /* 不设置固定高度，由内容撑开 */
}

/* 授权弹窗样式 */
.privacy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
}

.privacy-modal.show {
    display: flex;
    align-items: flex-end;
}

.privacy-modal-content {
    background: white;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    border-radius: 20px 20px 0 0;
    animation: slideUp 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.privacy-modal-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.privacy-modal-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.privacy-modal-body {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.privacy-agreement-content {
    font-size: 14px;
    line-height: 1.8;
    color: #666;
}

.privacy-agreement-content h3 {
    font-size: 16px;
    color: #333;
    margin: 15px 0 10px;
}

.privacy-agreement-content p {
    margin-bottom: 10px;
}

.privacy-agreement-content ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.privacy-agreement-content li {
    margin-bottom: 5px;
}

.privacy-modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.privacy-modal-footer .btn {
    flex: 1;
}

.btn-reject {
    background: #f0f0f0;
    color: #666;
}

.btn-agree {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 未授权遮罩层 */
.no-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 20px;
}

.no-auth-overlay.show {
    display: flex;
}

.no-auth-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.no-auth-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.no-auth-desc {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

.btn-reauth {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}
