:root {
    /* 主色調：活潑、溫暖的漸層色系 */
    --primary-color: #ff6b6b;
    --primary-dark: #ee5253;
    --secondary-color: #48dbfb;
    --secondary-dark: #0abde3;
    
    /* 背景與卡片 */
    --bg-color: #f7f1e3;
    --card-bg: #ffffff;
    
    /* 文字顏色 */
    --text-main: #2f3640;
    --text-muted: #718093;
    --text-light: #f5f6fa;
    
    /* 輔助與特效 */
    --success: #1dd1a1;
    --highlight: #feca57;
    --radius: 20px;
    --shadow: 0 10px 30px rgba(0,0,0,0.06);
    --shadow-hover: 0 15px 35px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 容器與動畫 */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography & Headers */
h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
    font-weight: 700;
}

.hero {
    text-align: center;
    padding: 2rem 0;
}

.hero-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.hero h1 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 1.8rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 首頁規則列表 */
.rule-list {
    list-style: none;
}

.rule-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-size: 1.05rem;
}

.rule-list .icon {
    font-size: 1.5rem;
    margin-right: 12px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(72, 219, 251, 0.4);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 219, 251, 0.6);
}

.btn-outline {
    background: transparent;
    border: 2px solid #ced6e0;
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.btn-large {
    font-size: 1.2rem;
    padding: 16px 32px;
    width: 100%;
}

.btn-block {
    width: 100%;
}

.btn:disabled, .btn.disabled {
    background: #dfe4ea;
    color: #a4b0be;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: auto;
    padding-top: 2rem;
    color: #a4b0be;
    font-size: 0.9rem;
}

/* Location Page specific */
.page-location {
    padding-bottom: 120px; /* 為底部 fixed 按鈕留空間 */
}

.location-header {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1rem;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--primary-color);
}

.location-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #353b48;
}

.location-content p {
    margin-bottom: 1.5rem;
}

.location-content strong {
    color: var(--primary-dark);
    font-weight: 700;
}

/* 集章底部區塊 (Sticky or Fixed at bottom) */
.collect-section {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    border: 2px solid var(--primary-color);
    background: #fff9f9;
}

.collect-hint {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Stamps Grid */
.stamps-header {
    padding-bottom: 1rem;
}

.highlight {
    color: var(--primary-color);
    font-weight: 900;
    font-size: 1.4rem;
}

.progress-bar-container {
    width: 80%;
    height: 8px;
    background: #dfe4ea;
    border-radius: 10px;
    margin: 15px auto 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--highlight), var(--primary-color));
    width: 0%;
    transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 10px;
}

.stamps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 2rem;
}

.stamp-slot {
    aspect-ratio: 1;
    background-color: var(--card-bg);
    border: 3px dashed #ced6e0;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.04);
}

.stamp-slot.collected {
    border-color: var(--primary-color);
    background-color: #fff0f0;
    transform: scale(1.05);
    border-style: solid;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.2);
}

.stamp-slot.collected::after {
    content: '★';
    font-size: 3rem;
    color: var(--primary-color);
    animation: stampStamp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stampStamp {
    0% { transform: scale(3) rotate(-20deg); opacity: 0; }
    50% { transform: scale(0.8) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.stamp-number {
    position: absolute;
    font-size: 1.2rem;
    font-weight: 900;
    color: #dfe4ea;
    z-index: 0;
}

.stamp-slot.collected .stamp-number {
    display: none;
}

/* Rewards Section */
.rewards-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f1f2f6;
    padding-bottom: 10px;
}

.reward-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 0;
    border-bottom: 1px dashed #ced6e0;
}

.reward-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.reward-info h3 {
    margin-bottom: 0.3rem;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.reward-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.reward-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(47, 54, 64, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    position: relative;
    animation: modalShow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalShow {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--primary-color);
}

.modal-header {
    text-align: center;
    margin-bottom: 1rem;
}

.modal-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.modal-header h2 {
    color: var(--primary-dark);
    margin-bottom: 0;
}

.modal-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin: 1.5rem 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #dfe4ea;
    border-radius: 12px;
    font-size: 1.05rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(72, 219, 251, 0.2);
}

/* Spinner */
#modal-loading {
    text-align: center; margin-top: 1rem;
}

#modal-loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f2f6;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Blockquote */
blockquote {
    background: #fff9f9;
    border-left: 5px solid var(--primary-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    font-style: italic;
    color: var(--text-main);
    position: relative;
}

blockquote::before {
    content: "❝";
    font-size: 2.5rem;
    color: var(--primary-color);
    position: absolute;
    top: -0.5rem;
    left: 0.8rem;
    opacity: 0.3;
}

blockquote p {
    margin: 0;
    line-height: 1.8;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #2f3640;
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 700;
    text-align: center;
    min-width: 250px;
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}
