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

body {
    font-family: -apple-system, sans-serif;
    background: #f0f2f5;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
}

.header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.header h1 {
    font-size: 22px;
}

.header p {
    opacity: 0.9;
    margin-top: 5px;
}

.menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.card {
    background: white;
    padding: 24px 16px;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid #667eea;
    transition: transform 0.2s;
}

.card:active {
    transform: scale(0.95);
}

.card .icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.card .label {
    font-size: 14px;
    font-weight: 600;
}

.card .sub {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.status {
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.btn {
    display: inline-block;
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
}

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

.card.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    border-color: #ccc;
}

#loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

#loading-overlay .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#pdf-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    flex-direction: column;
}

#pdf-toolbar {
    padding: 12px 20px;
    background: #f0f2f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

#pdf-back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

#pdf-back-btn:active {
    transform: scale(0.95);
}

#pdf-container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f0f2f5;
}

#pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex-grow: 1;
}