/* 基础样式重置 */
* {
    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%);
    min-height: 100vh;
    line-height: 1.6;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 300;
}

.current-month {
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-month span {
    font-size: 1.1rem;
    font-weight: 500;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    min-height: 40px;
    touch-action: manipulation;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.75;
    transform: none !important;
}

.btn-primary {
    background: #4caf50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #2196f3;
    color: white;
}

.btn-secondary:hover {
    background: #1976d2;
    transform: translateY(-1px);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.btn-large {
    padding: 12px 24px;
    font-size: 1rem;
}

/* 标签页样式 */
.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px 10px;
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    min-height: 48px;
}

.tab-btn.active {
    background: white;
    border-bottom-color: #667eea;
    color: #667eea;
    font-weight: 500;
}

.tab-btn:hover:not(.active) {
    background: #eeeeee;
}

/* 标签内容样式 */
.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

/* 资产概览样式 */
.asset-overview {
    margin-bottom: 30px;
}

.asset-overview h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.asset-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.asset-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.asset-card:hover {
    transform: translateY(-2px);
}

.asset-card.xiaoxiao {
    border-left: 4px solid #e91e63;
}

.asset-card.yunyun {
    border-left: 4px solid #2196f3;
}

.asset-card.combined {
    border-left: 4px solid #ff9800;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.user-avatar {
    font-size: 1.5rem;
}

.user-name {
    font-weight: 500;
    color: #333;
}

.asset-amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 8px;
}

.asset-change {
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.asset-change.positive {
    background: #e8f5e8;
    color: #2e7d32;
}

.asset-change.negative {
    background: #ffebee;
    color: #d32f2f;
}

.asset-change.neutral {
    background: #f5f5f5;
    color: #666;
}

/* 图表容器样式 */
.trend-preview {
    margin-bottom: 30px;
}

.trend-preview h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 记账页面样式 */
.record-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.record-date {
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.record-date label {
    font-weight: 500;
    margin-right: 10px;
}

.form-input, .form-select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    min-height: 40px;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #667eea;
}

.users-record {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.user-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.user-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.1rem;
}

.xiaoxiao-section {
    border-left: 4px solid #e91e63;
}

.yunyun-section {
    border-left: 4px solid #2196f3;
}

.accounts-input {
    display: grid;
    gap: 15px;
}

.platform-group {
    border: 1px solid #d9e2f2;
    border-radius: 10px;
    background: white;
    overflow: hidden;
}

.platform-group-header {
    width: 100%;
    border: none;
    background: linear-gradient(135deg, #f5f8ff 0%, #eff4ff 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
}

.platform-group-left,
.platform-group-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.platform-group-icon {
    font-size: 1rem;
}

.platform-group-name {
    font-weight: 700;
    color: #27364f;
}

.platform-group-count {
    font-size: 0.72rem;
    color: #5b6b87;
    background: #e8eefc;
    border-radius: 999px;
    padding: 2px 8px;
}

.platform-group-total {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1f6d36;
}

.platform-group-toggle {
    color: #445b87;
    transition: transform 0.2s ease;
}

.platform-group-products {
    display: grid;
    gap: 8px;
    padding: 10px 12px 12px;
}

.platform-group.collapsed .platform-group-products {
    display: none;
}

.platform-group.collapsed .platform-group-toggle {
    transform: rotate(-90deg);
}

.account-input-group {
    display: grid;
    grid-template-columns: 30px minmax(160px, 1fr) auto 120px;
    align-items: center;
    gap: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e5eaf4;
    border-radius: 8px;
    padding: 8px 10px;
}

.account-icon {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
}

.account-label-wrap {
    display: grid;
    gap: 2px;
}

.account-platform {
    font-size: 0.75rem;
    color: #667085;
    line-height: 1.2;
}

.account-label {
    font-weight: 500;
    color: #3f3f46;
    line-height: 1.3;
}

.account-stock-code-tag {
    font-size: 0.72rem;
    color: #4b5563;
    background: #eef3ff;
    border: 1px solid #d6e2ff;
    border-radius: 999px;
    padding: 1px 7px;
    width: fit-content;
}

.account-currency {
    font-size: 0.75rem;
    color: #475467;
    background: #eef3ff;
    border: 1px solid #d6e2ff;
    border-radius: 999px;
    padding: 2px 8px;
    justify-self: start;
}

.account-input {
    width: 120px;
    text-align: right;
}

.stock-quote-info {
    grid-column: 2 / -1;
    margin-top: -3px;
    font-size: 0.75rem;
    color: #667085;
    line-height: 1.35;
}

.stock-quote-info.loading {
    color: #8a6100;
}

.stock-quote-info.ready {
    color: #1f6d36;
}

.stock-quote-info.error {
    color: #b42318;
}

.empty-user-accounts {
    color: #667085;
    background: white;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.9rem;
}

.user-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: right;
    color: #2e7d32;
}

.record-summary {
    background: #e3f2fd;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.fx-status {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: left;
    border: 1px solid #d6e2ff;
    background: #eef3ff;
    color: #445b87;
}

.fx-status.loading {
    border-color: #ffe2a8;
    background: #fff9e8;
    color: #8a6100;
}

.fx-status.ready {
    border-color: #cce8d2;
    background: #edf8ef;
    color: #1f6d36;
}

.fx-status.error {
    border-color: #ffcdd2;
    background: #fff0f2;
    color: #b42318;
}

.fx-status.idle {
    border-color: #d6e2ff;
    background: #eef3ff;
    color: #445b87;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 20px;
}

/* 分析页面样式 */
.analysis-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.time-range {
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.time-range label {
    font-weight: 500;
    margin-right: 10px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.chart-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    min-height: 380px;
}

.chart-item h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.1rem;
    text-align: center;
}

.chart-item canvas {
    max-width: 100% !important;
    max-height: 300px !important;
    width: 100% !important;
    height: 300px !important;
}

.analysis-insights {
    margin-bottom: 24px;
    border: 1px solid #e1e8f4;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    padding: 16px;
}

.analysis-insights-header h3 {
    margin-bottom: 6px;
    color: #1f2a44;
    font-size: 1.05rem;
}

.analysis-insights-header p {
    color: #516079;
    font-size: 0.9rem;
}

.analysis-overview-strip {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.analysis-overview-item {
    background: #f5f8ff;
    border: 1px solid #dbe6ff;
    border-radius: 8px;
    padding: 10px 12px;
    color: #334155;
    font-size: 0.88rem;
}

.analysis-overview-item strong {
    color: #1f2a44;
}

.analysis-overview-item .good {
    color: #1565c0;
    font-weight: 700;
}

.analysis-overview-item .bad {
    color: #c62828;
    font-weight: 700;
}

.analysis-insight-content {
    margin-top: 14px;
    display: grid;
    gap: 14px;
}

.analysis-empty {
    padding: 14px;
    border-radius: 8px;
    background: #f8f9fa;
    color: #667085;
    border: 1px dashed #c9d3e5;
}

.analysis-scope-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.analysis-scope-card {
    border: 1px solid #e1e8f4;
    border-radius: 10px;
    padding: 14px;
    background: #ffffff;
}

.analysis-scope-card.scope-xiaoxiao {
    border-top: 4px solid #e91e63;
}

.analysis-scope-card.scope-yunyun {
    border-top: 4px solid #2196f3;
}

.analysis-scope-card.scope-combined {
    border-top: 4px solid #ff9800;
    background: linear-gradient(180deg, #fffaf3 0%, #ffffff 42%);
}

.analysis-scope-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.analysis-scope-title {
    color: #1f2a44;
    font-weight: 700;
}

.analysis-scope-meta {
    color: #5b6b87;
    font-size: 0.78rem;
    margin-top: 2px;
}

.analysis-scope-total {
    color: #166534;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.analysis-block + .analysis-block {
    margin-top: 10px;
}

.analysis-block-title {
    color: #27364f;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.allocation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 12px;
}

.allocation-table th,
.allocation-table td {
    border-bottom: 1px solid #edf1f8;
    padding: 6px 4px;
    text-align: left;
    vertical-align: top;
}

.allocation-table th {
    color: #44526b;
    font-weight: 700;
}

.allocation-table td {
    color: #334155;
}

.allocation-diff {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 700;
    font-size: 0.75rem;
}

.allocation-diff.balanced {
    color: #1f6d36;
    background: #eaf7ed;
}

.allocation-diff.over {
    color: #9a3412;
    background: #fff2e8;
}

.allocation-diff.under {
    color: #1d4ed8;
    background: #eef4ff;
}

.analysis-holdings {
    margin-bottom: 12px;
}

.holding-tag-group {
    border: 1px solid #edf1f8;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.holding-tag-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: #f8faff;
    font-size: 0.8rem;
    font-weight: 700;
    color: #27364f;
}

.holding-tag-list {
    list-style: none;
    margin: 0;
    padding: 6px 10px;
    display: grid;
    gap: 4px;
}

.holding-tag-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.78rem;
    color: #334155;
}

.holding-name {
    flex: 1;
    min-width: 0;
}

.holding-value {
    color: #14532d;
    font-weight: 700;
    white-space: nowrap;
}

.analysis-period {
    border-radius: 8px;
    border: 1px solid #edf1f8;
    background: #fafcff;
    padding: 8px 10px;
}

.analysis-period-main {
    font-size: 0.82rem;
    color: #334155;
}

.analysis-period-main .positive {
    color: #1f6d36;
    font-weight: 700;
}

.analysis-period-main .negative {
    color: #b42318;
    font-weight: 700;
}

.analysis-period-detail {
    margin-top: 6px;
    display: grid;
    gap: 4px;
    font-size: 0.76rem;
    color: #516079;
}

/* 设置页面样式 */
.settings-section h2 {
    margin-bottom: 30px;
    color: #333;
}

.setting-group {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.setting-group h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.account-types {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.settings-owner-group {
    border: 1px solid #dce3f0;
    border-radius: 10px;
    background: white;
    overflow: hidden;
}

.settings-owner-title {
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2a44;
    background: linear-gradient(135deg, #f7f9ff 0%, #eef3ff 100%);
    border-bottom: 1px solid #e4eaf7;
}

.settings-owner-platforms {
    display: grid;
}

.settings-platform-group {
    border-bottom: 1px solid #edf1f8;
}

.settings-platform-group:last-child {
    border-bottom: none;
}

.settings-platform-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fafcff;
    border-bottom: 1px solid #edf1f8;
}

.settings-platform-icon {
    font-size: 1rem;
}

.settings-platform-name {
    font-weight: 600;
    color: #344054;
}

.settings-platform-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.settings-platform-count {
    font-size: 0.72rem;
    color: #667085;
}

.settings-platform-add-btn {
    padding: 4px 8px;
    font-size: 0.72rem;
    line-height: 1.2;
    min-height: 28px;
}

.settings-platform-products {
    display: grid;
    gap: 8px;
    padding: 8px;
    background: #ffffff;
}

.account-type-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.account-type-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.account-type-icon {
    font-size: 1.2rem;
    line-height: 1.2;
    margin-top: 1px;
}

.account-type-main {
    display: grid;
    gap: 4px;
}

.account-type-title {
    color: #1f2937;
    font-weight: 600;
}

.account-type-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.account-type-meta span {
    font-size: 0.75rem;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 2px 8px;
}

.account-type-meta .allocation-tag-badge {
    color: #fff;
    font-weight: 600;
}

.account-type-meta .allocation-tag-badge.tag-flexible {
    background: #2e7d32;
}

.account-type-meta .allocation-tag-badge.tag-stable {
    background: #1565c0;
}

.account-type-meta .allocation-tag-badge.tag-aggressive {
    background: #c62828;
}

.account-type-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.allocation-tag-select {
    min-width: 118px;
    padding: 4px 8px;
    font-size: 0.8rem;
}

.account-type-actions .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.account-mgmt-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.data-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.sync-config-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 15px;
}

.sync-bound-info {
    color: #4f5d75;
    background: #eef3ff;
    border: 1px solid #d6e2ff;
    border-radius: 8px;
    padding: 10px 12px;
}

.sync-field {
    display: grid;
    gap: 6px;
}

.sync-field label {
    font-weight: 500;
    color: #444;
}

.sync-checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.sync-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.sync-status {
    background: white;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e3e7ef;
}

.sync-status p {
    margin-bottom: 4px;
    color: #666;
}

.sync-status p:last-child {
    margin-bottom: 0;
}

.system-info p {
    margin-bottom: 5px;
    color: #666;
}

/* 最近记录样式 */
.recent-records h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.records-list {
    display: grid;
    gap: 15px;
}

.record-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

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

.record-date {
    font-weight: 500;
    color: #666;
}

.record-amount {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2e7d32;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 14px;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: left;
    }

    .header h1 {
        font-size: 1.3rem;
    }
    
    .current-month {
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }

    .current-month span {
        font-size: 1rem;
    }

    #newRecordBtn {
        width: 100%;
    }

    .tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        border-top: 1px solid #e0e0e0;
        border-bottom: 0;
    }

    .tab-btn {
        min-width: 0;
        white-space: normal;
        padding: 12px 8px;
        border-bottom: 1px solid #dce2f0;
        border-right: 1px solid #dce2f0;
        font-size: 0.95rem;
    }

    .tab-btn:nth-child(2n) {
        border-right: none;
    }

    .tab-btn:nth-last-child(-n + 2) {
        border-bottom: none;
    }

    .tab-btn.active {
        box-shadow: inset 0 -3px 0 #667eea;
    }

    .tab-content {
        padding: 14px;
    }
    
    .asset-cards {
        grid-template-columns: 1fr;
    }
    
    .users-record {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .chart-container {
        padding: 12px;
    }

    .chart-item {
        min-height: 320px;
        padding: 14px;
    }

    .chart-item h3 {
        margin-bottom: 12px;
    }

    .chart-item canvas {
        height: 240px !important;
    }

    .analysis-insights {
        padding: 12px;
    }

    .analysis-overview-strip {
        grid-template-columns: 1fr;
    }

    .analysis-scope-grid {
        grid-template-columns: 1fr;
    }

    .analysis-scope-head {
        flex-direction: column;
        gap: 6px;
    }

    .analysis-scope-total {
        white-space: normal;
    }
    
    .data-actions {
        flex-direction: column;
    }

    .data-actions .btn,
    .sync-actions .btn {
        width: 100%;
    }

    .record-date label,
    .time-range label {
        display: block;
        margin-right: 0;
        margin-bottom: 8px;
    }

    .record-date .form-input,
    .time-range .form-select,
    .sync-field .form-input,
    #supabaseEmail {
        width: 100%;
    }

    .user-section {
        padding: 14px;
    }

    .platform-group-header {
        padding: 8px 10px;
    }

    .platform-group-count {
        display: none;
    }

    .platform-group-products {
        padding: 8px;
    }

    .account-input-group {
        display: grid;
        grid-template-columns: 30px 1fr auto;
        gap: 8px 10px;
    }

    .account-label {
        font-size: 0.9rem;
    }

    .account-label-wrap {
        align-self: center;
    }

    .account-currency {
        align-self: center;
    }

    .account-input {
        width: 100%;
        grid-column: 1 / -1;
        text-align: left;
        font-size: 1rem;
    }

    .stock-quote-info {
        grid-column: 1 / -1;
        margin-top: -2px;
    }

    .user-total {
        text-align: left;
        font-size: 1rem;
    }

    .record-summary {
        position: sticky;
        bottom: 8px;
        z-index: 20;
        text-align: left;
        padding: 14px;
        box-shadow: 0 10px 24px rgba(25, 118, 210, 0.2);
    }

    .total-amount {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .fx-status {
        font-size: 0.8rem;
    }

    #saveRecordBtn {
        width: 100%;
    }

    .record-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .record-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .settings-platform-header {
        padding: 8px 10px;
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .settings-platform-actions {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    .settings-platform-add-btn {
        font-size: 0.7rem;
    }

    .settings-platform-products {
        padding: 6px;
    }

    .account-type-item {
        flex-direction: column;
        gap: 10px;
    }

    .account-type-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .allocation-tag-select {
        flex: 1;
        min-width: 120px;
    }

    .account-mgmt-actions {
        flex-direction: column;
    }

    .account-mgmt-actions .btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 8% auto;
        width: 96%;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)) !important;
    }
}

/* 账户添加弹窗特殊样式 */
.icon-btn:hover {
    border: 2px solid #667eea !important;
    background: #f8f9ff !important;
    transform: scale(1.05);
}

.color-btn:hover {
    transform: scale(1.15) !important;
    border: 3px solid #333 !important;
}

/* 选中状态样式 */
.icon-btn.selected {
    border: 2px solid #667eea !important;
    background: #f3f4ff !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.color-btn.selected {
    border: 3px solid #333 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 图标网格滚动条样式 */
.icon-grid::-webkit-scrollbar {
    width: 6px;
}

.icon-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.icon-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.icon-grid::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 自定义输入框样式 */
#customIcon {
    font-size: 16px;
    text-align: center;
}

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

#customColor {
    cursor: pointer;
}

#customColor::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

#customColor::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: 2px;
}

/* 选中指示器样式 */
#selectedIcon {
    transition: all 0.2s;
}

#selectedColor {
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
    .app {
        margin: 0;
        border-radius: 0;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.15rem;
    }

    .current-month {
        gap: 8px;
    }

    .tab-btn {
        font-size: 0.88rem;
        padding: 10px 6px;
        min-height: 44px;
    }

    .account-input-group {
        gap: 6px 8px;
    }
    
    .account-input {
        width: 100%;
    }

    .record-summary {
        bottom: 0;
        border-radius: 10px;
    }
}