:root {
    --bg-dark: #0D1B2A;
    --bg-card: #1B263B;
    --purple: #B565D8;
    --purple-dim: #7B4FA0;
    --cyan: #00F0FF;
    --text-primary: #E8E8E8;
    --text-secondary: #8B9DC3;
    --text-dim: #5A6B8C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Orbitron", sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 24px 20px;
    position: relative;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(181, 101, 216, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(181, 101, 216, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.screen {
    display: none;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    font-size: 14px;
    color: var(--purple);
    padding: 8px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--purple);
}

.upload-area {
    background: var(--bg-card);
    border: 2px dashed rgba(181, 101, 216, 0.3);
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 32px;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--purple);
    background: rgba(181, 101, 216, 0.05);
    box-shadow: 0 0 20px rgba(181, 101, 216, 0.2);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    font-size: 48px;
    color: var(--purple);
}

.upload-placeholder p {
    font-size: 16px;
    color: var(--text-primary);
}

.upload-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
}

.action-area {
    text-align: center;
}

.main-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--purple), var(--purple-dim));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(181, 101, 216, 0.3);
}

.main-btn:disabled {
    background: rgba(181, 101, 216, 0.3);
    cursor: not-allowed;
    box-shadow: none;
}

.main-btn:not(:disabled):active {
    transform: scale(0.98);
}

.quota-tip {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.loading-container {
    text-align: center;
    padding: 80px 20px;
}

.warp-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
}

.warp-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--purple);
    border-radius: 50%;
    animation: warp 2s ease-in-out infinite;
}

.warp-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: var(--cyan);
    animation: glow 2s ease-in-out infinite;
}

@keyframes warp {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 10px var(--cyan); }
    50% { text-shadow: 0 0 20px var(--cyan), 0 0 30px var(--purple); }
}

.loading-title {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--purple);
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.result-container {
    padding-bottom: 40px;
}

.archive-card {
    background: var(--bg-card);
    border: 1px solid rgba(181, 101, 216, 0.3);
    border-radius: 20px;
    padding: 32px 24px;
    margin-bottom: 24px;
    box-shadow: 0 0 30px rgba(181, 101, 216, 0.1);
}

.archive-header {
    text-align: center;
    margin-bottom: 24px;
}

.archive-label {
    font-size: 12px;
    color: var(--purple);
    letter-spacing: 2px;
    border: 1px solid var(--purple);
    padding: 6px 16px;
    border-radius: 20px;
}

.identity-section {
    text-align: center;
    margin-bottom: 24px;
}

.universe-code {
    font-size: 11px;
    color: var(--cyan);
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}

.identity-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--purple);
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.rarity-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.rarity-stars {
    font-size: 16px;
    color: var(--purple);
}

.rarity-percent {
    font-size: 12px;
    color: var(--text-secondary);
}

.divider {
    text-align: center;
    font-size: 12px;
    color: var(--purple-dim);
    margin: 24px 0 16px;
    letter-spacing: 2px;
}

.story-section, .echo-section {
    margin-bottom: 24px;
}

.story-text, .echo-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.keywords-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.keyword-item {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 16px;
}

.keyword-item::before {
    content: "▸ ";
    color: var(--cyan);
    font-weight: bold;
}

.mystery-section {
    text-align: center;
}

.mystery-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.unlock-btn {
    background: rgba(181, 101, 216, 0.2);
    color: var(--purple);
    border: 1px solid var(--purple);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.unlock-btn:hover {
    background: rgba(181, 101, 216, 0.3);
    box-shadow: 0 0 15px rgba(181, 101, 216, 0.3);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.outline-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    color: var(--purple);
    border: 1px solid var(--purple);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.outline-btn:active {
    transform: scale(0.98);
}
