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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
}

#app {
    max-width: 750px;
    margin: 0 auto;
    min-height: 100vh;
    background: #f8f9fa;
}

.header {
    background: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #667eea;
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.header-btn:hover {
    background: #e8eaf0;
    transform: scale(1.05);
}

.input-section {
    padding: 20px;
}

.input-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

#expenseInput {
    width: 100%;
    border: 2px solid #e8eaf0;
    border-radius: 12px;
    padding: 15px;
    font-size: 15px;
    resize: none;
    font-family: inherit;
    transition: border-color 0.3s;
    line-height: 1.6;
}

#expenseInput:focus {
    outline: none;
    border-color: #667eea;
}

.input-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.voice-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.voice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.3);
}

.voice-btn.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

.processing-status {
    padding: 20px;
}

.loading-animation {
    background: white;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#statusText {
    color: #666;
    font-size: 15px;
}

.result-preview {
    margin: 0 20px 20px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    animation: slideUp 0.3s;
}

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

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.preview-header h3 {
    font-size: 18px;
    color: #333;
}

.edit-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-btn:hover {
    background: #e0e0e0;
}

.preview-content {
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #999;
    font-size: 14px;
}

.info-value {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.amount-value {
    color: #667eea;
    font-size: 20px;
    font-weight: bold;
}

.confirm-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.search-section {
    padding: 0 20px 15px;
}

.search-bar {
    position: relative;
    margin-bottom: 12px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

#searchInput {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e8eaf0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: #e8eaf0;
    border-radius: 50%;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.clear-search:hover {
    background: #d0d0d0;
}

.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 16px;
    background: white;
    border: 2px solid #e8eaf0;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.chip:hover {
    border-color: #667eea;
    color: #667eea;
}

.chip.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.sort-options {
    display: flex;
    justify-content: flex-end;
}

.sort-options select {
    padding: 8px 12px;
    border: 2px solid #e8eaf0;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.sort-options select:focus {
    outline: none;
    border-color: #667eea;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 20px 15px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-number {
    font-size: 22px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #999;
}

.records-section {
    padding: 0 20px 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 18px;
    color: #333;
}

.record-count {
    font-size: 13px;
    color: #999;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.record-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.record-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left-color: #667eea;
}

.record-item.highlight {
    background: #fff9e6;
    border-left-color: #ffc107;
}

.record-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.record-category {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.category-travel { background: #e3f2fd; }
.category-meal { background: #fff3e0; }
.category-transport { background: #f3e5f5; }
.category-office { background: #e8f5e9; }
.category-other { background: #fce4ec; }

.category-info {
    display: flex;
    flex-direction: column;
}

.category-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.record-date {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.record-amount {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

.record-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.5;
}

.record-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #bbb;
}

.record-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.status-submitted {
    background: #e3f2fd;
    color: #2196f3;
}

.status-approved {
    background: #e8f5e9;
    color: #4caf50;
}

.status-rejected {
    background: #ffebee;
    color: #f44336;
}

.load-more {
    text-align: center;
    padding: 15px;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more:hover {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.detail-modal .modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: 20px;
    overflow: hidden;
    animation: scaleIn 0.3s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    background: white;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

.detail-section {
    margin-bottom: 25px;
    background: #fafafa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h3::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e8eaf0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.detail-value {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.detail-description {
    padding: 15px;
    background: white;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.8;
    color: #555;
    border: 1px solid #e8eaf0;
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.detail-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-btn {
    background: #ffebee;
    color: #f44336;
    border: 2px solid #ffcdd2;
}

.delete-btn:hover {
    background: #ffcdd2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
}

.voice-modal .modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 40px 30px;
    animation: scaleIn 0.3s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.voice-interface {
    text-align: center;
}

.voice-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.voice-icon:hover {
    transform: scale(1.1);
}

.voice-icon.recording {
    animation: recordingPulse 1s infinite;
}

@keyframes recordingPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 87, 108, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(245, 87, 108, 0);
    }
}

.voice-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    min-height: 24px;
}

.voice-waves {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
    margin: 20px 0;
}

.wave {
    width: 4px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.wave:nth-child(1) { animation-delay: 0s; height: 20px; }
.wave:nth-child(2) { animation-delay: 0.1s; height: 30px; }
.wave:nth-child(3) { animation-delay: 0.2s; height: 40px; }
.wave:nth-child(4) { animation-delay: 0.3s; height: 30px; }
.wave:nth-child(5) { animation-delay: 0.4s; height: 20px; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

.stop-voice-btn {
    padding: 12px 30px;
    background: #f5576c;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.stop-voice-btn:hover {
    background: #e04559;
    transform: scale(1.05);
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 15px;
    z-index: 2000;
    animation: toastFade 2s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes toastFade {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.empty-text {
    font-size: 14px;
}

@media (max-width: 480px) {
    .input-actions {
        flex-direction: column;
    }
    
    .stats-overview {
        gap: 8px;
    }
    
    .stat-number {
        font-size: 18px;
    }
    
    .filter-chips {
        gap: 6px;
    }
    
    .chip {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .modal.show {
        padding: 10px;
    }
    
    .detail-modal .modal-content {
        max-height: 90vh;
    }
    
    .modal-body {
        max-height: calc(90vh - 80px);
       padding: 20px;
    }
    
    .detail-section {
        padding: 15px;
    }
}