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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 图片预览弹窗样式 */
.image-preview {
    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: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-preview.show {
    opacity: 1;
    pointer-events: auto;
}

.preview-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-content img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: #dc3545;
    color: white;
    padding: 20px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-content {
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 0px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.site-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    vertical-align: middle;
}



.header-left {
    position: absolute;
    top: 10px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
    height: 30px;
}

.reward-icon {
    cursor: pointer;
    transition: transform 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    outline: none;
}

.reward-icon:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.3);
}

.reward-icon span {
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    color: white;
    transition: all 0.3s;
    outline: none;
}

.reward-icon:hover span {
    transform: translateY(-2px);
}

.reward-content {
    position: absolute;
    top: calc(100% + 20px);
    left: 0;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 300px;
    z-index: 1000;
    display: none;
    pointer-events: none;
}

.reward-content.show {
    display: block;
    pointer-events: auto;
}

.reward-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
    text-align: center;
}

.reward-content p {
    margin: 8px 0;
    font-size: 12px;
    color: #666;
    text-align: center;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.reward-methods {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.reward-method {
    text-align: center;
    flex: 1;
}



.reward-qr {
    width: 100%;
    height: 180px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reward-qr img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    margin: 0;
    padding: 0;
}

.header p {
    margin-top: -5px;
    font-size: 0.9em;
    opacity: 0.9;
}

.header-icons {
    position: absolute;
    top: 10px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.about-icon,
.help-icon {
    cursor: pointer;
}

.about-icon span,
.help-icon span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    color: white;
    transition: all 0.3s;
}

.about-icon:hover span,
.help-icon:hover span {
    background-color: rgba(255, 255, 255, 0.3);
}

.about-content,
.help-content {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 400px;
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.help-content {
    right: 0;
}

.help-content.show {
    display: block;
}

.help-content p {
    margin: 0;
    font-size: 12px !important;
    color: #666;
    line-height: 1.5;
    text-align: left;
}

.help-content ul {
    margin: 0;
    padding-left: 20px;
    margin-bottom: 15px;
}

.help-content ul li {
    margin-bottom: 5px;
    font-size: 12px !important;
    color: #666;
}

.about-content.show {
    display: block;
}

.about-content h3 {
    margin-top: 10px;
    font-size: 16px;
    color: #333;
}

.about-content ul {
    margin: 0;
    padding-left: 20px;
    margin-bottom: 15px;
}

.about-content ul li {
    font-size: 12px !important;
    color: #666;
}

.about-content p {
    margin: 0;
    font-size: 12px !important;
    color: #666;
    line-height: 1.5;
}

.input-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.stats-section {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.stats-header {
    margin-bottom: 15px;
    text-align: center;
}

.stats-header h3 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.stats-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    border-color: #dee2e6;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.stat-card.profit-card {
    background: #dc3545;
    color: white;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0px);
    }
}

.stat-card.profit-card .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.stat-card.profit-card .stat-value {
    color: white;
    font-size: 22px;
}

.stat-card.profit-card .stat-value.positive {
    color: #98fb98;
}

.stat-card.profit-card .stat-value.negative {
    color: #ffb6c1;
}

.stat-value.positive {
    color: #dc3545;
}

.stat-value.negative {
    color: #28a745;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    align-self: center;
    margin-left: 10px;
    white-space: normal;
    line-height: 1.5;
    max-width: 100%;
}

.input-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.input-group input {
    flex: 1;
    min-width: 150px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* 隐藏数字输入框的上下箭头 */
.input-group input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.input-group input[type="number"]::-webkit-inner-spin-button,
.input-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-add {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.btn-add:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.4);
}





.fund-list {
    margin-bottom: 30px;
}

.fund-item {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.fund-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.fund-item:last-child {
    margin-bottom: 0;
}



.btn-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-menu:hover {
    background: #f0f0f0;
    color: #666;
}

.btn-menu:active {
    transform: scale(0.9);
    background: #e0e0e0;
}

.menu-popup {
    position: absolute;
    top: 50px;
    right: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 140px;
    white-space: nowrap;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
    font-size: 14px;
}

.menu-item:active {
    transform: scale(0.95);
    background-color: #f0f0f0;
}

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

.menu-item:hover {
    background-color: #f8f9fa;
}

.menu-item.delete {
    color: #e74c3c;
}

.menu-item.delete:hover {
    background-color: #fee;
}

.btn-delete:hover {
    background: #fee;
    color: #e74c3c;
}

.fund-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

.fund-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.fund-code {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.fund-code-section {
    display: flex;
    align-items: center;
}

.fund-update-time {
    font-size: 10px;
    color: #999;
    margin-left: 4px;
}

.code-separator {
    color: #999;
    margin-left: 4px;
}

.fund-highlight {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    margin-bottom: 12px;
}



.change-value {
    font-size: 18px;
}

.value-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.value-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.fund-value-section,
.fund-nav-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.fund-change-section {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.fund-change-section.positive {
    background: #fee;
    color: #e74c3c;
}

.fund-change-section.negative {
    background: #e8f5e9;
    color: #27ae60;
}

.change-icon {
    font-size: 18px;
    font-weight: bold;
}

.change-value {
    font-size: 20px;
}

.fund-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    background: transparent;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.info-item:hover {
    background-color: #e9ecef;
}

.info-label {
    font-size: 13px;
    color: #666;
}

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

.fund-position-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 12px;
    cursor: pointer;
}

.position-item,
.profit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.position-item:hover,
.profit-item:hover {
    background-color: #e9ecef;
}

.position-label,
.profit-label {
    font-size: 13px;
    color: #666;
}

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

.profit-value {
    font-size: 16px;
    font-weight: 600;
}

.profit-value.positive {
    color: #e74c3c;
}

.profit-value.negative {
    color: #27ae60;
}

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

@media (max-width: 480px) {
    .container {
        padding: 15px;
        max-width: 600px;
    }

    .header {
        padding: 35px 20px;
    }



    .input-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .input-group input {
        margin-right: 0;
        margin-bottom: 0;
        flex: 1;
        min-width: 120px;
    }

    .btn-add {
        width: 100%;
        flex: none;
        margin-top: 10px;
    }

    .stats-section {
        padding: 15px;
    }

    .stats-content {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

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

    .stat-value {
        font-size: 16px;
    }

    .stat-card.profit-card .stat-value {
        font-size: 18px;
    }

    .fund-item {
        padding: 18px;
        margin-bottom: 15px;
    }

    .fund-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 15px;
        padding-right: 40px;
    }

    .fund-name {
        font-size: 16px;
        flex: 1;
        width: 100%;
    }

    .fund-code-section {
        flex: none;
        width: 100%;
    }

    .fund-code {
        font-size: 12px;
    }

    .btn-menu {
        position: absolute;
        top: 15px;
        right: 15px;
        z-index: 10;
    }

    .fund-highlight {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        padding: 15px;
    }

    .fund-nav-section,
    .fund-value-section {
        flex: 1;
        min-width: 100px;
    }

    .fund-change-section {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .value-number {
        font-size: 22px;
    }

    .change-value {
        font-size: 16px;
    }

    .fund-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .fund-position-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .modal-content h3 {
        font-size: 16px;
    }
    
    .modal-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .btn-cancel, .btn-confirm {
        flex: 1;
        min-width: 120px;
        padding: 12px;
    }
    
    /* 关于和帮助内容的移动端适配 */
    .about-content,
    .help-content {
        width: 90vw;
        max-width: 400px;
        right: -10px;
    }
    
    /* 打赏按钮的移动端适配 */
    .reward-icon {
        padding: 10px 16px;
        min-height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        outline: none;
    }
    
    .reward-icon span {
        font-size: 12px;
        display: block;
        width: 100%;
        text-align: center;
        outline: none;
    }
}

/* iPad Pro 适配 - 按照 iPhone 12 等比例放大 */
@media (min-width: 1024px) and (max-width: 1366px) {
    .container {
        max-width: 700px;
        padding: 30px;
    }

    .header {
        padding: 50px 30px;
    }



    .header p {
        font-size: 1.3em;
    }

    .input-group input {
        padding: 15px;
        font-size: 18px;
    }

    .btn-add {
        padding: 15px 25px;
        font-size: 18px;
    }

    .fund-name {
        font-size: 20px;
    }

    .fund-code {
        font-size: 15px;
    }

    .value-number {
        font-size: 32px;
    }

    .change-value {
        font-size: 22px;
    }
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    animation: slideIn 0.3s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
    color: #333;
    text-align: center;
}

.modal-content p {
    margin-bottom: 20px;
    color: #666;
    text-align: center;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 12px;
    transition: border-color 0.3s;
}

/* 隐藏数字输入框的上下箭头 */
.modal-content input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.modal-content input[type="number"]::-webkit-inner-spin-button,
.modal-content input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.modal-content input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-error {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
    min-height: 20px;
}

.modal-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 24px;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100%;
    padding: 0 20px;
}

.btn-cancel, .btn-confirm {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 90px;
}

.btn-cancel {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.btn-cancel:hover {
    background-color: #e9ecef;
}

.btn-cancel:active {
    transform: scale(0.95);
    background-color: #dee2e6;
}

.btn-confirm {
    background: #dc3545;
    color: white;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-confirm:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.4);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

