body {
    color: white;
    font-family: "Noto Sans SC", serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    padding: 20px;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 440px;
}

.remaining-time-label {
    width: 440px;
    text-align: center;
    font-size: 22px;
    margin-bottom: 4px;
}

.background {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.remaining-time {
    width: 440px;
    text-align: center;
    font-size: 40px;
    margin-top: -4px;
}

table {
    width: 400px;
    border-collapse: collapse;
    margin-bottom: 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
}

td {
    padding: 10px 0;
    vertical-align: middle;
    margin: 5px 0;
}

#giftGroups {
    column-count: 2; /* 你可以根据屏幕大小调整数量 */
    column-gap: 8px; /* 列间距 */
    padding: 8px;
}

.gift-group {
    display: flex;
    width: 100%; /* 保证每项占满列宽 */
    height: 120px;
    margin-bottom: 4px;
    break-inside: avoid; /* 避免被强制断开 */
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    justify-content: space-between; /* 左右自动拉开 */
}

.gift-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
}

.gift-wrapper {
    position: relative;
    display: inline-block;
}

.gift-img {
    width: 70px;
    height: 70px;
}

.gift-badge {
    position: absolute;
    bottom: 5px;
    right: -5px;
    background-color: white;
    color: black;
    font-size: 14px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 9px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    font-family: Arial, sans-serif;
}

.gift-name {
    font-size: 18px;
    font-weight: 600;
}

.values {
    display: block;
    align-self: center;
    font-weight: 400;
    white-space: nowrap;
    margin-right: 10px;
    font-size: 18px;
}
.last-log {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 440px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.inner-log {
    width: calc(100% - 30px); /* 减去左右各 20px，避免文本进入圆角 */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent 0, black 15px, black calc(100% - 15px), transparent 100%);
}

.scroll-text {
    display: inline-block;
    white-space: nowrap;
    transition: transform 0.3s ease;
}

@keyframes scrollText {
    0% {
        transform: translateX(calc(0% + 15px));
    }
    10% {
        transform: translateX(calc(0% + 15px));
    }
    100% {
        transform: translateX(-100%);
    }
}

/* preset controls */
.controls {
    width: 400px;
    margin-top: 20px;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.controls button {
    flex: 1;
    padding: 10px 0;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #007bff;
    color: #fff;
}

.controls button:hover {
    background-color: #0056b3;
}

/* custom controls */
.custom-controls {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 440px;
}

.custom-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
}

.custom-inputs input {
    padding: 8px;
    font-size: 16px;
    width: 95px;
    text-align: start;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.custom-inputs span {
    font-size: 16px;
}

.custom-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.custom-buttons button {
    padding: 8px 12px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #28a745;
    color: #fff;
    height: 40px;
}

.custom-buttons button:hover {
    background-color: #218838;
}

#btnReplace, #btnClear {
    width: 60px;
}

#btnAdd, #btnSubtract, #btnMultiply, #btnDivide {
    width: 40px;
}

/* log */
.log-list {
    margin-top: 10px;
    justify-content: flex-start;
    display: flex;
    flex-direction: column;
    width: 440px;
    border-radius: 10px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    max-height: calc(100vh - 75px);
    flex: 1;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.log-text {
    color: #fff;
}

.sender-text {
    color: #809fff;
}

.gift-text {
    color: #ff9cf7;
}

.action-text {
    color: #fff;
}

.right-buttons {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    padding-top: 5px;
}

.right-buttons button {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
}

.right-buttons a {
    font-size: 24px;
    padding: 0;
    text-decoration: none;
}