* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
}

.page {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
}

.hidden {
    display: none;
}

/* 平台選擇網格 */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.platform-item:hover {
    transform: scale(1.05);
}

.platform-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

/* 輸入頁面樣式 */
.input-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 16px;
}

/* 底部導航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid #d2d2d7;
}

.bottom-nav button {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    color: #1d1d1f;
    font-size: 14px;
    cursor: pointer;
}

.bottom-nav button.active {
    color: #0066cc;
}

/* 記錄頁面樣式 */
.summary-container,
.records-container {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin: 10px 0;
}

.back-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    color: #0066cc;
    font-size: 16px;
    cursor: pointer;
}

/* 平台總計樣式 */
.platform-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 15px 0;
}

.summary-item {
    background: #f5f5f7;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.platform-name {
    font-weight: bold;
    margin-bottom: 8px;
    color: #1d1d1f;
}

.calculation-process {
    font-size: 14px;
    color: #666;
}

.amounts-list {
    margin-bottom: 4px;
    word-break: break-all;
    line-height: 1.4;
}

.total-amount {
    font-weight: bold;
    color: #1d1d1f;
}

/* 記錄列表樣式 */
.records-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 80px;
    padding: 10px;
    background: #f5f5f7;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: bold;
}

.record-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 80px;
    padding: 10px;
    border-bottom: 1px solid #e5e5e7;
    align-items: center;
}

.record-actions {
    display: flex;
    gap: 8px;
}

.record-actions button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.edit-btn {
    background: #0066cc;
    color: white;
}

.delete-btn {
    background: #ff3b30;
    color: white;
}

/* 編輯彈窗樣式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal.hidden {
    display: none;
}

/* 輸入頁面樣式新 */
.input-group {
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f7;
    border-radius: 8px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 500;
}

.input-group input[type="number"] {
    margin: 0;
}

.platform-label {
    display: block;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #1d1d1f;
}

/* 清理按鈕樣式 */
.clear-all-btn {
    background: #ff3b30;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
}

.clear-all-btn:hover {
    background: #ff453a;
}

/* 快速金額按鈕樣式 */
.quick-amount-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.amount-btn {
    padding: 8px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    background: white;
    color: #1d1d1f;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.amount-btn:hover {
    background: #ffd60a;
    border-color: #ffd60a;
    transform: scale(1.05);
}

.amount-btn.selected {
    background: #ffd60a;
    border-color: #ffd60a;
    color: #000000;
}

.amount-btn:active {
    transform: scale(0.95);
}

.amount-btn[data-amount="0"] {
    background: #f5f5f7;
    border-color: #e5e5e7;
}

.amount-btn[data-amount="0"]:hover,
.amount-btn[data-amount="0"].selected {
    background: #ffd60a;
    border-color: #ffd60a;
}

/* 保存按鈕樣式 */
#saveButton {
    width: 100%;
    padding: 15px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    margin-top: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#saveButton:hover {
    background: #0055b3;
}

#saveButton:active {
    background: #004499;
    transform: scale(0.98);
}

/* 金額項目樣式 */
.amount-item {
    display: inline-flex;
    align-items: center;
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    margin: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.amount-order {
    color: #666;
    font-size: 14px;
    margin-right: 4px;
}

.amount-value {
    font-weight: 500;
    color: #1d1d1f;
}

.amount-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

.delete-amount-btn {
    border: none;
    background: none;
    color: #ff3b30;
    font-size: 16px;
    padding: 0 0 0 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: 4px;
    transition: all 0.2s;
}

.delete-amount-btn:hover {
    background: #ff3b30;
    color: white;
}

/* 更新計算過程樣式 */
.amounts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

/* 移除加號 */
.amounts-list::after {
    content: none;
}

/* 添加無記錄樣式 */
.no-records {
    color: #999;
    text-align: center;
    padding: 10px;
    font-size: 14px;
}

/* 編輯金額按鈕樣式 */
.edit-amount-btn {
    border: none;
    background: none;
    color: #0066cc;
    font-size: 14px;
    padding: 0 0 0 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: 4px;
    transition: all 0.2s;
}

.edit-amount-btn:hover {
    background: #0066cc;
    color: white;
}

/* 平台清除按鈕樣式 */
.clear-platform-btn {
    background: #ff3b30;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
    width: 100%;
}

.clear-platform-btn:hover {
    background: #ff453a;
}

/* 更新總金額顯示樣式 */
.total-amount {
    margin-top: 10px;
    font-weight: bold;
    color: #1d1d1f;
}

.total-amount div {
    margin: 5px 0;
}

/* 編輯模態框中的快速選擇按鈕樣式 */
.modal .quick-amount-buttons {
    margin: 10px 0;
}

.modal .amount-btn {
    margin: 5px;
}

/* 編輯模態框中的平台信息樣式 */
.edit-platform-info {
    margin-bottom: 15px;
    padding: 10px;
    background: #f5f5f7;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.edit-platform-info span {
    color: #1d1d1f;
    font-size: 14px;
}

/* 金額項目的操作按鈕樣式 */
.amount-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

.amount-item {
    display: inline-flex;
    align-items: center;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px;
}

.edit-amount-btn,
.delete-amount-btn {
    border: none;
    background: none;
    font-size: 14px;
    padding: 2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.2s;
}

.edit-amount-btn {
    color: #0066cc;
}

.delete-amount-btn {
    color: #ff3b30;
}

.edit-amount-btn:hover {
    background: #0066cc;
    color: white;
}

.delete-amount-btn:hover {
    background: #ff3b30;
    color: white;
}

/* 添加提示消息样式 */
.save-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0;
    pointer-events: none;
}

.save-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(10px);
}

.save-message.hidden {
    display: none;
}
 