:root {
    --primary-color: #0f172a;     
    --secondary-color: #0ea5e9;   
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-main: #334155;
    --success-color: #10b981;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-main);
    margin: 0;
    padding: 15px;
    display: flex;
    justify-content: center;
}
.app-container {
    width: 100%;
    max-width: 580px;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    box-sizing: border-box;
}
.header {
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.header h1 {
    color: var(--primary-color);
    font-size: 22px;
    margin: 0;
}
.header p {
    color: var(--secondary-color);
    margin: 5px 0 0 0;
    font-weight: 600;
    font-size: 14px;
}
.form-group {
    margin-bottom: 12px;
}
label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}
input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
}
.tax-id-status {
    font-size: 12px;
    font-weight: bold;
    margin-top: 4px;
    color: #64748b;
}
/* 斯柏克 13.5：七大分類不換行、防跑版、流暢滑動橫向控制牆 */
.tab-menu {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto; /* 當按鈕太多時，手機端全自動支援手指優雅橫向滑動，絕不強制換行擠爆！ */
    white-space: nowrap; /* 核心防線：強制所有按鈕鎖在同一排 */
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch; /* 讓 iPhone/Android 滑動手感像絲綢般順暢去油 */
}

/* 微調按鈕內間距，讓字體與圖示在窄螢幕上完美吸入 */
.tab-btn {
    flex: 0 0 auto; /* 核心防線：不允許按鈕被擠壓變形 */
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 8px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}
.btn-add {
    width: 100%;
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
}
.btn-copy {
    width: 100%;
    background: #0284c7;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    display: none;
}
.cart-box {
    margin-top: 15px;
    background: #fdfdfd;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
}
.cart-title {
    font-weight: bold;
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 4px;
}
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 13px;
}
.btn-del {
    background: #ef4444;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}
.result-box {
    margin-top: 15px;
    border: 2px dashed var(--success-color);
    border-radius: 12px;
    padding: 15px;
    background: #f0fdf4;
}
.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}
.result-total {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #bbf7d0;
    font-size: 18px;
    font-weight: bold;
    color: #e11d48;
}
.product-photo-box {
    width: 100%;
    margin-top: 10px;
    text-align: center;
    display: none;
}
.product-photo-img {
    width: 100%;
    max-width: 250px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}
