.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.flash {
    padding: 10px;
    margin: 10px 0;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.add-form {
    margin: 20px 0;
}

.add-form input {
    padding: 8px;
    margin-right: 10px;
}

.product-card {
    border: 1px solid #ddd;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.delete-btn {
    color: red;
    text-decoration: none;
}

.delete-btn:hover {
    text-decoration: underline;
}

.system-info {
    background-color: #f8f9fa;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

.last-check {
    font-size: 0.8em;
    color: #666;
}

.price-change {
    color: #dc3545;
}

.product-card.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.status {
    font-weight: bold;
}

.status.error {
    color: #dc3545;
}

/* 自定義樣式補充 */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
}

.card-body {
    position: relative;
}

.system-info {
    color: #666;
    text-align: center;
    font-size: 0.9em;
}

.price-change {
    color: #dc3545;
}

/* 動畫效果 */
.card {
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

/* 響應式調整 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
}

/* 表格相關樣式 */
.table {
    width: 100%;
    margin-bottom: 0;
    table-layout: fixed;
}

.table th:nth-child(1),
.table td:nth-child(1) {
    width: 300px;
}

.table th:nth-child(2),
.table td:nth-child(2) {
    width: 100px;
}

.table th:nth-child(3),
.table td:nth-child(3),
.table th:nth-child(4),
.table td:nth-child(4) {
    width: 100px;
}

.table th:nth-child(5),
.table td:nth-child(5) {
    width: 200px;
}

.table th:nth-child(6),
.table td:nth-child(6) {
    width: 80px;
}

.table th:nth-child(7),
.table td:nth-child(7) {
    width: 150px;
}

.table th:nth-child(8),
.table td:nth-child(8) {
    width: 80px;
}

.table td:nth-child(1) .text-truncate,
.table td:nth-child(5) .text-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
    min-height: 2.5em;
    line-height: 1.25;
}

.table td:not(:nth-child(1)):not(:nth-child(5)) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1200px) {
    .table th:nth-child(1),
    .table td:nth-child(1) {
        width: 250px;
    }
    
    .table th:nth-child(5),
    .table td:nth-child(5) {
        width: 150px;
    }
}

@media (max-width: 992px) {
    .table th:nth-child(1),
    .table td:nth-child(1) {
        width: 200px;
    }
    
    .table th:nth-child(5),
    .table td:nth-child(5) {
        width: 120px;
    }
}

@media (max-width: 768px) {
    .table th:nth-child(1),
    .table td:nth-child(1) {
        width: 150px;
    }
    
    .table th:nth-child(5),
    .table td:nth-child(5) {
        width: 100px;
    }
}

.table-responsive {
    background:
        linear-gradient(to right, white 30%, rgba(255,255,255,0)),
        linear-gradient(to right, rgba(255,255,255,0), white 70%) 0 100%,
        radial-gradient(farthest-side at 0% 50%, rgba(0,0,0,.2), rgba(0,0,0,0)),
        radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-position: 0 0, 100%, 0 0, 100%;
    background-attachment: local, local, scroll, scroll;
}

/* 手機版卡片樣式 */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 1rem;
        line-height: 1.4;
        word-break: break-word;
    }

    .card-body {
        padding: 1rem;
    }

    .text-muted {
        font-size: 0.8rem;
    }

    /* 移除卡片懸浮效果 */
    .card:hover {
        transform: none;
    }

    /* 調整按鈕大小 */
    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }

    /* 價格顯示 */
    .fw-bold {
        font-size: 1.1rem;
    }

    /* 狀態標籤 */
    .badge {
        font-size: 0.8rem;
        padding: 0.4em 0.8em;
    }

    /* 商品描述 */
    .card-body span {
        font-size: 0.9rem;
        line-height: 1.4;
        display: block;
        word-break: break-word;
    }

    /* 分隔線 */
    .card-body > div:not(:last-child) {
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid rgba(0,0,0,.1);
    }

    /* 系統狀態卡片 */
    .system-info {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    /* 新增表單 */
    .input-group {
        flex-wrap: nowrap;
    }

    .input-group .form-control {
        min-width: 0;
    }

    .input-group .btn {
        white-space: nowrap;
    }
}

/* 確保表格在平板以上裝置正常顯示 */
@media (min-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* 重新整理按鈕和倒數計時器樣式 */
#refresh-countdown {
    font-size: 0.9rem;
    opacity: 0.9;
}

#manual-refresh {
    transition: opacity 0.2s;
}

#manual-refresh:hover {
    opacity: 0.8;
}

/* 響應式調整 */
@media (max-width: 768px) {
    #refresh-countdown {
        font-size: 0.8rem;
    }
    
    #manual-refresh {
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
    }
}
 