:root {
    --bg-color: #222222;
    --text-color: #e6e8ef;
    --secondary-bg: #333333;
    --accent-color: #8B0000;
    --accent-hover: #a00000;
    --muted-color: #888888;
    --input-bg: #444444;
    --border-color: #555555;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding-bottom: 50px;
}

/* Fix for WeChat/Mobile Layout */
/* Restore original container styling but keep mobile optimizations */
@media (min-width: 481px) {
    .container {
        padding: 40px;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

@keyframes flameFlicker {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.flame {
    animation: flameFlicker 2s infinite ease-in-out;
    transform-origin: 50% 40%;
}

/* Typography */
h1, h2, h3 { margin-top: 0; }
.subtitle { color: var(--muted-color); font-size: 0.9em; margin-bottom: 2rem; }

/* Components */
.logo-area {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 40px;
}
.app-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
}

.form-card {
    background: var(--secondary-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: var(--muted-color);
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 8px;
    font-size: 16px;
}
.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-group.checkbox input {
    width: auto;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary {
    background-color: var(--accent-color);
    color: white;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
}
.btn-sm {
    padding: 6px 12px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
}
.btn-icon {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: 0 10px 0 0;
}

.link {
    text-align: center;
    margin-top: 15px;
    color: var(--muted-color);
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: underline;
}

.header-nav {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Dashboard Specific */
.status-card {
    text-align: center;
    margin: 20px 0;
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.btn-checkin {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #444, #222);
    border: 4px solid var(--accent-color);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.4);
    transition: transform 0.1s, box-shadow 0.2s;
    position: relative;
    z-index: 2;
}
.btn-checkin:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.2);
}
.btn-checkin .icon {
    font-size: 32px;
    margin-bottom: 5px;
}
.btn-checkin .text {
    font-size: 16px;
    font-weight: bold;
}
.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--accent-color);
    animation: pulse 2s infinite;
    z-index: 1;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

/* Fix for WeChat/Mobile Layout */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 40px; /* Add bottom margin for scrolling */
}

.menu-item {
    background: var(--secondary-bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.menu-item:active {
    background: var(--input-bg);
}

.menu-icon {
    font-size: 24px;
}

/* Checkin Toast Overlay (Replaces Modal) */
.checkin-toast-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none; /* Allow clicks through initially, though we might want to block interaction during animation */
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.checkin-toast-content {
    background: rgba(18, 24, 51, 0.95);
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(139, 0, 0, 0.6);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    max-width: 80%;
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkin-toast-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.checkin-toast-overlay.active .checkin-toast-content {
    transform: scale(1);
}

.checkin-toast-text {
    font-size: 18px;
    line-height: 1.6;
    color: #ffd700;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin: 0;
}
