* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    -webkit-font-smoothing: antialiased; /* 优化字体渲染 */
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

header h1 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2em;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.main-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
    padding: 20px;
}

.selection-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.selection-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.card-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.selection-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.card-desc {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2em;
    width: 100%;
    max-width: 300px;
}

.btn-back {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 20px;
    transition: background 0.2s;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.btn-back:hover {
    background: #5a6268;
}

.btn-back:active {
    opacity: 0.9;
}

header {
    position: relative;
}

.price-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.price-control label {
    font-weight: bold;
    color: #555;
}

.price-control input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    width: 150px;
    -webkit-appearance: none; /* 移除iOS默认样式 */
}

.price-control input:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: normal !important;
    user-select: none;
    padding: 8px 12px;
    border-radius: 5px;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    width: 28px;
    height: 28px;
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    border: 3px solid #667eea;
    border-radius: 5px;
    outline: none;
    transition: all 0.3s;
}

.checkbox-label input[type="checkbox"]:checked {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
}

.checkbox-label span {
    color: #555;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-appearance: none; /* 移除iOS默认样式 */
    touch-action: manipulation; /* 优化触摸响应 */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    opacity: 0.9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-danger:active {
    opacity: 0.9;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.wechat-section, .accounts-section, .daily-record-section, .summary-section, .enze-section, .history-section, .compound-section, .enze-wechat-section, .enze-accounts-section, .jinglian-wechat-section, .jinglian-accounts-section, .jinglian-section {
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.jinglian-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.jinglian-info {
    display: flex;
    gap: 30px;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.jinglian-record-section, .jinglian-summary {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.btn-compound-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.btn-compound-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-compound-link:active {
    transform: translateY(0);
    opacity: 0.9;
}

.compound-calculator {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.calc-input-group {
    margin-bottom: 15px;
}

.calc-input-group label {
    display: block;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.calc-input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.calc-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.account-balance {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.account-balance h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.account-balance-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.account-balance-row strong {
    color: #333;
    margin-right: 4px;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.btn-small {
    background: linear-gradient(135deg, #74ebd5 0%, #ACB6E5 100%);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(116, 235, 213, 0.4);
}

.btn-small:active {
    transform: translateY(0);
    opacity: 0.9;
}

.history-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.history-info {
    flex: 1;
}

.history-date {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.history-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    font-size: 14px;
}

.history-details div {
    color: #555;
}

.history-details strong {
    color: #333;
    margin-right: 5px;
}

.history-actions {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.btn-edit {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-edit:active {
    opacity: 0.9;
}

.enze-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.setting-group label {
    font-weight: bold;
    color: #555;
}

.setting-group input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.setting-group input:focus {
    outline: none;
    border-color: #667eea;
}

.enze-info {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.info-item {
    font-size: 16px;
}

.info-item strong {
    color: #555;
    margin-right: 8px;
}

.info-item span {
    color: #667eea;
    font-weight: bold;
}

.enze-record-section, .enze-summary {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.enze-record-section h3, .enze-summary h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.calc-result {
    grid-column: 1 / -1;
    padding: 10px;
    background: #e8f4f8;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 16px;
}

.calc-result strong {
    color: #555;
    margin-right: 8px;
}

.calc-result span {
    color: #667eea;
    font-weight: bold;
}

.wechat-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.wechat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #667eea;
}

.wechat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.wechat-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wechat-info {
    margin-top: 10px;
}

.wechat-info div {
    margin-bottom: 8px;
    font-size: 14px;
}

.account-filter {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-filter label {
    font-weight: bold;
    color: #555;
}

.account-filter select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    min-width: 200px;
}

.account-filter select:focus {
    outline: none;
    border-color: #667eea;
}

.accounts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.account-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.account-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.account-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-info {
    margin-bottom: 10px;
}

.account-info strong {
    color: #555;
    display: inline-block;
    width: 100px;
}

.account-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.account-stats div {
    margin-bottom: 8px;
    font-size: 14px;
}

.record-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.record-form label {
    font-weight: bold;
    color: #555;
    display: block;
    margin-bottom: 5px;
}

.record-form input,
.record-form select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    -webkit-appearance: none; /* 移除iOS默认样式 */
}

.record-form input:focus,
.record-form select:focus {
    outline: none;
    border-color: #667eea;
}

.record-form button {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.summary-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.summary-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item strong {
    color: #555;
}

.summary-item .value {
    font-weight: bold;
    color: #667eea;
}

.summary-item .profit {
    color: #27ae60;
}

.summary-item .loss {
    color: #e74c3c;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 10px;
}

.batch-mode-control {
    margin-bottom: 15px;
    padding: 10px;
    background: #f0f4ff;
    border-radius: 8px;
}

.batch-account-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-top: 10px;
}

.batch-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.batch-group:last-child {
    border-bottom: none;
}

.batch-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
}

.batch-group-header strong {
    flex: 1;
    color: #667eea;
}

.batch-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    padding: 10px;
}

.batch-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.batch-checkbox-label:hover {
    background: #e9ecef;
}

.batch-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: white;
    border: 2px solid #667eea;
    border-radius: 4px;
    outline: none;
    transition: all 0.2s;
    position: relative;
}

.batch-checkbox-label input[type="checkbox"]:checked {
    background: #667eea;
    border-color: #667eea;
}

.batch-checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.batch-checkbox-label span {
    color: #333;
    font-size: 14px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .subtitle {
        font-size: 1em;
    }

    .price-control {
        flex-direction: column;
        gap: 15px;
    }

    .price-control input,
    .price-control button {
        width: 100%;
    }

    .checkbox-label {
        width: 100%;
        justify-content: center;
        padding: 12px;
        background: rgba(255, 255, 255, 0.8);
        border: 2px solid #ddd;
    }

    .checkbox-label input[type="checkbox"] {
        width: 32px;
        height: 32px;
    }

    .checkbox-label input[type="checkbox"]:checked::after {
        font-size: 24px;
    }

    .checkbox-label span {
        font-size: 17px;
    }

    .btn-primary,
    .btn-danger,
    .btn-edit,
    .btn-small,
    .btn-back {
        min-height: 44px; /* iOS最小触摸目标 */
        font-size: 16px;
    }

    .btn-large {
        font-size: 1.1em;
        padding: 18px 40px;
    }

    .main-selection {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }

    .selection-card {
        padding: 30px 20px;
    }

    .card-icon {
        font-size: 3em;
    }

    .selection-card h2 {
        font-size: 1.5em;
    }

    .card-desc {
        font-size: 1em;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .section-header button {
        width: 100%;
    }

    .wechat-list,
    .accounts-list {
        grid-template-columns: 1fr;
    }

    .account-card,
    .wechat-card {
        padding: 15px;
    }

    .account-card h3,
    .wechat-card h3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .account-card h3 button,
    .wechat-card h3 button {
        width: 100%;
    }

    .account-filter {
        flex-direction: column;
        align-items: flex-start;
    }

    .account-filter select {
        width: 100%;
    }

    .record-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .record-form input,
    .record-form select,
    .record-form button {
        width: 100%;
        font-size: 16px; /* 防止iOS缩放 */
    }

    .summary-content {
        grid-template-columns: 1fr;
    }

    .summary-card {
        padding: 15px;
    }

    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .account-balance-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .account-actions {
        flex-direction: column;
    }

    .account-actions button {
        width: 100%;
    }

    .enze-settings {
        gap: 20px;
    }

    .setting-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .setting-group input,
    .setting-group button {
        width: 100%;
    }

    .enze-info {
        flex-direction: column;
        gap: 15px;
    }

    .compound-calculator {
        padding: 15px;
    }

    .calc-input-group input {
        font-size: 16px; /* 防止iOS缩放 */
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .history-details {
        grid-template-columns: 1fr;
    }

    .history-actions {
        width: 100%;
        margin-left: 0;
    }

    .history-actions button {
        flex: 1;
    }

    h2 {
        font-size: 1.3em;
    }

    h3 {
        font-size: 1.1em;
    }

    .calc-result {
        font-size: 14px;
    }

    #main-page {
        background-position: center center;
    }

    .batch-checkboxes {
        grid-template-columns: 1fr;
    }

    .batch-checkbox-label input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    .batch-checkbox-label input[type="checkbox"]:checked::after {
        font-size: 18px;
    }
}

/* 主页面背景图设置 */
#main-page {
    background-image: url('77b6155ae60672849bb3e917c7fa2216.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

#main-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 15px;
    z-index: 0;
}

#main-page header,
#main-page .main-selection {
    position: relative;
    z-index: 1;
}

#main-page header h1 {
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8), 
                 0 0 20px rgba(102, 126, 234, 0.5);
    font-weight: bold;
}

#main-page .subtitle {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

/* 优化选择卡片，让背景透出 */
.selection-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
    border: 3px solid rgba(102, 126, 234, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

