/*
 * 广西大酒店发票生成系统样式
 * 作者: VT SEO团队
 * 日期: 2026-01-22
 */

/* 基础样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

/* 输入框聚焦效果 */
input:focus, select:focus, textarea:focus {
    outline: none;
}

/* 服务项目行动画 */
.service-row {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 按钮悬停效果 */
button {
    transition: all 0.2s ease;
}

/* 预览区域阴影 */
#invoice-preview {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 发票容器样式 */
.invoice-container {
    background: white;
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
}

.invoice-container table {
    border-collapse: collapse;
    width: 100%;
}

.invoice-container th,
.invoice-container td {
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
}

.invoice-container th {
    background: #dc2626;
    color: white;
    font-weight: 600;
    text-align: left;
}

.invoice-container tbody tr:nth-child(even) {
    background: #fef2f2;
}

.invoice-container tbody tr:hover {
    background: #fee2e2;
}

/* 汇总表格样式 */
.summary-table td {
    border: none !important;
}

/* 打印样式 - PDF导出时隐藏不需要的元素 */
@media print {
    /* 隐藏所有网页元素 */
    body > *:not(#print-container) {
        display: none !important;
    }

    /* 移除页面边距 */
    @page {
        margin: 0;
        size: A4;
    }

    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    #print-container {
        display: block !important;
        width: 100%;
        margin: 0;
        padding: 20px;
    }

    /* 隐藏导航栏和表单 */
    nav, .print\\:hidden {
        display: none !important;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b91c1c;
}

/* 折叠面板动画 */
.section-content {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    overflow: hidden;
}

/* 表格响应式 */
@media (max-width: 768px) {
    .invoice-container {
        padding: 20px !important;
    }

    .invoice-container table {
        font-size: 12px;
    }

    .invoice-container th,
    .invoice-container td {
        padding: 6px 8px;
    }
}

/* 导出按钮样式 */
.export-btn {
    position: relative;
    overflow: hidden;
}

.export-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.export-btn:active::after {
    width: 200%;
    height: 200%;
}

/* 加载动画 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 提示信息样式 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background: #059669;
    color: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
    z-index: 9999;
}

.toast.error {
    background: #dc2626;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 预览缩放容器 */
.preview-scale-container {
    transform-origin: top left;
}

/* 数字输入框样式 */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 日期选择器美化 */
input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
