/* SBTI风格 - BGITI 重构版本 */

:root {
    --bg: #f6faf6;
    --panel: #ffffff;
    --text: #1e2a22;
    --muted: #6a786f;
    --line: #dbe8dd;
    --soft: #edf6ef;
    --accent: #6c8d71;
    --accent-strong: #4d6a53;
    --shadow: 0 16px 40px rgba(47, 73, 55, 0.08);
    --radius: 22px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top left, #f8fff8 0, #f6faf6 36%, #f2f7f3 100%);
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
}

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

/* Screens */
.screen {
    display: none;
    min-height: calc(100vh - 40px);
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ==================== Welcome Screen ==================== */
.screen-welcome {
    text-align: center;
}

.screen-welcome .logo {
    font-size: 48px;
    font-weight: 900;
    color: var(--accent-strong);
    letter-spacing: 8px;
    margin-bottom: 12px;
    padding: 12px 24px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}
.screen-welcome .logo:hover {
    box-shadow: 0 8px 24px rgba(77, 106, 83, 0.25);
    transform: translateY(-2px);
}
.screen-welcome .logo:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(77, 106, 83, 0.15);
}

.screen-welcome .subtitle {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 48px;
    line-height: 1.6;
}

.screen-welcome .tagline {
    font-size: 13px;
    color: var(--muted);
    margin-top: 32px;
    opacity: 0.7;
}

.btn-start {
    background: var(--accent-strong);
    border: none;
    padding: 18px 64px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 24px rgba(77, 106, 83, 0.25);
    font-family: inherit;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(77, 106, 83, 0.35);
}

.btn-start:active {
    transform: translateY(0);
}

/* ==================== Quiz Screen ==================== */
.screen-quiz {
    justify-content: flex-start !important;
    padding-top: 32px;
}

/* Progress Bar - Capsule Style */
.progress-container {
    width: 100%;
    margin-bottom: 36px;
}

.progress-text {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.4s ease;
    width: 0%;
}

/* Question Card */
.question-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.question-card {
    width: 100%;
    background: var(--panel);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
}

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

.btn-prev {
    background: transparent;
    border: 1.5px solid var(--line);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-prev:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.question-number {
    font-size: 13px;
    color: var(--accent);
    font-weight: 700;
}

.question-text {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 28px;
    color: var(--text);
}

/* Option Buttons */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: var(--panel);
    border: 1.5px solid var(--line);
    padding: 18px 20px;
    border-radius: 12px;
    font-size: 15px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: left;
}

.option-btn:hover {
    border-color: var(--accent);
    background: var(--soft);
}

.option-btn:active {
    transform: scale(0.99);
}

.option-btn.selected {
    border-color: var(--accent-strong);
    background: var(--soft);
}

/* Slide Animations */
@keyframes slideOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-out-left { animation: slideOutLeft 0.3s ease-out forwards; }
.slide-in-right { animation: slideInRight 0.3s ease-out forwards; }
.slide-out-right { animation: slideOutRight 0.3s ease-out forwards; }
.slide-in-left { animation: slideInLeft 0.3s ease-out forwards; }

/* ==================== Result Screen ==================== */
.screen-result {
    justify-content: flex-start !important;
    padding-top: 24px;
}

.result-card {
    width: 100%;
    background: var(--panel);
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.animal-image {
    width: 240px;
    height: 240px;
    margin: 0 auto 24px;
    border-radius: 16px;
    background: var(--soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.animal-name {
    font-size: 28px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: 4px;
}

.animal-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 32px;
    padding: 0 8px;
}

.radar-title {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Radar Charts Container - 3 pentagon charts */
.radar-charts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.radar-group {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
}

.radar-group-title {
    font-size: 12px;
    color: var(--accent);
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.radar-chart-wrapper {
    position: relative;
    height: 160px;
}

.radar-chart-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Dimensions Grid */
.dimensions-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
    text-align: left;
}

.dimension-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
}

.dim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dim-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.dim-value {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.dim-bar-bg {
    height: 8px;
    background: var(--soft);
    border-radius: 999px;
    overflow: hidden;
}

.dim-bar-fill {
    height: 100%;
    background: var(--accent-strong);
    border-radius: 999px;
    transition: width 0.8s ease-out;
    width: 0%;
}

/* Cover Section */
.cover-section {
    margin-bottom: 28px;
    text-align: center;
}

.cover-title {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: 1px;
}

.cover-card {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    text-align: left;
}

.cover-img-wrapper {
    width: 100%;
    background: #e8ece8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cover-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.cover-info {
    padding: 14px 16px;
}

.cover-journal-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-strong);
    letter-spacing: 0.5px;
}

.cover-date {
    font-size: 11px;
    color: var(--muted);
}

.cover-volume {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    margin-bottom: 8px;
}

.cover-authors {
    font-size: 11px;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 2px;
}

.cover-institution {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.4;
    margin-bottom: 8px;
}

.cover-description {
    font-size: 13px;
    color: var(--text);
    line-height: 1.8;
    margin-bottom: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    white-space: pre-line;
}

.cover-doi {
    display: inline-block;
    font-size: 10px;
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
    transition: color 0.2s;
}

.cover-doi:hover {
    color: var(--accent-strong);
}

/* Share Section */
.share-section {
    margin-top: 8px;
    padding: 20px;
    background: var(--soft);
    border-radius: 16px;
}

.share-title {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 14px;
    font-weight: 600;
}

.share-link-container {
    display: flex;
    gap: 10px;
}

.share-link-input {
    flex: 1;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text);
    font-family: inherit;
    outline: none;
}

.share-link-input:focus {
    border-color: var(--accent);
}

.copy-btn {
    background: var(--accent-strong);
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.copy-btn:hover {
    transform: scale(1.02);
}

.btn-retest {
    width: 100%;
    background: var(--accent-strong);
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    margin-top: 20px;
}

.btn-retest:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(77, 106, 83, 0.25);
}

/* Radar Canvas */
.radar-container {
    width: 280px;
    height: 280px;
    margin: 0 auto 20px;
}

#radarCanvas {
    width: 100%;
    height: 100%;
}

/* Fade-in animation for result elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animal-image, .animal-name, .animal-desc {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animal-desc {
    animation-delay: 0.1s;
}

.radar-title, .dimensions-grid, .cover-section {
    animation: fadeInUp 0.5s ease-out 0.2s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.share-section {
    animation: fadeInUp 0.5s ease-out 0.3s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

.btn-retest {
    animation: fadeInUp 0.5s ease-out 0.35s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}
