* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: linear-gradient(180deg, #121212 0%, #0a0a0a 100%);
    position: relative;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 20px 20px 15px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 60px;
}

.header-center {
    flex: 1;
    text-align: center;
}

.header-right {
    min-width: 60px;
}

.header-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.app-title {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-content {
    flex: 1;
    padding: 10px 20px 100px;
    overflow-y: auto;
}

.card-section {
    margin-bottom: 25px;
}

.bank-card {
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-inner.flipped {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.08);
    backface-visibility: hidden;
}

.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: rotateY(180deg);
}

.card-back-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 25px;
}

.card-user-section {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 16px;
    padding: 18px 22px;
    border: 1px solid rgba(248, 233, 192, 0.25);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    width: 100%;
    max-width: 310px;
}

.card-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(248, 233, 192, 0.7);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}

.card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.card-username {
    font-size: 18px;
    color: #f8e9c0;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-nickname {
    font-size: 15px;
    color: rgba(248, 233, 192, 0.85);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-balance-section {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 16px;
    padding: 20px 25px;
    border: 1px solid rgba(248, 233, 192, 0.25);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 310px;
}

.card-balance-label {
    font-size: 14px;
    color: rgba(248, 233, 192, 0.75);
    font-weight: 500;
    margin-bottom: 8px;
}

.card-balance-value {
    font-size: 26px;
    color: #f8e9c0;
    font-weight: 700;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.card-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

.card-overlay {
    position: absolute;
    bottom: 105px;
    left: 15px;
    right: 35px;
}

.card-number {
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 3px;
    color: #f8e9c0;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.4),
                 0 0 15px rgba(248, 233, 192, 0.4);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    white-space: nowrap;
    margin-bottom: 12px;
}

.card-balance {
    display: none;
}

.account-info {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-row {
    display: flex;
    gap: 20px;
}

.info-row .info-item {
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.info-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.info-value {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
}

.info-value.amount {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.stats-section {
    margin-bottom: 25px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
}

.stat-item.income .stat-value {
    color: #4ade80;
}

.stat-item.expense .stat-value {
    color: #f87171;
}

.transactions-section {
    margin-bottom: 20px;
}

.transaction-list {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction-remark {
    font-size: 15px;
    font-weight: 500;
    color: #ffffff;
}

.transaction-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.transaction-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.transaction-amount {
    font-size: 16px;
    font-weight: 600;
}

.transaction-amount.income {
    color: #4ade80;
}

.transaction-amount.expense {
    color: #f87171;
}

.transaction-type {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.transaction-item.summary {
    cursor: pointer;
}

.expand-icon {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease;
    margin-left: 6px;
}

.transaction-item.summary.expanded .expand-icon {
    transform: rotate(180deg);
}

.details-container {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: rgba(20, 20, 25, 0.6);
    border-radius: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.transaction-item.summary.expanded .details-container {
    display: block;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-icon {
    font-size: 14px;
}

.detail-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.detail-amount {
    font-size: 13px;
    font-weight: 600;
}

.detail-item.expense .detail-amount {
    color: #f87171;
}

.detail-item.income .detail-amount {
    color: #4ade80;
}

.transaction-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.transaction-type.income {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.transaction-type.expense {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 0 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s;
}

.nav-item.active {
    color: #ffffff;
}

.nav-icon {
    font-size: 22px;
}

.nav-text {
    font-size: 11px;
}

.nav-item.add-btn {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -20px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.nav-item.add-btn .nav-icon {
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

@media (max-width: 375px) {
    .app-title {
        font-size: 22px;
    }
    
    .card-number {
        font-size: 18px;
        letter-spacing: 3px;
    }
    
    .info-value.amount {
        font-size: 16px;
    }
    
    .stat-value {
        font-size: 14px;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.receipt-modal {
    background: #1a1a1f;
    border-radius: 20px;
    width: 100%;
    max-width: 380px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.receipt-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 20px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.receipt-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.receipt-username {
    font-size: 14px;
    font-weight: 500;
    color: #667eea;
    text-align: center;
}

.receipt-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    justify-self: end;
}

.receipt-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.receipt-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 70px);
}

.receipt-info {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.15);
}

.receipt-info-username {
    font-size: 15px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

.receipt-info-date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.receipt-info-remark {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.receipt-item:last-child {
    border-bottom: none;
}

.receipt-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.receipt-item-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.receipt-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.receipt-item-name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
}

.receipt-item-category {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.receipt-item-amount {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.receipt-item-amount.expense {
    color: #ef4444;
}

.receipt-item-amount.income {
    color: #22c55e;
}

.receipt-total {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.receipt-total-left {
    text-align: left;
}

.receipt-total-right {
    text-align: right;
}

.receipt-account-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    margin-bottom: 4px;
}

.receipt-account-card {
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

.receipt-total-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.receipt-total-amount {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.receipt-total-amount.expense {
    color: #ef4444;
}

.receipt-total-amount.income {
    color: #22c55e;
}
