/* 
 * RUYI HOTPOT BARCELONA - 专业小票打印样式
 * 针对80mm热敏打印机优化
 * 适配火锅店业务需求
 */

@media print {
    /* 设置80mm小票页面规格 - 优化热敏打印机 */
    @page {
        size: 80mm auto;
        margin: 1mm 2mm; /* 减少边距以充分利用纸张宽度 */
    }
    
    /* 基础字体设置 - 专为80mm热敏打印机优化 */
    * {
        box-sizing: border-box !important;
        /* 使用更适合热敏打印机的字体 */
        font-family: "Arial", "Liberation Sans", "DejaVu Sans", sans-serif !important;
        color: #000 !important;
        font-weight: 600 !important; /* 适中的字体粗细，避免过粗导致模糊 */
    }
    
    body {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 14pt !important; /* 增大基础字体到14pt */
        line-height: 1.3 !important; /* 增加行距提高可读性 */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-weight: 600 !important;
        /* 热敏打印机优化设置 */
        text-rendering: optimizeLegibility !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
    
    /* 小票容器 */
    .receipt-wrapper {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* ===== 店铺头部信息 ===== */
    .store-header {
        text-align: center !important;
        margin-bottom: 8pt !important;
        border-bottom: 2px solid #000 !important;
        padding-bottom: 4pt !important;
    }
    
    .store-name {
        font-size: 16pt !important; /* 增大店名字体 */
        font-weight: 700 !important; /* 加粗店名 */
        margin: 0 0 4pt 0 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5pt !important; /* 减少字母间距避免过宽 */
    }
    
    .store-address {
        font-size: 11pt !important; /* 增大地址字体 */
        margin: 2pt 0 !important;
        line-height: 1.2 !important;
        font-weight: 600 !important;
    }
    
    .store-phone {
        font-size: 11pt !important; /* 增大电话字体 */
        margin: 2pt 0 !important;
        font-weight: 600 !important;
    }
    
    .store-tax {
        font-size: 11pt !important; /* 增大税号字体 */
        margin: 2pt 0 !important;
        font-weight: 600 !important;
    }
    
    /* ===== 订单信息区域 ===== */
    .order-info {
        margin: 6pt 0 !important;
        font-size: 12pt !important; /* 增大订单信息字体 */
        border-bottom: 1px dashed #000 !important;
        padding-bottom: 4pt !important;
    }
    
    .order-info p, .order-info div {
        margin: 2pt 0 !important; /* 增加间距 */
        line-height: 1.3 !important; /* 增加行距 */
    }
    
    .order-number {
        font-weight: 700 !important;
        font-size: 13pt !important; /* 增大订单号字体 */
    }
    
    .cashier-name {
        font-weight: 600 !important;
        font-size: 12pt !important;
    }
    
    .date-time {
        font-size: 11pt !important; /* 增大日期时间字体 */
    }
    
    /* ===== 商品列表区域 ===== */
    .items-section {
        margin: 6pt 0 !important;
        padding: 0 !important;
    }
    
    .items-header {
        font-weight: 700 !important;
        font-size: 12pt !important; /* 增大商品标题字体 */
        margin-bottom: 4pt !important;
        text-transform: uppercase !important;
        border-bottom: 1px solid #000 !important;
        padding-bottom: 2pt !important;
    }
    
    /* 商品行布局 */
    .item-line {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin: 3pt 0 !important; /* 增加商品行间距 */
        font-size: 12pt !important; /* 增大商品字体 */
        padding: 1pt 0 !important;
    }
    
    .item-desc {
        flex: 1 !important;
        text-align: left !important;
        margin-right: 8pt !important; /* 增加右边距 */
        line-height: 1.3 !important; /* 增加行距 */
    }
    
    .item-quantity {
        font-weight: 700 !important; /* 加粗数量 */
        margin-right: 4pt !important;
        font-size: 12pt !important;
    }
    
    .item-price {
        text-align: right !important;
        font-weight: 700 !important; /* 加粗价格 */
        min-width: 25% !important; /* 增加价格区域宽度 */
        font-size: 12pt !important; /* 增大价格字体 */
    }
    
    /* 欧元符号样式 */
    .currency {
        font-weight: bold !important;
    }
    
    /* ===== 合计区域 ===== */
    .totals-section {
        margin: 8pt 0 !important; /* 增加间距 */
        font-size: 12pt !important; /* 增大合计区域字体 */
        border-top: 1px dashed #000 !important;
        padding-top: 6pt !important;
    }
    
    .total-line {
        display: flex !important;
        justify-content: space-between !important;
        margin: 2pt 0 !important; /* 增加行间距 */
        line-height: 1.4 !important; /* 增加行距 */
    }
    
    .subtotal-line {
        font-size: 12pt !important; /* 增大小计字体 */
        font-weight: 600 !important;
    }
    
    .vat-line {
        font-size: 12pt !important; /* 增大税费字体 */
        color: #000 !important;
        font-weight: 600 !important;
    }
    
    .points-discount-line {
        font-size: 12pt !important; /* 增大折扣字体 */
        color: #d00 !important;
        font-style: italic !important;
        font-weight: 600 !important;
    }
    
    .total-final {
        font-weight: 800 !important; /* 最终总计最粗 */
        font-size: 15pt !important; /* 最大字体用于总计 */
        margin-top: 6pt !important;
        padding-top: 4pt !important;
        border-top: 2px solid #000 !important;
        border-bottom: 2px solid #000 !important;
        padding-bottom: 4pt !important;
    }
    
    /* ===== 页脚感谢语 ===== */
    .receipt-footer {
        text-align: center !important;
        margin-top: 10pt !important;
        font-size: 13pt !important; /* 增大页脚字体 */
        border-top: 1px dashed #000 !important;
        padding-top: 8pt !important;
    }
    
    .thank-you {
        font-weight: 700 !important;
        margin: 0 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3pt !important; /* 减少字母间距 */
        font-size: 13pt !important;
    }
    
    .return-policy {
        font-size: 10pt !important; /* 增大退货政策字体 */
        margin: 0 0 6pt 0 !important;
        font-weight: 600 !important;
        font-style: italic !important;
    }
    
    /* ===== 表格样式（兼容性） ===== */
    table {
        width: 100% !important;
        font-size: 12pt !important; /* 增大表格基础字体 */
        border-collapse: collapse !important;
        margin: 6pt 0 !important; /* 增加表格间距 */
        background-color: transparent !important;
        border: none !important;
    }
    
    table td {
        padding: 3pt 2pt !important; /* 增加单元格内边距 */
        border: none !important;
        vertical-align: top !important;
        font-size: 12pt !important; /* 增大表格字体 */
        line-height: 1.3 !important; /* 增加行距 */
    }
    
    table td:first-child {
        text-align: left !important;
        width: 65% !important; /* 调整列宽比例 */
    }
    
    table td:last-child {
        text-align: right !important;
        width: 35% !important; /* 增加价格列宽度 */
        font-weight: 600 !important; /* 加粗价格 */
        font-size: 12pt !important; /* 统一字体大小 */
    }
    
    /* 合计行特殊样式 */
    table tr.total-row {
        font-weight: 800 !important; /* 表格中的TOTAL最粗 */
        font-size: 15pt !important; /* 增大合计行字体 */
        border-top: 2px solid #000 !important;
        border-bottom: 2px solid #000 !important;
    }
    
    table tr.total-row td {
        padding: 5pt 2pt !important; /* 增加合计行内边距 */
        font-size: 15pt !important; /* 增大合计行字体 */
    }
    
    /* ===== 特殊元素样式 ===== */
    
    /* 分隔线 */
    .separator {
        border-top: 1px dashed #000 !important;
        margin: 6pt 0 !important;
        height: 0 !important;
    }
    
    .separator-solid {
        border-top: 1px solid #000 !important;
        margin: 6pt 0 !important;
        height: 0 !important;
    }
    
    /* 隐藏不需要打印的元素 */
    .no-print {
        display: none !important;
    }
    
    /* 突出显示重要信息 */
    .highlight {
        font-weight: normal !important;
        background-color: transparent !important;
    }
    
    /* 小字说明文本 */
    .small-text {
        font-size: 8.5pt !important;
        line-height: 1.2 !important;
    }
    
    /* ===== 火锅店特殊样式 ===== */
    
    /* 商品类别标识 */
    .product-category {
        font-size: 9pt !important;
        color: #666 !important;
        text-transform: uppercase !important;
    }
    
    /* 辣度标识 */
    .spice-level {
        font-size: 9pt !important;
        font-weight: normal !important;
        color: #d00 !important;
    }
    
    /* 特殊说明 */
    .special-note {
        font-size: 9pt !important;
        font-style: italic !important;
        margin-left: 10pt !important;
    }
    
    /* 打包信息 */
    .takeaway-info {
        text-align: center !important;
        font-size: 8pt !important;
        margin: 6pt 0 !important;
        border: 1px solid #000 !important;
        padding: 4pt !important;
        font-weight: bold !important;
    }
}

/* ===== 屏幕预览样式（可选） ===== */
@media screen {
    .receipt-preview {
        font-family: "Courier New", monospace;
        font-size: 14px;
        max-width: 280px;
        margin: 20px auto;
        padding: 15px;
        background: #fff;
        border: 2px solid #ddd;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    .receipt-preview .store-name {
        font-size: 18px;
        font-weight: bold; /* 屏幕预览中店名保持加粗 */
        text-align: center;
        margin-bottom: 8px;
        border-bottom: 2px solid #000;
        padding-bottom: 5px;
    }
    
    .receipt-preview .item-line {
        display: flex;
        justify-content: space-between;
        margin: 3px 0;
        padding: 2px 0;
    }
    
    .receipt-preview .total-final {
        font-weight: bold; /* 屏幕预览中TOTAL保持加粗 */
        font-size: 16px;
        border-top: 2px solid #000;
        border-bottom: 2px solid #000;
        padding: 5px 0;
        margin: 8px 0;
    }
    
    .receipt-preview .thank-you {
        text-align: center;
        font-weight: normal;
        margin-top: 15px;
        border-top: 1px dashed #000;
        padding-top: 8px;
    }
}