:root {
    --bg-primary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-hover: #f1f3f4;
    --bg-input: #f8f9fa;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #80868b;
    --border-color: #dadce0;
    --border-focus: #1a73e8;
    --accent-blue: #1a73e8;
    --accent-blue-hover: #1557b0;
    --accent-blue-light: #e8f0fe;
    --accent-red: #d93025;
    --accent-red-hover: #b3261e;
    --accent-green: #1e8e3e;
    --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --shadow-lg: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 6px 20px 6px rgba(60, 64, 67, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50%;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --avatar-size: 88px;
    --avatar-size-mobile: 72px;
}

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

body {
    font-family: 'Roboto', 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 顶部导航栏 ========== */
.top-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
}

.top-nav .logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.top-nav .logo-dot {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0;
}

.logo-dot-1 {
    background: #4285F4;
}

.logo-dot-2 {
    background: #7C4DFF;
}

.logo-dot-3 {
    background: #EA4335;
}

.logo-dot-4 {
    background: #FF9800;
}

.logo-dot-5 {
    background: #FBBC04;
}

.logo-dot-6 {
    background: #8BC34A;
}

.logo-dot-7 {
    background: #34A853;
}


.top-nav .nav-spacer {
    flex: 1;
}

.top-nav .nav-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
    background: #7c4dff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.top-nav .nav-avatar-sm:hover {
    border-color: var(--border-color);
}

/* ========== 主容器 ========== */
.main-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

/* ========== 页面标题区 ========== */
.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 28px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-header .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

/* ========== 头像区域卡片 ========== */
.profile-hero-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 36px 32px 32px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: box-shadow var(--transition-smooth);
}

.profile-hero-card:hover {
    box-shadow: var(--shadow-sm);
}

.avatar-wrapper {
    position: relative;
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: var(--radius-full);
    cursor: pointer;
    margin-bottom: 16px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.avatar-wrapper:hover {
    transform: scale(1.04);
}

.avatar-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    display: block;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-smooth);
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 34px;
    color: #fff;
    letter-spacing: 0;
    user-select: none;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-smooth);
}

.avatar-placeholder.color-1 {
    background: linear-gradient(135deg, #7c4dff, #651fff);
}

.avatar-placeholder.color-2 {
    background: linear-gradient(135deg, #4285f4, #1a73e8);
}

.avatar-placeholder.color-3 {
    background: linear-gradient(135deg, #ea4335, #d93025);
}

.avatar-placeholder.color-4 {
    background: linear-gradient(135deg, #34a853, #1e8e3e);
}

.avatar-placeholder.color-5 {
    background: linear-gradient(135deg, #fbbc04, #f9a825);
}

.avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    background: rgba(32, 33, 36, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.avatar-overlay .camera-icon {
    width: 28px;
    height: 28px;
    fill: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.profile-username-display {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 8px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

/* ========== 通用卡片样式 ========== */
.info-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow var(--transition-smooth);
}

.info-card:hover {
    box-shadow: var(--shadow-sm);
}

.info-card .card-section {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: background var(--transition-fast);
    cursor: default;
}

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

.info-card .card-section.editable {
    cursor: pointer;
}

.info-card .card-section.editable:hover {
    background: var(--bg-hover);
}

.card-section .section-info {
    flex: 1;
    min-width: 0;
}

.card-section .section-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.card-section .section-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 400;
    word-break: break-word;
    line-height: 1.4;
}

.card-section .section-value.placeholder-text {
    color: var(--text-tertiary);
    font-style: italic;
}

.card-section .edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    font-family: 'Google Sans', 'Roboto', sans-serif;
    letter-spacing: 0.01em;
    flex-shrink: 0;
}

.card-section .edit-btn:hover {
    background: var(--accent-blue-light);
    border-color: var(--accent-blue);
    box-shadow: 0 1px 3px rgba(26, 115, 232, 0.2);
}

.card-section .edit-btn:active {
    background: #d2e3fc;
    transform: scale(0.97);
}

.edit-btn .btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 危险操作按钮 */
.card-section .edit-btn.danger-btn {
    color: var(--accent-red);
    border-color: transparent;
    background: transparent;
}

.card-section .edit-btn.danger-btn:hover {
    background: #fce8e6;
    border-color: var(--accent-red);
    box-shadow: 0 1px 3px rgba(217, 48, 37, 0.2);
    color: var(--accent-red-hover);
}

/* ========== 模态框 ========== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(32, 33, 36, 0.55);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 16px;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.modal-backdrop.closing {
    animation: fadeOut 0.18s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-dialog {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modal-dialog.closing {
    animation: slideDown 0.18s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-header h2 {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-close-btn svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

/* ========== 表单元素 ========== */
.form-group {
    margin-bottom: 18px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: 'Roboto', sans-serif;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
    line-height: 1.4;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
    background: #fff;
}

.form-input.error,
.form-textarea.error {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
    max-height: 200px;
}

.form-error-msg {
    font-size: 12px;
    color: var(--accent-red);
    margin-top: 4px;
    display: none;
    font-weight: 400;
}

.form-error-msg.visible {
    display: block;
}

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* 密码强度指示器 */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 8px;
    background: #e0e0e0;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.password-strength .strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-weak {
    width: 25%;
    background: #ea4335;
}

.strength-fair {
    width: 50%;
    background: #fbbc04;
}

.strength-good {
    width: 75%;
    background: #4285f4;
}

.strength-strong {
    width: 100%;
    background: #34a853;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    border-radius: 24px;
    cursor: pointer;
    border: none;
    letter-spacing: 0.01em;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
    min-width: 80px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 1px 3px rgba(26, 115, 232, 0.3);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.4);
}

.btn-primary:disabled {
    background: #a8c7fa;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--accent-blue-light);
    border-color: var(--accent-blue);
}

.btn-danger {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 1px 3px rgba(217, 48, 37, 0.3);
}

.btn-danger:hover {
    background: var(--accent-red-hover);
    box-shadow: 0 2px 6px rgba(217, 48, 37, 0.4);
}

.btn-danger:disabled {
    background: #e8a09a;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-outline.btn-loading::after {
    border-color: rgba(26, 115, 232, 0.3);
    border-top-color: var(--accent-blue);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== Toast 通知 ========== */
.toast-container {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #323232;
    color: #fff;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    text-align: center;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success {
    border-left: 3px solid #34a853;
}

.toast.error {
    border-left: 3px solid #ea4335;
}

.toast.info {
    border-left: 3px solid #4285f4;
}

.toast.removing {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-16px);
    }
}

/* ========== 隐藏文件输入 ========== */
.hidden-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

/* ========== 响应式 ========== */
@media (max-width: 600px) {
    .main-container {
        padding: 20px 16px 48px;
    }

    .profile-hero-card {
        padding: 28px 20px 24px;
        border-radius: var-radius-md;
    }

    .avatar-wrapper {
        width: var(--avatar-size-mobile);
        height: var(--avatar-size-mobile);
    }

    .avatar-placeholder {
        font-size: 28px;
    }

    .profile-username-display {
        font-size: 19px;
    }

    .info-card .card-section {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card-section .edit-btn {
        align-self: flex-end;
    }

    .modal-dialog {
        max-width: 100%;
        margin: 0 8px;
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 16px 18px 12px;
    }

    .modal-body {
        padding: 16px 18px;
    }

    .modal-footer {
        padding: 12px 18px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 0;
        padding: 10px 14px;
        font-size: 13px;
    }

    .btn {
        padding: 9px 18px;
        font-size: 13px;
        border-radius: 20px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .toast {
        font-size: 13px;
        padding: 10px 16px;
        border-radius: 20px;
    }
}

@media (max-width: 380px) {
    .profile-hero-card {
        padding: 22px 14px 20px;
    }

    .avatar-wrapper {
        width: 60px;
        height: 60px;
    }

    .avatar-placeholder {
        font-size: 22px;
    }

    .profile-username-display {
        font-size: 17px;
    }

    .info-card .card-section {
        padding: 14px 16px;
    }

    .modal-header h2 {
        font-size: 16px;
    }
}