/* 个人中心/设置页样式 */
:root {
    --account-bg: #fffaf0;
    --account-text: #5d4037;
    --account-primary: #d84315;
    --account-primary-dark: #bf360c;
    --account-card-bg: #ffffff;
    --account-border: #e5e7eb;
    --account-border-soft: #f3f4f6;
    --account-muted: #6b7280;
    --account-muted-light: #9ca3af;
    --account-danger: #b91c1c;
    --account-danger-bg: #fef2f2;
    --account-danger-border: #fecaca;
    --account-success: #15803d;
    --account-success-bg: #f0fdf4;
    --account-success-border: #bbf7d0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--account-bg);
    color: var(--account-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.account-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--account-bg);
    color: var(--account-text);
}

.account-main {
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.account-title {
    margin: 0 0 2rem;
    font-size: 1.875rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--account-primary);
}

.account-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.account-card {
    background: var(--account-card-bg);
    border: 1px solid var(--account-border-soft);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    padding: 1.5rem;
}

.account-card-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 700;
    color: #1f2937;
}

.account-placeholder {
    color: var(--account-muted);
    text-align: center;
    padding: 2rem 0;
}

.account-footer {
    margin-top: auto;
    background: #f3f4f6;
    color: var(--account-muted);
    text-align: center;
    font-size: 0.875rem;
    padding: 2rem 1.5rem;
}

.record-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.record-list > li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--account-border-soft);
}

.record-list > li:last-child {
    border-bottom: none;
}

.record-meta-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.record-title {
    font-weight: 600;
    color: #111827;
}

.record-time {
    color: var(--account-muted);
    font-size: 0.875rem;
}

.record-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.record-btn {
    border: 1px solid transparent;
    background: #fff;
    color: #374151;
    border-radius: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.record-btn:hover {
    transform: translateY(-1px);
}

.record-btn-view {
    background: #fff7ed;
    color: var(--account-primary);
    border-color: #fed7aa;
}

.record-btn-view:hover {
    background: #ffedd5;
}

.record-btn-export {
    border-color: var(--account-primary);
    color: var(--account-primary);
}

.record-btn-export:hover {
    background: #fff7ed;
}

.record-btn-rename {
    border-color: #d1d5db;
    color: #4b5563;
}

.record-btn-rename:hover {
    background: #f9fafb;
}

.record-btn-delete {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.record-btn-delete:hover {
    background: #fee2e2;
}

.record-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.record-modal.is-hidden,
.is-hidden {
    display: none !important;
}

.record-modal-panel {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
    width: min(100%, 48rem);
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.record-modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--account-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.record-modal-close {
    border: none;
    background: transparent;
    color: var(--account-muted);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.record-modal-close:hover {
    color: #374151;
}

.record-modal-body {
    padding: 1rem;
    overflow: auto;
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.6;
}

.record-detail-summary {
    color: #374151;
    margin-bottom: 0.75rem;
    display: grid;
    gap: 0.25rem;
}

.record-detail-label {
    color: var(--account-muted);
}

.record-detail-strong {
    font-weight: 700;
    color: #111827;
}

.record-detail-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78rem;
    color: #374151;
}

.record-detail-initial {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid #fed7aa;
    background: #fff7ed;
}

.record-detail-initial-title {
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.record-detail-initial-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1rem;
}

.record-detail-kv {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.3rem 0;
    border-bottom: 1px dashed #ffe1c4;
}

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

.record-detail-json {
    margin: 0;
    flex: 1;
    max-height: 180px;
    overflow: auto;
    background: #fff;
    border: 1px solid #fed7aa;
    border-radius: 0.5rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.74rem;
    line-height: 1.45;
    color: #7c2d12;
    white-space: pre-wrap;
    word-break: break-word;
}

.record-detail-multi-line {
    flex: 1;
    white-space: pre-line;
    line-height: 1.65;
    color: #374151;
    word-break: break-word;
    background: transparent;
    padding: 0.1rem 0;
}

.record-detail-table-wrap {
    border: 1px solid var(--account-border);
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
}

.record-detail-table-scroll {
    overflow: auto;
    max-height: 52vh;
}

.record-detail-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.record-detail-table thead {
    position: sticky;
    top: 0;
    background: #f9fafb;
}

.record-detail-table th {
    text-align: left;
    font-weight: 700;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--account-border);
    white-space: nowrap;
}

.record-detail-table td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--account-border-soft);
    white-space: nowrap;
}

.record-detail-table .algo-row-golden {
    background: #fefce8;
}

.record-detail-table .algo-row-fibonacci {
    background: #f0fdf4;
}

.record-detail-table .algo-row-bisection {
    background: #eff6ff;
}

.record-simplex-summary-table td,
.record-simplex-summary-table th {
    vertical-align: top;
}

.record-simplex-expand-btn {
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #374151;
    border-radius: 0.4rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.record-simplex-expand-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.record-simplex-expand-btn.is-open {
    background: #6b7280;
    border-color: #6b7280;
    color: #fff;
}

.record-detail-table tr[data-simplex-detail] td {
    padding: 0.4rem 0.6rem;
    background: #fffdfa;
}

.record-simplex-tableau-wrap {
    margin: 0.35rem 0;
    border: 1px solid #d1d5db;
    border-radius: 0.65rem;
    overflow: auto;
    background: #f9fafb;
}

.record-simplex-tableau {
    width: 100%;
    border-collapse: collapse;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.74rem;
    white-space: nowrap;
}

.record-simplex-tableau th,
.record-simplex-tableau td {
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
}

.record-simplex-tableau th:nth-child(1),
.record-simplex-tableau td:nth-child(1),
.record-simplex-tableau th:nth-child(2),
.record-simplex-tableau td:nth-child(2) {
    text-align: center;
}

.record-simplex-tableau thead th {
    background: #e5e7eb;
    color: #374151;
    position: sticky;
    top: 0;
}

.record-simplex-sigma-row td {
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 700;
}

.record-detail-table-tip {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--account-muted);
    background: #fff;
    border-top: 1px solid var(--account-border);
}

.record-detail-empty {
    color: var(--account-muted);
    font-size: 0.875rem;
}

.account-form {
    max-width: 32rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.account-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.account-field input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.58rem 0.78rem;
    font-size: 0.95rem;
    color: #1f2937;
    background: #fff;
}

.account-field input:focus {
    outline: none;
    border-color: var(--account-primary);
    box-shadow: 0 0 0 3px rgba(216, 67, 21, 0.14);
}

.account-field-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--account-muted);
}

.account-button {
    width: fit-content;
    border: none;
    border-radius: 0.5rem;
    background: var(--account-primary);
    color: #fff;
    font-weight: 600;
    padding: 0.58rem 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.account-button:hover {
    background: var(--account-primary-dark);
}

.account-alert {
    display: none;
    border: 1px solid transparent;
    border-radius: 0.6rem;
    padding: 0.6rem 0.9rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.account-alert.is-visible {
    display: block;
}

.account-alert.is-error {
    color: var(--account-danger);
    background: var(--account-danger-bg);
    border-color: var(--account-danger-border);
}

.account-alert.is-success {
    color: var(--account-success);
    background: var(--account-success-bg);
    border-color: var(--account-success-border);
}

@media (max-width: 768px) {
    .account-main {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .account-title {
        font-size: 1.55rem;
        margin-bottom: 1.35rem;
    }

    .account-card {
        padding: 1rem;
    }

    .record-list > li {
        align-items: flex-start;
    }
}
