:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --gradient-start: #3b82f6;
    --gradient-end: #8b5cf6;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: #94a3b8;
    margin-bottom: 2rem;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

#searchInput {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    font-size: 1.1rem;
    outline: none;
}

#searchBtn {
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#searchBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.hidden {
    display: none !important;
}

#loading {
    margin-top: 1rem;
    color: var(--accent-color);
    font-weight: 500;
}

#stats {
    margin-top: 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.results-container {
    display: grid;
    gap: 1.5rem;
    animation: fadeIn 0.8s ease-out;
}

.result-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.result-code {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-hover);
}

.result-desc {
    font-size: 1.1rem;
    line-height: 1.5;
}

.result-meta {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
    flex-wrap: wrap;
}

.meta-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.result-zh-desc {
    margin-top: 0.75rem;
    color: var(--text-color);
    font-size: 1.05rem;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--accent-color);
    border-radius: 6px;
    line-height: 1.5;
}

.translating-text {
    color: #94a3b8;
    font-style: italic;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.spinner {
    animation: spin 1s linear infinite;
}
