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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.container {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.step-indicator.hidden {
    display: none;
}

.step-dot {
    width: 28px;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    transition: background-color 0.3s;
}

.step-dot.active {
    background-color: #0095f6;
}

#confessionForm {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.step-page {
    display: none;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
}

.step-page.active {
    display: flex;
    animation: fadeIn 0.3s ease-in-out;
}

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

.page-content {
    flex: 1;
}

h1 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #1a1a1a;
    text-align: center;
}

.subtitle {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

.rules-box {
    background: #f8f9fa;
    border-left: 4px solid #0095f6;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 24px;
    user-select: none;
}

.checkbox-container input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.category-btn {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.category-btn:not(:disabled):hover {
    border-color: #0095f6;
    background-color: #f0f8ff;
}

.category-btn.selected {
    border-color: #0095f6;
    background-color: #e7f3ff;
    color: #0095f6;
}

.category-btn:disabled {
    background-color: #f5f5f5;
    color: #aaa;
    border-color: #eee;
    cursor: not-allowed;
}

.badge {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 6px;
}

.badge.red {
    background-color: #ffebee;
    color: #d32f2f;
}

.badge.green {
    background-color: #ebffec;
    color: #2fd32f;
}

.badge.blue {
    background-color: #ebebff;
    color: #322fd3;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #0095f6;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    margin-bottom: 20px;
}

.confirm-box {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.confirm-item {
    font-size: 14px;
}

.confirm-label {
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 4px;
}

.confirm-value {
    color: #1a1a1a;
}

.message-preview {
    background: white;
    border: 1px solid #edf2f7;
    padding: 10px;
    border-radius: 6px;
    word-break: break-all;
    white-space: pre-wrap;
}

.success-screen {
    text-align: center;
    padding: 40px 0;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.back-home-note {
    font-size: 12px;
    color: #888;
    margin-top: 16px;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    margin-top: auto;
}

button.next-btn, button.prev-btn, button[type="submit"] {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    height: 46px; /* 固定正常高度避免拉高 */
}

.next-btn, button[type="submit"] {
    background-color: #0095f6;
    color: white;
}

.next-btn:disabled, button[type="submit"]:disabled {
    background-color: #b2dffc;
    cursor: not-allowed;
}

.prev-btn {
    background-color: #e4e6eb;
    color: #050505;
}

.prev-btn:hover {
    background-color: #d8dadf;
}

/* 署名置中對齊 */
.footer-credit {
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}
