::selection {
    background: rgba(240, 192, 64, 0.25);
    color: inherit;
}

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

:root {
    --gold: #f0c040;
    --gold-light: #ffe082;
    --gold-dark: #b8860b;
    --gold-glow: rgba(240, 192, 64, 0.35);
    --blue-accent: #4fc3f7;
    --blue-glow: rgba(79, 195, 247, 0.3);

    --bg-deep: #0a0c1a;
    --bg-panel: rgba(15, 20, 45, 0.85);
    --bg-card: rgba(20, 28, 60, 0.75);
    --bg-card-hover: rgba(30, 45, 90, 0.85);
    --bg-input: rgba(10, 14, 35, 0.7);
    --bg-muted: rgba(255, 255, 255, 0.04);

    --border: rgba(240, 192, 64, 0.25);
    --border-bright: rgba(240, 192, 64, 0.6);
    --border-hover: rgba(240, 192, 64, 0.85);
    --border-blue: rgba(79, 195, 247, 0.4);
    --border-subtle: rgba(255, 255, 255, 0.08);

    --text-main: #e8eaf6;
    --text-muted: #9fa8c0;
    --text-light: #5c6580;

    --radius-sm: 5px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 9999px;

    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-gold: 0 0 18px var(--gold-glow), 0 4px 20px rgba(0, 0, 0, 0.5);

    --transition: 0.2s ease;
    --transition-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    --glass-blur: blur(12px);

    --primary: var(--gold);
    --primary-hover: var(--gold-dark);
    --primary-blue: var(--blue-accent);
    --bg-body: var(--bg-deep);
    --border-normal: var(--border);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(80, 40, 160, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(20, 60, 140, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse at 60% 80%, rgba(100, 20, 100, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.main-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-top: 10px;
    -webkit-overflow-scrolling: touch;
}

.main-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.main-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.main-scroll-area::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 3px;
}

nav {
    height: 60px;
    background: rgba(8, 12, 32, 0.92);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-bright);
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.6), 0 1px 0 var(--gold-glow);
    flex-shrink: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
}

.nav-content {
    width: 100%;
    max-width: 1100px;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    height: 100%;
}

.logo {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2001;
    text-decoration: none;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px var(--gold-glow));
    transition: filter var(--transition);
}

.logo:hover {
    filter: drop-shadow(0 0 14px rgba(240, 192, 64, 0.7));
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 2002;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--bg-muted);
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: var(--transition-bounce);
    box-shadow: 0 0 6px var(--gold-glow);
}

.nav-links {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 280px;
    max-width: 80%;
    height: calc(100vh - 60px);
    background: rgba(8, 12, 32, 0.97);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    flex-direction: column;
    align-items: stretch;
    padding: 1.2rem 0;
    transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3000;
    border-right: 1px solid var(--border);
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.5);
    display: flex;
    gap: 2px;
}

.nav-links.show {
    left: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    text-align: left;
    padding: 0.85rem 2rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--gold);
    background: linear-gradient(90deg, rgba(240, 192, 64, 0.08) 0%, transparent 100%);
    border-left-color: var(--gold);
}

.auth-btns {
    z-index: 2002;
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 768px) {
    .nav-links {
        width: 100%;
        max-width: 100%;
    }
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
}

.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: clamp(1.2rem, 4vw, 2rem);
    border: 1px solid var(--border);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
    opacity: 0.45;
}

.card h2 {
    text-align: center;
    margin-top: -0.5rem;
    margin-bottom: 1.8rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.rank-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 0.8rem;
}

.rank-header h2 {
    font-size: clamp(1.4rem, 4vw, 1.9rem);
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px var(--gold-glow));
    margin: 0;
}

.update-notice {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-light);
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    white-space: nowrap;
    margin: 0 auto 1rem;
    width: fit-content;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.4rem;
    background: linear-gradient(135deg, rgba(240, 192, 64, 0.15), rgba(184, 134, 11, 0.2));
    color: var(--gold-light);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: linear-gradient(135deg, rgba(240, 192, 64, 0.25), rgba(184, 134, 11, 0.32));
    border-color: var(--border-hover);
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
    color: #fff;
}

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

.rank-tabs-wrapper {
    margin-bottom: 1.4rem;
}

.rank-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.8rem;
    justify-content: center;
}

.rank-tab {
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--bg-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.rank-tab:hover {
    border-color: var(--border);
    color: var(--text-main);
}

.rank-tab.active {
    background: linear-gradient(135deg, rgba(240, 192, 64, 0.18), rgba(184, 134, 11, 0.24));
    color: var(--gold-light);
    border-color: var(--border-bright);
    box-shadow: 0 0 8px var(--gold-glow);
}

.tab-btn {
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--bg-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.tab-btn:hover {
    border-color: var(--border);
    color: var(--text-main);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(240, 192, 64, 0.18), rgba(184, 134, 11, 0.24));
    color: var(--gold-light);
    border-color: var(--border-bright);
    box-shadow: 0 0 8px var(--gold-glow);
}

.search-input {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead tr {
    border-bottom: 1px solid var(--border);
}

th {
    text-align: left;
    padding: 0.7rem 1rem;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    vertical-align: middle;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(240, 192, 64, 0.04);
}

tbody tr:last-child td {
    border-bottom: none;
}

.drop-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.drop-item {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-bounce);
    width: 100px;
    height: 115px;
    text-align: center;
    flex-shrink: 0;
}

.drop-item:hover {
    background: rgba(240, 192, 64, 0.07);
    border-color: var(--border-bright);
    box-shadow: var(--shadow-gold);
}

.drop-item img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: -webkit-optimize-contrast;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    margin-bottom: 4px;
}

.modal-content {
    background: linear-gradient(160deg, rgba(12, 18, 50, 0.97) 0%, rgba(8, 12, 35, 0.99) 100%);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    padding: 2rem 2rem 1.6rem;
    width: 360px;
    max-width: 92%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(240, 192, 64, 0.15), 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240, 192, 64, 0.6), transparent);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.4rem;
}

.modal-actions .btn {
    flex: 1;
    justify-content: center;
}

.drop-item-hidden {
    opacity: 0.4;
}

.drop-hidden-tag {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53935;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 5;
}

.drop-name {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.3;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drop-id {
    display: block;
    font-size: 0.65rem;
    color: var(--text-light);
    opacity: 0.8;
    margin-bottom: 2px;
}

.drop-qty {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--blue-accent);
    margin-top: 5px;
    padding: 1px 5px;
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    max-width: 100%;
}

.drop-qty-equipped {
    color: #66bb6a;
    background: rgba(102, 187, 106, 0.08);
    border-color: rgba(102, 187, 106, 0.35);
}

.drop-qty-inbag {
    color: #e8eaf6;
    background: rgba(232, 234, 246, 0.06);
    border-color: rgba(232, 234, 246, 0.3);
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    color: var(--text-light);
    font-size: 0.9rem;
    gap: 12px;
    opacity: 0.7;
}

.empty-state svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.mob-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid;
    white-space: nowrap;
}

.badge-normal {
    color: var(--blue-accent);
    border-color: var(--border-blue);
    background: rgba(79, 195, 247, 0.08);
}

.badge-boss {
    color: var(--gold-light);
    border-color: var(--border-bright);
    background: rgba(240, 192, 64, 0.1);
}

.mob-id-text {
    font-size: 0.78rem;
    color: var(--text-light);
}

.elem-badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
}

.elem-badge {
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.elem-badge:hover {
    transform: scale(1.05);
}

.elem-2 {
    color: #ef5350;
    border-color: rgba(239, 83, 80, 0.4);
    background: rgba(239, 83, 80, 0.07);
}

.elem-3 {
    color: #42a5f5;
    border-color: rgba(66, 165, 245, 0.4);
    background: rgba(66, 165, 245, 0.07);
}

.elem-1 {
    color: #66bb6a;
    border-color: rgba(102, 187, 106, 0.4);
    background: rgba(102, 187, 106, 0.07);
}

.elem-undead {
    color: #ce93d8;
    border-color: rgba(206, 147, 216, 0.4);
    background: rgba(206, 147, 216, 0.07);
}