* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f5f6fa; color: #2d3436; min-height: 100vh; font-size: 16px; line-height: 1.6; touch-action: manipulation; -webkit-text-size-adjust: 100%; }

/* ===== 登录页 ===== */
.login-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box { background: #fff; border-radius: 16px; padding: 32px 24px; width: 100%; max-width: 380px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.login-box h1 { text-align: center; font-size: 22px; margin-bottom: 8px; color: #2d3436; }
.login-subtitle { text-align: center; font-size: 13px; color: #b2bec3; margin-bottom: 28px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #636e72; font-weight: 500; }
.form-group input { width: 100%; padding: 14px 16px; border: 1.5px solid #dfe6e9; border-radius: 10px; font-size: 16px; transition: border-color 0.2s; -webkit-appearance: none; text-align: center; letter-spacing: 2px; }
.form-group input:focus { outline: none; border-color: #0984e3; }
.btn-primary { width: 100%; padding: 15px; background: #0984e3; color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; -webkit-appearance: none; touch-action: manipulation; }
.btn-primary:active { background: #0769b8; transform: scale(0.98); }
.btn-primary:disabled { background: #b2bec3; cursor: not-allowed; }
.error-msg { color: #e74c3c; font-size: 13px; margin-top: 6px; text-align: center; display: none; }
.error-msg.show { display: block; }
.login-hint { text-align: center; font-size: 12px; color: #b2bec3; margin-top: 16px; }

/* 自动登录 loading */
.auto-login-overlay { position: fixed; inset: 0; background: #f5f6fa; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 200; transition: opacity 0.3s; }
.auto-login-overlay.hidden { opacity: 0; pointer-events: none; }
.auto-login-overlay .spinner-lg { width: 36px; height: 36px; border: 3px solid #dfe6e9; border-top-color: #0984e3; border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 12px; }
.auto-login-overlay p { font-size: 14px; color: #636e72; }

/* ===== 主界面 ===== */
.app-container { max-width: 600px; margin: 0 auto; min-height: 100vh; background: #f5f6fa; }
.header { background: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e8e8e8; position: sticky; top: 0; z-index: 100; }
.header-user { font-size: 14px; color: #636e72; }
.header-user strong { color: #2d3436; font-weight: 600; }
.btn-logout { padding: 6px 14px; background: #dfe6e9; border: none; border-radius: 8px; font-size: 13px; color: #636e72; cursor: pointer; -webkit-appearance: none; }
.btn-logout:active { background: #b2bec3; }

/* 引导语 */
.guide-bar { background: #fff; padding: 6px 16px; font-size: 12px; color: #b2bec3; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #f0f0f0; }
.guide-bar svg { width: 14px; height: 14px; color: #fdcb6e; flex-shrink: 0; }

/* 累计金额 */
.accum-section { padding: 0 16px 12px; display: none; }
.accum-section.show { display: block; }
.accum-box { background: #fff; border-radius: 10px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; border-left: 3px solid #00b894; }
.accum-label { font-size: 13px; color: #636e72; }
.accum-value { font-size: 18px; font-weight: 700; color: #e74c3c; }
.accum-value .unit { font-size: 13px; font-weight: 400; color: #b2bec3; margin-left: 2px; }

/* 号码分组 */
.num-groups { margin-top: 4px; }
.num-group-item { display: inline-block; margin-right: 10px; margin-bottom: 2px; font-size: 13px; }
.num-group-item .g-target { color: #636e72; font-weight: 500; }
.num-group-item .g-nums { color: #0984e3; }

/* 输入区域 */
.input-section { padding: 12px 16px 16px; background: #fff; margin-bottom: 10px; }
.input-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.char-count { font-size: 12px; color: #b2bec3; }
.char-count.warn { color: #e74c3c; }
.textarea-input { width: 100%; padding: 14px; border: 1.5px solid #dfe6e9; border-radius: 12px; font-size: 16px; resize: none; min-height: 80px; font-family: inherit; line-height: 1.5; -webkit-appearance: none; }
.textarea-input:focus { outline: none; border-color: #0984e3; }
.btn-parse { width: 100%; padding: 16px; background: #00b894; color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 10px; transition: background 0.2s; -webkit-appearance: none; touch-action: manipulation; }
.btn-parse:active { background: #00a383; transform: scale(0.98); }
.btn-parse:disabled { background: #b2bec3; cursor: not-allowed; }
.btn-parse .spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 6px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 结果区域 */
.result-section { padding: 0 16px; display: none; }
.result-section.show { display: block; }
.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-top: 6px; }
.result-count { font-size: 13px; color: #b2bec3; }

/* 订单卡片 */
.order-card { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 2px solid #fdcb6e; transition: all 0.2s; }
.order-card.approved { border-color: #00b894; background: #f0fff9; }
.order-card.rejected { border-color: #e74c3c; background: #fff5f5; opacity: 0.85; }
.order-card.done { border-color: #dfe6e9; }

.order-header-row { display: flex; align-items: flex-start; margin-bottom: 8px; }
.order-index { background: #0984e3; color: #fff; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; margin-right: 8px; }
.order-title { flex: 1; font-size: 15px; font-weight: 600; color: #2d3436; line-height: 1.4; word-break: break-all; }
.order-detail { font-size: 13px; color: #636e72; padding-left: 34px; margin-bottom: 10px; }
.order-detail .nums { color: #0984e3; font-weight: 500; word-break: break-all; }
.order-detail .calc { margin-top: 4px; padding-top: 4px; border-top: 1px dashed #e8e8e8; }

/* 操作按钮 */
.order-actions { display: flex; gap: 8px; padding-left: 34px; }
.btn-check, .btn-cross { flex: 1; padding: 10px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; transition: all 0.15s; -webkit-appearance: none; touch-action: manipulation; }
.btn-check { background: #00b894; color: #fff; }
.btn-check:active { background: #00997a; transform: scale(0.97); }
.btn-check.active { background: #00a383; }
.btn-cross { background: #dfe6e9; color: #636e72; }
.btn-cross:active { background: #c8d6d9; transform: scale(0.97); }
.btn-cross.active { background: #e74c3c; color: #fff; }

/* 拒绝原因输入 */
.reject-reason-input { display: none; padding-left: 34px; margin-top: 8px; }
.reject-reason-input.show { display: block; }
.reject-reason-input input { width: 100%; padding: 10px 12px; border: 1.5px solid #dfe6e9; border-radius: 8px; font-size: 14px; -webkit-appearance: none; }
.reject-reason-input input:focus { outline: none; border-color: #e74c3c; }

/* 汇总区 */
.summary-section { display: none; padding: 16px; background: #fff; margin: 0 16px 10px; border-radius: 14px; text-align: center; }
.summary-section.show { display: block; }
.summary-total { font-size: 15px; font-weight: 600; color: #2d3436; margin-bottom: 12px; }
.summary-total span { color: #e74c3c; font-size: 22px; }
.btn-copy { width: 100%; padding: 14px; background: #00b894; color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; -webkit-appearance: none; touch-action: manipulation; }
.btn-copy:active { background: #00a383; transform: scale(0.98); }
.btn-copy:disabled { background: #dfe6e9; color: #b2bec3; cursor: not-allowed; }
.hint-text { font-size: 12px; color: #b2bec3; margin-top: 8px; min-height: 18px; }
.saved-badge { display: none; margin-top: 10px; padding: 6px 14px; background: #f0fff9; color: #00b894; border-radius: 8px; font-size: 13px; font-weight: 500; }
.saved-badge.show { display: inline-block; }

/* 复制预览 */
.copy-preview-section { display: none; padding: 0 16px 16px; }
.copy-preview-section.show { display: block; }
.copy-preview-box { background: #fff; border-radius: 10px; padding: 14px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; color: #2d3436; border: 1px solid #e8e8e8; }

/* ===== Loading 底部小卡片 ===== */
.loading-card {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: #fff;
    border-radius: 20px;
    padding: 14px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    align-items: center;
    gap: 12px;
}
.loading-card.show {
    display: flex;
    animation: cardPopIn 0.35s ease-out;
}
@keyframes cardPopIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.92); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.loading-card-text {
    font-size: 14px;
    font-weight: 500;
    color: #636e72;
    white-space: nowrap;
    min-width: 150px;
    text-align: center;
}

/* 迷你可爱动画 */
.loading-cute-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* 小脸 48px */
.loading-face-mini {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    border-radius: 50%;
    position: relative;
    animation: faceBounceMini 1.6s ease-in-out infinite;
    box-shadow: 0 3px 12px rgba(9, 132, 227, 0.25);
}
@keyframes faceBounceMini {
    0%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-8px) scale(1.05); }
    60% { transform: translateY(3px) scale(0.96); }
}

/* 眼睛 */
.loading-eyes-mini {
    position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 10px;
}
.loading-eyes-mini span {
    width: 6px; height: 6px; background: #fff; border-radius: 50%;
    animation: eyeBlinkMini 2.4s ease-in-out infinite;
}
.loading-eyes-mini span:nth-child(2) { animation-delay: 0.1s; }
@keyframes eyeBlinkMini {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.15); }
}

/* 腮红 */
.loading-cheeks-mini {
    position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 20px;
}
.loading-cheeks-mini span {
    width: 7px; height: 5px; background: rgba(255,200,200,0.55); border-radius: 50%;
}

/* 嘴巴 */
.loading-mouth-mini {
    position: absolute; bottom: 11px; left: 50%; transform: translateX(-50%);
    width: 10px; height: 5px; background: #fff; border-radius: 0 0 10px 10px;
}

/* 三个跳动圆点 */
.loading-dots-mini { display: flex; gap: 4px; }
.loading-dots-mini span {
    width: 5px; height: 5px; background: #b2bec3; border-radius: 50%;
    animation: dotJumpMini 1.2s ease-in-out infinite;
}
.loading-dots-mini span:nth-child(1) { animation-delay: 0s; }
.loading-dots-mini span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots-mini span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotJumpMini {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-6px); opacity: 1; background: #74b9ff; }
}

/* ===== 管理后台 ===== */
.admin-container { max-width: 800px; margin: 0 auto; padding: 16px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.admin-header h2 { font-size: 18px; }
.btn-back { padding: 8px 16px; background: #dfe6e9; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; -webkit-appearance: none; }

.tabs { display: flex; gap: 0; border-bottom: 2px solid #e8e8e8; margin-bottom: 16px; }
.tab-btn { padding: 10px 20px; background: none; border: none; font-size: 14px; color: #b2bec3; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; -webkit-appearance: none; }
.tab-btn.active { color: #0984e3; border-bottom-color: #0984e3; font-weight: 600; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.user-list { background: #fff; border-radius: 10px; overflow: hidden; }
.user-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f5f5f5; }
.user-item:last-child { border-bottom: none; }
.user-info { font-size: 14px; }
.btn-danger { padding: 6px 12px; background: #e74c3c; color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; -webkit-appearance: none; }

.model-list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #fff; border-radius: 10px; margin-bottom: 8px; }
.model-badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #00b894; color: #fff; margin-left: 6px; }
.model-badge.default { background: #fdcb6e; color: #2d3436; }
.btn-small { padding: 6px 12px; background: #0984e3; color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; -webkit-appearance: none; }

.panel { display: none; background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.panel.show { display: block; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 14px; color: #636e72; font-weight: 500; }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: 10px 12px; border: 1.5px solid #dfe6e9; border-radius: 8px; font-size: 14px; -webkit-appearance: none; font-family: inherit; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: #0984e3; }
.form-row textarea { min-height: 200px; line-height: 1.6; resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn-success { padding: 10px 20px; background: #00b894; color: #fff; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; -webkit-appearance: none; }
.btn-cancel { padding: 10px 20px; background: #dfe6e9; color: #636e72; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; -webkit-appearance: none; }

/* 开关 */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #dfe6e9; border-radius: 24px; transition: 0.2s; }
.toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.toggle-switch input:checked + .toggle-slider { background: #00b894; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

.empty-state { text-align: center; padding: 40px; color: #b2bec3; font-size: 14px; }
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(0,0,0,0.75); color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 14px; opacity: 0; transition: all 0.3s; pointer-events: none; z-index: 3000; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.section-title { font-size: 14px; font-weight: 600; color: #636e72; margin: 12px 16px 6px; }

@media (max-width: 480px) {
    .login-box { padding: 28px 20px; }
    .order-actions { padding-left: 0; margin-top: 10px; }
    .reject-reason-input { padding-left: 0; }
    .order-detail { padding-left: 0; margin-top: 6px; }
}
