/* 表單頁面共用佈局 */
.master-page {
    display: block;
    min-height: 100vh;
    padding-bottom: 4rem;
}

.page-content {
    max-width: 800px;
}

.master-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out forwards;
}

.master-header .rune-symbol {
    font-size: 5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px currentColor;
}

.theme-oracle .rune-symbol,
.theme-oracle .title {
    color: #d4af37;
}

.theme-mystic .rune-symbol,
.theme-mystic .title {
    color: #9d4edd;
}

.theme-scholar .rune-symbol,
.theme-scholar .title {
    color: #00b4d8;
}

/* 表單區塊白底樣式 */
.form-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
    color: #333;
    /* 文字改為深色 */
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #444;
}

/* 輸入框群組 */
.date-inputs {
    display: flex;
    gap: 0.5rem;
}

.date-inputs input,
.custom-select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: #ffffff;
    border: 1px solid #d2d2d2;
    border-radius: 4px;
    color: #333;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "▼";
    font-size: 0.8rem;
    color: #000;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.custom-select {
    appearance: none;
    cursor: pointer;
}

input[type="number"]:focus,
.custom-select:focus {
    outline: none;
    border-color: #666;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 按鈕群組 */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.submit-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn {
    background-color: #4a4a5a;
    color: #fff;
}

.primary-btn:hover {
    background-color: #383848;
}

.secondary-btn {
    background-color: #9d9095;
    color: #fff;
}

.secondary-btn:hover {
    background-color: #8b7e83;
}

.error-msg {
    color: #ff6b6b;
    font-size: 0.9rem;
    min-height: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* 結果區塊 */
.result-section {
    background: var(--glass-bg);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.result-section.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.result-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.result-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.res-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.res-rune-symbol {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-family: sans-serif;
}

.theme-oracle .res-rune-symbol {
    color: #d4af37;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.theme-mystic .res-rune-symbol {
    color: #9d4edd;
    text-shadow: 0 0 15px rgba(157, 78, 221, 0.4);
}

.theme-scholar .res-rune-symbol {
    color: #00b4d8;
    text-shadow: 0 0 15px rgba(0, 180, 216, 0.4);
}

.res-rune-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.master-advice {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

.master-advice h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.theme-oracle .master-advice h3 {
    color: #d4af37;
}

.theme-mystic .master-advice h3 {
    color: #9d4edd;
}

.theme-scholar .master-advice h3 {
    color: #00b4d8;
}

.master-advice p {
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    padding: 0.8rem 2rem;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    transition: all 0.3s;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .form-group-row {
        flex-direction: column;
        gap: 0;
    }

    .date-inputs {
        flex-direction: row;
        gap: 0.5rem;
    }

    .form-section,
    .result-section {
        padding: 2rem 1.5rem;
    }
}