* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    @media (max-width: 768px) {
        font-size: 14px;
    }
    @media (max-width: 480px) {
        font-size: 12px;
    }
    height: -webkit-fill-available;
}

body {
    background: linear-gradient(135deg, #1a0b1a 0%, #2a0b2a 100%);
    color: #f0e0f0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2vw;
    position: relative;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 500px;
    @media (min-width: 992px) {
        max-width: 600px;
    }
    background: rgba(40, 20, 40, 0.9);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(255, 105, 180, 0.15);
    border: 1px solid rgba(255, 182, 193, 0.3);
    @media (min-width: 992px) {
        padding: 1rem;
    }
}

.header {
    padding: 2.5rem 0 1.875rem;
    text-align: center;
    background: linear-gradient(180deg, #ff69b4 0%, #ff1493 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    @media (min-width: 992px) {
        padding: 3rem 0 2rem;
    }
}

.logo {
    font-size: 3.75rem;
    color: white;
    margin-bottom: 1.25rem;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
    animation: heartbeat 1.5s ease infinite;
    cursor: pointer;
    display: inline-block;
    padding: 0.625rem;
    @media (min-width: 992px) {
        font-size: 4.5rem;
        margin-bottom: 1.5rem;
    }
    @media (max-width: 480px) {
        font-size: 3rem;
    }
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.625rem;
    letter-spacing: 0.0625rem;
    color: white;
    @media (min-width: 992px) {
        font-size: 1.875rem;
    }
}

.subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.1875rem;
    text-transform: uppercase;
    font-weight: 500;
    @media (min-width: 992px) {
        font-size: 0.875rem;
    }
}

.content {
    padding: 1.875rem;
    @media (min-width: 992px) {
        padding: 2.5rem;
    }
    @media (max-width: 480px) {
        padding: 1.25rem;
    }
}

.input-group {
    margin-bottom: 1.5625rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.9375rem;
    color: #f0e0f0;
    font-size: 1rem;
    font-weight: 500;
    @media (min-width: 992px) {
        font-size: 1.125rem;
    }
}

.input-label i {
    color: #ff69b4;
}

.key-input {
    width: 100%;
    padding: 1rem 0.9375rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #ff69b4;
    border-radius: 0.625rem;
    color: #ffffff;
    font-size: 0.9375rem;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.0625rem;
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    @media (min-width: 992px) {
        padding: 1.125rem 1rem;
        font-size: 1rem;
    }
}

.key-input:focus {
    border-color: #ff1493;
    box-shadow: 0 0 0 2px rgba(255, 20, 147, 0.3);
}

.key-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.hint {
    font-size: 0.75rem;
    color: #d8a8d8;
    margin-top: 0.5rem;
    padding-left: 0.3125rem;
    @media (min-width: 992px) {
        font-size: 0.875rem;
    }
}

.query-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    color: white;
    border: none;
    border-radius: 0.625rem;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.625rem;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    @media (min-width: 992px) {
        padding: 1.125rem;
        font-size: 1.125rem;
    }
}

.query-btn:hover {
    background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.4);
}

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

.query-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.instructions {
    margin-top: 2.1875rem;
    @media (min-width: 992px) {
        margin-top: 2.5rem;
    }
}

.instructions h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #f0e0f0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    @media (min-width: 992px) {
        font-size: 1.25rem;
    }
}

.instructions h3 i {
    color: #ff69b4;
}

.instruction-item {
    padding: 0.75rem 0;
    color: #e0c0e0;
    font-size: 0.875rem;
    line-height: 1.5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    padding-left: 1.25rem;
    @media (min-width: 992px) {
        font-size: 1rem;
        padding: 0.875rem 0;
    }
}

.instruction-item:last-child {
    border-bottom: none;
}

.instruction-item::before {
    content: "·";
    position: absolute;
    left: 0;
    color: #ff69b4;
    font-size: 1.25rem;
    line-height: 1;
}

.announcement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
}

.announcement-modal.active {
    opacity: 1;
    visibility: visible;
}

.announcement-content {
    background: linear-gradient(135deg, #2a0b2a 0%, #1a0b1a 100%);
    width: calc(100% - 2.5rem);
    max-width: 23.75rem;
    min-width: 20rem;
    border-radius: 1.125rem;
    padding: 1.5625rem 1.375rem;
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.3);
    border: 2px solid #ff69b4;
    position: relative;
    box-sizing: border-box;
    max-height: 85vh;
    overflow-y: auto;
    padding-top: 1.875rem;
    overflow: visible;
    @media (min-width: 992px) {
        max-width: 30rem;
        padding: 2rem 1.75rem;
    }
    @media (max-width: 480px) {
        width: calc(100% - 1.25rem);
        min-width: unset;
        padding: 1.75rem 1.125rem 1.375rem;
        max-height: 80vh;
    }
}

.announcement-modal.active .announcement-content {
    animation: bounceIn 0.6s ease-out forwards;
}

.modal-header-decoration {
    position: absolute;
    top: -1.125rem;
    left: 50%;
    transform: translateX(-50%);
    width: 3.125rem;
    height: 1.75rem;
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    border-radius: 0 0 1.75rem 1.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(255, 105, 180, 0.5);
    z-index: 3;
    @media (min-width: 992px) {
        width: 3.5rem;
        height: 2rem;
        top: -1.25rem;
    }
    @media (max-width: 480px) {
        width: 2.8125rem;
        height: 1.5625rem;
        top: -0.9375rem;
    }
}

.decoration-heart {
    color: white;
    font-size: 1rem;
    animation: heartBeat 1.5s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    @media (min-width: 992px) {
        font-size: 1.125rem;
    }
    @media (max-width: 480px) {
        font-size: 0.875rem;
    }
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.125rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #ff69b4;
    position: relative;
    z-index: 2;
    margin-top: 0.3125rem;
    @media (min-width: 992px) {
        gap: 1rem;
        margin-bottom: 1.25rem;
    }
}

.announcement-icon {
    width: 2.375rem;
    height: 2.375rem;
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
    flex-shrink: 0;
    animation: rotateIn 0.5s ease-out forwards;
    @media (min-width: 992px) {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.25rem;
    }
}

.announcement-title {
    font-size: 1.1875rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
    @media (min-width: 992px) {
        font-size: 1.375rem;
    }
}

.announcement-body {
    margin-bottom: 1.25rem;
}

.announcement-text {
    color: #e0c0e0;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    animation: textFadeIn 0.8s ease-out forwards;
    @media (min-width: 992px) {
        font-size: 1rem;
    }
}

.announcement-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
    color: #d8a8d8;
    font-size: 0.875rem;
    animation: itemFadeIn 0.5s ease-out forwards;
    @media (min-width: 992px) {
        font-size: 0.9375rem;
        gap: 0.75rem;
    }
}

.announcement-item:nth-child(1) { animation-delay: 0.2s; }
.announcement-item:nth-child(2) { animation-delay: 0.4s; }
.announcement-item:nth-child(3) { animation-delay: 0.6s; }
.announcement-item:nth-child(4) { animation-delay: 0.8s; }

.announcement-item i {
    color: #ff69b4;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
    animation: dotPulse 1s infinite alternate;
}

.announcement-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.9375rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 105, 180, 0.2);
    animation: footerFadeIn 1s ease-out forwards;
    @media (min-width: 992px) {
        margin-top: 1.25rem;
        padding-top: 1rem;
    }
    @media (max-width: 480px) {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #c9b8d6;
    font-size: 0.875rem;
    cursor: pointer;
    @media (min-width: 992px) {
        font-size: 0.9375rem;
    }
    @media (max-width: 480px) {
        justify-content: center;
    }
}

.checkbox-container input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #ff69b4;
    cursor: pointer;
    @media (min-width: 992px) {
        width: 1.125rem;
        height: 1.125rem;
    }
}

.close-announcement {
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5625rem 1.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    animation: btnGlow 2s infinite alternate;
    @media (min-width: 992px) {
        padding: 0.625rem 1.5rem;
        font-size: 0.9375rem;
    }
    @media (max-width: 480px) {
        width: 100%;
    }
}

.close-announcement:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 105, 180, 0.3);
}

.modal-footer-decoration {
    display: flex;
    justify-content: center;
    margin-top: 1.125rem;
    padding-bottom: 0.5rem;
}

.disclaimer-text {
    font-size: 0.75rem;
    color: #ff8fab;
    line-height: 1.4;
    text-align: center;
    padding: 0.5rem 0.625rem;
    background: rgba(60, 20, 60, 0.5);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 105, 180, 0.2);
    animation: textFadeIn 1s ease-out forwards;
    @media (min-width: 992px) {
        font-size: 0.875rem;
        padding: 0.625rem 0.75rem;
    }
    @media (max-width: 480px) {
        font-size: 0.6875rem;
        padding: 0.375rem 0.5rem;
    }
}

.decoration-star {
    display: none;
}

.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 2vw;
}

.result-modal.active {
    opacity: 1;
    visibility: visible;
}

.result-modal-content {
    background: linear-gradient(135deg, #2a0b2a 0%, #1a0b1a 100%);
    width: 100%;
    max-width: 28.125rem;
    border-radius: 1.125rem;
    padding: 1.5625rem;
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.3);
    border: 2px solid #ff69b4;
    position: relative;
    animation: bounceIn 0.6s ease-out forwards;
    max-height: 80vh;
    overflow-y: auto;
    @media (min-width: 992px) {
        max-width: 35rem;
        padding: 2rem;
    }
    @media (max-width: 480px) {
        max-width: unset;
        padding: 1.25rem;
        max-height: 85vh;
    }
}

.result-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.9375rem;
    border-bottom: 2px solid #ff69b4;
    @media (min-width: 992px) {
        margin-bottom: 1.5rem;
        padding-bottom: 1.125rem;
    }
    @media (max-width: 480px) {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
}

.result-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ff69b4;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    @media (min-width: 992px) {
        font-size: 1.25rem;
    }
}

.close-result-modal {
    background: rgba(255, 105, 180, 0.2);
    color: #ff69b4;
    border: 1px solid #ff69b4;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    @media (min-width: 992px) {
        width: 2.25rem;
        height: 2.25rem;
    }
}

.close-result-modal:hover {
    background: rgba(255, 105, 180, 0.3);
    transform: rotate(90deg);
}

.result-modal-body {
    margin-bottom: 1.25rem;
    @media (min-width: 992px) {
        margin-bottom: 1.5rem;
    }
}

.op-content {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.9375rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8125rem;
    color: #ffb6c1;
    word-break: break-all;
    border: 1px solid rgba(255, 105, 180, 0.2);
    max-height: 9.375rem;
    overflow-y: auto;
    @media (min-width: 992px) {
        padding: 1rem;
        font-size: 0.875rem;
        max-height: 12.5rem;
        margin-bottom: 1.25rem;
    }
    @media (max-width: 480px) {
        max-height: 7.5rem;
        font-size: 0.75rem;
    }
}

.account-info {
    margin-top: 0.9375rem;
    @media (min-width: 992px) {
        margin-top: 1.25rem;
    }
}

.account-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ff8fab;
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    @media (min-width: 992px) {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
    @media (min-width: 992px) {
        gap: 0.9375rem;
    }
    @media (max-width: 480px) {
        grid-template-columns: 1fr;
    }
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    color: #d8a8d8;
    @media (min-width: 992px) {
        font-size: 0.875rem;
    }
}

.info-value {
    font-size: 0.875rem;
    color: #ffffff;
    font-weight: 500;
    @media (min-width: 992px) {
        font-size: 0.9375rem;
    }
}

.result-modal-footer {
    display: flex;
    justify-content: center;
    padding-top: 0.9375rem;
    border-top: 1px solid rgba(255, 105, 180, 0.2);
    @media (min-width: 992px) {
        padding-top: 1.25rem;
    }
}

.copy-btn {
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.625rem 1.5625rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    @media (min-width: 992px) {
        padding: 0.75rem 2rem;
        font-size: 0.9375rem;
    }
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(255, 105, 180, 0.3);
}

.announcement-particle {
    position: absolute;
    width: 0.75rem;
    height: 0.75rem;
    pointer-events: none;
    z-index: -1;
    color: #ff69b4;
    animation: particleFly 2s ease-out forwards;
    @media (min-width: 992px) {
        width: 0.875rem;
        height: 0.875rem;
    }
}

.heart-effect, .colorful-heart {
    position: absolute;
    pointer-events: none;
    z-index: 999;
}

.custom-message {
    animation: slideIn 0.3s ease;
}

.custom-message.error {
    background: #ff4757;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

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

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    70% {
        opacity: 1;
        transform: translateY(5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes rotateIn {
    0% { transform: rotate(0deg) scale(0); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes textFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes itemFadeIn {
    0% { opacity: 0; transform: translateX(-10px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes dotPulse {
    0% { transform: scale(0.8); }
    100% { transform: scale(1.2); }
}

@keyframes footerFadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes btnGlow {
    0% { box-shadow: 0 0 5px rgba(255, 105, 180, 0.5); }
    100% { box-shadow: 0 0 15px rgba(255, 105, 180, 0.8); }
}

@keyframes starTwinkle {
    0% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) scale(0);
        filter: blur(1px);
    }
}