:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --text-primary: #d4af37;
    --text-secondary: #b8960c;
    --accent-gold: #d4af37;
    --accent-red: #ff4444;
    --accent-green: #44ff44;
    --border-color: #2a2a3a;
    --shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 480px;
    margin: 0 auto;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-logo {
    width: 100px;
    height: 100px;
    border: 8px solid var(--bg-secondary);
    border-top: 8px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    color: var(--accent-gold);
    font-size: 28px;
    margin-bottom: 5px;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.language-selector {
    text-align: right;
    margin-bottom: 20px;
}

.language-selector select {
    padding: 8px 12px;
    border-radius: 6px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

.form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input, select, textarea {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
}

button {
    padding: 14px;
    border: none;
    border-radius: 8px;
    background-color: var(--accent-gold);
    color: #000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background-color: #e6c148;
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

button.secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

button.secondary:hover {
    background-color: var(--bg-card);
    border-color: var(--accent-gold);
}

button.danger {
    background-color: var(--accent-red);
    color: #fff;
}

button.danger:hover {
    background-color: #ff5555;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.hidden {
    display: none !important;
}

.balance {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.balance h2 {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 10px;
}

.balance p {
    color: var(--accent-gold);
    font-size: 42px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.balance .id-card {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.copy-btn {
    padding: 4px 8px;
    font-size: 12px;
    background: none;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    border-radius: 4px;
    cursor: pointer;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.actions button {
    padding: 12px;
    font-size: 14px;
}

.transaction-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.transaction-info {
    flex: 1;
}

.transaction-type {
    font-weight: 600;
    margin-bottom: 3px;
}

.transaction-type.income {
    color: var(--accent-green);
}

.transaction-type.expense {
    color: var(--accent-red);
}

.transaction-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.transaction-amount {
    font-weight: 700;
    font-size: 18px;
}

.transaction-actions {
    margin-left: 10px;
}

.cancel-btn {
    padding: 6px 10px;
    font-size: 12px;
    background-color: var(--accent-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.ranking-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.ranking-position {
    font-weight: 700;
    font-size: 20px;
    width: 40px;
    text-align: center;
}

.ranking-position.top1 {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.ranking-position.top2 {
    color: #c0c0c0;
}

.ranking-position.top3 {
    color: #cd7f32;
}

.ranking-name {
    flex: 1;
    margin-left: 15px;
    font-weight: 600;
}

.ranking-balance {
    font-weight: 700;
    color: var(--accent-gold);
}

.admin-form {
    margin-bottom: 25px;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.admin-form h3 {
    margin-bottom: 15px;
    color: var(--accent-gold);
}

.user-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
}

.user-id {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-balance {
    color: var(--accent-gold);
    font-weight: 700;
}

.user-actions {
    margin-left: 10px;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.message.success {
    background-color: rgba(68, 255, 68, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(68, 255, 68, 0.3);
}

.message.error {
    background-color: rgba(255, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.id-card-display {
    background-color: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    border: 1px solid var(--accent-gold);
}

.id-card-display h3 {
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.id-card-display .id-number {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
}

.settings-form {
    margin-top: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-label {
    font-weight: 600;
}

.toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: var(--bg-secondary);
    border-radius: 13px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle.active {
    background-color: var(--accent-gold);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle.active::after {
    transform: translateX(24px);
}

.search-box {
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 25px;
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--accent-gold);
    text-align: center;
}

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

.modal-actions button {
    flex: 1;
}

.birthday-banner {
    background: linear-gradient(45deg, #d4af37, #ffd700);
    color: #000;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .balance p {
        font-size: 36px;
    }
    
    .actions {
        grid-template-columns: 1fr;
    }
}
