/* ================================================================
   报单王 - 首页样式
   ================================================================ */

/* ===== 主容器 ===== */
.app {
    background: #f2f4f7;
}
@media (min-width: 500px) {
    body {
        display: flex;
        justify-content: center;
        background: #d0d4dc;
    }
    .app {
        width: 100%;
        max-width: 420px;
        background: #f2f4f7;
        min-height: 100vh;
        box-shadow: 0 0 24px rgba(0,0,0,0.12);
        overflow: hidden;
        position: relative;
    }
}

/* ===== 页面容器 ===== */
.page {
    display: none;
    animation: fadeIn 0.2s ease;
}
.page.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 顶部导航 ===== */
.top-nav {
    background: #ffffff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eef0f3;
}
.top-nav .back {
    font-size: 22px;
    color: #1e293b;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    display: none;
}
.top-nav .back.show {
    display: block;
}
.top-nav .title {
    font-size: 17px;
    font-weight: 600;
    color: #0b1a2f;
}
.top-nav .action {
    font-size: 18px;
    color: #8a99b3;
    cursor: default;
    padding: 0 4px;
}

/* ===== 轮播图 ===== */
.swiper-container {
    width: 100%;
    /*aspect-ratio: 16 / 7;*/
    background: #eef0f3;
    overflow: hidden;
    position: relative;
}
.swiper-container img {
    width: 100%;
    height: 100%;
    /*object-fit: cover;*/
    display: block;
}
.swiper-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.swiper-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: background 0.3s;
}
.swiper-dots span.active {
    background: #ffffff;
    width: 18px;
    border-radius: 4px;
}

/* ===== Tab栏 ===== */
.tab-bar-wrapper {
    background: #ffffff;
    padding: 12px 16px;
    border-bottom: 1px solid #eef0f3;
}
.tab-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #1f1f1f;
    border-radius: 40px;
    padding: 4px 6px;
    border: 1px solid #fff;
}
.tab-bar span {
    flex: 1;
    text-align: center;
    color: #8a8a8a;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}
.tab-bar span.active {
    background: #ffffff;
    color: #0b1a2f;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== 统计栏 ===== */
.stats-bar {
    background: #ffffff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eef0f3;
}
.stats-bar .total {
    font-size: 15px;
    font-weight: 600;
    color: #0b1a2f;
}
.stats-bar .total span {
    color: #1a3a6b;
    font-size: 20px;
}
.stats-bar .time-picker {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    padding: 6px 12px 6px 14px;
    border-radius: 30px;
    cursor: pointer;
    width: 135px;
    height: 32px;
    justify-content: center;
}
.stats-bar .time-picker input[type="date"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.stats-bar .time-picker .date-text {
    color: #ff6b00;
    font-size: 14px;
    font-weight: 500;
    /* letter-spacing: 0.5px; */
    line-height: 1;
}
.stats-bar .time-picker .arrow-icon {
    color: #8a99b3;
    font-size: 14px;
    margin-left: 6px;
    line-height: 1;
    font-weight: 300;
    transform: scaleY(0.6);
}

/* ===== 内容容器 ===== */
.content-container {
    padding: 12px 16px;
}

/* ===== 订单卡片 ===== */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.order-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.order-row1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.order-row1 .left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.order-row1 .model {
    font-size: 16px;
    font-weight: 600;
    color: #0b1a2f;
}
.order-row1 .qty {
    font-size: 14px;
    color: #5e6f8d;
}
.order-row1 .qty span {
    font-weight: 600;
    color: #1a3a6b;
}
.order-row2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #5e6f8d;
}
.order-row2 .sales {
    color: #1e293b;
}
.order-row2 .source {
    background: #f1f4f9;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #4b5a72;
}
.order-row3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}
.order-row3 .dealer {
    font-size: 13px;
    color: #505255;
    font-weight: 500;
}
.order-row3 .time {
    color: #7e8aa0;
    font-size: 12px;
}

/* ===== 胶囊标签 ===== */
.pill-model {
    background: #f1f4f9;
    color: #5e6f8d;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}
.pill-sales {
    background: #e8f5ed;
    color: #1f8b4c;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    margin-right: 6px;
    display: inline-block;
    line-height: 1.4;
    vertical-align: middle;
}
.pill-merchant {
    background: #eef3fc;
    color: #2d6bff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    margin-right: 6px;
    display: inline-block;
    line-height: 1.4;
    vertical-align: middle;
}

/* ===== 榜单卡片 ===== */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rank-item {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rank-item .left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rank-item .rank-num {
    font-size: 16px;
    font-weight: 700;
    color: #7e8aa0;
}
.rank-item .rank-num.top1 { color: #e53e3e; }
.rank-item .rank-num.top2 { color: #ff8c00; }
.rank-item .rank-num.top3 { color: #2d6bff; }
.rank-item .name {
    font-size: 15px;
    font-weight: 600;
    color: #0b1a2f;
}
.rank-item .sub {
    font-size: 13px;
    color: #5e6f8d;
    margin-left: 6px;
}
.rank-item .value {
    font-size: 15px;
    font-weight: 600;
    color: #0b1a2f;
}
.rank-item .value span {
    font-size: 13px;
    font-weight: 400;
    color: #7e8aa0;
    margin-left: 2px;
}

/* ===== 订单操作按钮 ===== */
.order-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f2f5;
}
.order-actions .btn-action {
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}
.order-actions .btn-action:active {
    transform: scale(0.95);
}
.order-actions .btn-edit {
    background: #eef3fc;
    color: #2d6bff;
}
.order-actions .btn-delete {
    background: #fce8e8;
    color: #e53e3e;
}

/* ===== 个人中心 ===== */
.profile-card {
    background: #ffffff;
    margin: 16px 16px 12px;
    border-radius: 16px;
    padding: 20px 16px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 14px;
}
.profile-card .avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a6b, #2d6bff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    flex-shrink: 0;
}
.profile-card .info .name {
    font-size: 18px;
    font-weight: 600;
    color: #0b1a2f;
}
.profile-card .info .sub {
    font-size: 13px;
    color: #8a99b3;
    margin-top: 2px;
}

.info-card {
    background: #ffffff;
    margin: 0 16px 12px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f2f5;
    min-height: 48px;
    transition: background 0.1s;
}
.info-item:last-child {
    border-bottom: none;
}
.info-item .label {
    font-size: 15px;
    color: #1e293b;
    font-weight: 500;
    min-width: 68px;
}
.info-item .value {
    font-size: 15px;
    color: #1e293b;
    text-align: right;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.info-item .value .edit-icon {
    color: #b0bcca;
    font-size: 14px;
}
.info-item .value .arrow-icon {
    color: #c0c8d6;
    font-size: 16px;
}
.info-item.clickable {
    cursor: pointer;
}
.info-item.clickable:active {
    background: #f7f9fc;
}

.menu-card {
    background: #ffffff;
    margin: 0 16px 12px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.1s;
    min-height: 48px;
}
.menu-item:active {
    background: #f7f9fc;
}
.menu-item:last-child {
    border-bottom: none;
}
.menu-item .left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.menu-item .left .icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}
.menu-item .left .text {
    font-size: 15px;
    color: #1e293b;
}
.menu-item .right {
    color: #c0c8d6;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.menu-item .right .status {
    color: #1f8b4c;
    font-weight: 500;
    font-size: 14px;
}

.btn-home-wrap {
    padding: 8px 16px 0;
}
.btn-home {
    display: block;
    width: 100%;
    padding: 14px 0;
    background: #1a3a6b;
    border-radius: 30px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    box-shadow: 0 4px 14px rgba(26, 58, 107, 0.15);
}
.btn-home:active {
    transform: scale(0.97);
}

/* ===== 报单表单 ===== */
.form-card {
    background: #ffffff;
    border-radius: 16px;
    margin: 16px 16px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    overflow: hidden;
}
.form-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f2f5;
    min-height: 52px;
    cursor: pointer;
    transition: background 0.1s;
}
.form-item:active {
    background: #f7f9fc;
}
.form-item:last-child {
    border-bottom: none;
    cursor: default;
}
.form-item:last-child:active {
    background: transparent;
}
.form-item .label {
    font-size: 15px;
    color: #1e293b;
    font-weight: 500;
    min-width: 56px;
    flex-shrink: 0;
}
.form-item .value {
    flex: 1;
    text-align: right;
    font-size: 15px;
    color: #b0bcca;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    pointer-events: none;
}
.form-item .value.has-value {
    color: #1e293b;
}
.form-item .value .arrow {
    color: #c0c8d6;
    font-size: 16px;
}

.qty-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    pointer-events: auto;
}
.qty-wrapper .btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e0e4ec;
    background: #f7f9fc;
    color: #4a5a72;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.qty-wrapper .btn:active {
    background: #e8ecf3;
    transform: scale(0.94);
}
.qty-wrapper .num {
    font-size: 18px;
    font-weight: 600;
    color: #0b1a2f;
    min-width: 24px;
    text-align: center;
}

.form-item .value input[type="text"] {
    background: transparent;
    border: none;
    color: #1e293b;
    font-size: 15px;
    text-align: right;
    outline: none;
    width: 140px;
    padding: 4px 0;
    pointer-events: auto;
}
.form-item .value input[type="text"]::placeholder {
    color: #b0bcca;
}

/* ===== 按钮行 ===== */
.btn-row {
    display: flex;
    gap: 12px;
    padding: 0 16px;
    margin-top: 4px;
}
.btn-row .btn {
    flex: 1;
    padding: 14px 0;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.btn-row .btn:active {
    transform: scale(0.97);
}
.btn-row .btn-cancel {
    background: transparent;
    color: #4a5a72;
    border: 1.5px solid #d0d6e0;
}
.btn-row .btn-cancel:active {
    background: #f1f4f9;
    border-color: #b0bcca;
}
.btn-row .btn-submit {
    background: #1a3a6b;
    color: #ffffff;
    border: 1.5px solid #1a3a6b;
    box-shadow: 0 4px 14px rgba(26, 58, 107, 0.15);
}
.btn-row .btn-submit:active {
    box-shadow: 0 2px 8px rgba(26, 58, 107, 0.1);
}

/* ===== 版权 ===== */
.copyright {
    text-align: center;
    padding: 20px 0 8px;
    font-size: 11px;
    color: #b0bcca;
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    padding: 0px 0 3px;
    border-top: 1px solid #e4e8ef;
    z-index: 10;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #8a99b3;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 0;
    background: none;
    border: none;
}
.nav-item.active {
    color: #1a3a6b;
}
.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-item.active .nav-icon {
    stroke: #024efa;
}

.nav-item-special {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #8a99b3;
    font-size: 13px;
    cursor: pointer;
    position: relative;
    top: -18px;
    background: none;
    border: none;
}
.nav-item-special .special-wrap {
    background: #ffffff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04), 0 4px 10px rgba(0,0,0,0.08);
    border: 1px solid #eef0f3;
}
.nav-item-special .icon-special {
    width: 28px;
    height: 28px;
    stroke: #4a4a4a;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-bottom: 2px;
}
.nav-item-special.active .icon-special {
    stroke: #024efa;
}
.nav-item-special.active .special-wrap {
    /* border-color: #1a3a6b; */
}
.nav-item-special.active {
    color: #1a3a6b;
}

/* ===== 选择/编辑弹窗 ===== */
.picker-overlay, .edit-overlay, .confirm-overlay, .edit-profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.confirm-overlay {
    align-items: center;
}
.picker-overlay.show, .edit-overlay.show, .confirm-overlay.show, .edit-profile-overlay.show {
    display: flex;
}

.picker-sheet, .edit-sheet {
    max-width: 420px;
    width: 100%;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 20px 18px 30px;
    animation: slideUp 0.25s ease;
    max-height: 60vh;
    overflow-y: auto;
}
.edit-sheet {
    padding: 24px 20px 30px;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.picker-sheet .picker-header, .edit-sheet .edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 12px;
}
.picker-sheet .picker-header .title, .edit-sheet .edit-header .title {
    font-size: 17px;
    font-weight: 600;
    color: #0b1a2f;
}
.picker-sheet .picker-header .close, .edit-sheet .edit-header .close {
    font-size: 22px;
    color: #8a99b3;
    cursor: pointer;
    padding: 4px 8px;
}

.picker-sheet .picker-item {
    padding: 14px 16px;
    border-bottom: 1px solid #f5f6f9;
    color: #1e293b;
    font-size: 15px;
    cursor: pointer;
    border-radius: 8px;
}
.picker-sheet .picker-item:active {
    background: #f0f2f5;
}
.picker-sheet .picker-item.selected {
    color: #1a3a6b;
    background: #eef3fc;
    font-weight: 500;
}

.edit-sheet .edit-field {
    margin-bottom: 14px;
}
.edit-sheet .edit-field .label {
    font-size: 14px;
    color: #5e6f8d;
    margin-bottom: 4px;
    display: block;
}
.edit-sheet .edit-field .value {
    padding: 12px 14px;
    border: 1px solid #e0e4ec;
    border-radius: 12px;
    font-size: 15px;
    color: #1e293b;
    outline: none;
    background: #f7f9fc;
    width: 100%;
    transition: border 0.15s;
}
.edit-sheet .edit-field .value:focus {
    border-color: #1a3a6b;
    background: #ffffff;
}
.edit-sheet .edit-field .value-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a99b3' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.edit-sheet .edit-btn-row {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}
.edit-sheet .edit-btn-row .btn {
    flex: 1;
    padding: 12px 0;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}
.edit-sheet .edit-btn-row .btn:active {
    transform: scale(0.97);
}
.edit-sheet .edit-btn-row .btn-cancel {
    background: #f1f4f9;
    color: #4a5a72;
}
.edit-sheet .edit-btn-row .btn-confirm {
    background: #1a3a6b;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(26, 58, 107, 0.15);
}

.edit-profile-overlay .edit-sheet .edit-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e4ec;
    border-radius: 12px;
    font-size: 16px;
    color: #1e293b;
    outline: none;
    background: #f7f9fc;
    transition: border 0.15s;
}
.edit-profile-overlay .edit-sheet .edit-input:focus {
    border-color: #1a3a6b;
    background: #ffffff;
}

.confirm-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 24px 20px;
    max-width: 300px;
    width: 90%;
    text-align: center;
    animation: popIn 0.2s ease;
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
.confirm-box .icon { font-size: 36px; margin-bottom: 10px; }
.confirm-box .title { font-size: 17px; font-weight: 600; color: #0b1a2f; margin-bottom: 6px; }
.confirm-box .desc { font-size: 14px; color: #5e6f8d; margin-bottom: 18px; }
.confirm-box .btn-row { display: flex; gap: 12px; }
.confirm-box .btn-row .btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.confirm-box .btn-row .btn:active { transform: scale(0.95); }
.confirm-box .btn-row .btn-cancel { background: #f1f4f9; color: #4a5a72; }
.confirm-box .btn-row .btn-confirm { background: #e53e3e; color: #ffffff; }

/* ===== 响应式 ===== */
@media (max-width: 400px) {
    .top-nav .title { font-size: 16px; }
    .order-card { padding: 12px 14px; }
    .order-row1 .model { font-size: 15px; }
    .profile-card .avatar { width: 48px; height: 48px; font-size: 20px; }
    .info-item { padding: 12px 14px; }
    .form-item { padding: 12px 14px; }
    .btn-row .btn { font-size: 15px; padding: 12px 0; }
    .edit-sheet { padding: 20px 16px 24px; }
    .tab-bar span { font-size: 12px; padding: 6px 0; }
    .stats-bar .time-picker { width: 115px; }
    .stats-bar .time-picker .date-text { font-size: 12px; }
    .qty-wrapper .btn { width: 26px; height: 26px; font-size: 15px; }
    .qty-wrapper .num { font-size: 16px; min-width: 20px; }
}