/* 颜色变量已迁移至 ../shared/kanau-tokens.css，
   --primary/--bg-color/--text-main/--card-bg/--border-color
   等旧变量名通过兼容别名继续可用。 */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--kanau-font-body);
    background:
        radial-gradient(circle at 18% 14%, rgba(130, 168, 154, 0.22), transparent 32%),
        radial-gradient(circle at 78% 28%, rgba(137, 42, 58, 0.12), transparent 30%),
        linear-gradient(135deg, #f8f5ef, #e7ded1);
    color: var(--text-main);
    margin: 0;
    max-width: none;
    min-height: 100vh;
    padding: 0;
    width: 100%;
}

body.profile-page.kanau-has-global-topbar {
    padding-top: 0;
}

body.profile-page {
    overflow-x: hidden;
}

.profile-container {
    margin: 0 auto;
    max-width: 760px;
    padding: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) * 2 + 56px) clamp(28px, 6vw, 56px) 132px;
    width: 100%;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
}

.profile-header h1 {
    color: #484b47;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.05;
    margin: 0;
}

.back-link {
    color: #484b47;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary);
}

.settings-card {
    background:
        linear-gradient(rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        var(--card-bg);
    background-size: 28px 28px;
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: 18px;
    box-shadow: 0 28px 90px rgba(83, 78, 70, 0.14);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    padding: clamp(18px, 3vw, 34px);
}

.current-user-card {
    border-bottom: 2px solid #d7d0c5;
    margin-bottom: 24px;
    padding-bottom: 18px;
    text-align: left;
}

.current-user-card h2 {
    color: #777d74;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
    text-transform: uppercase;
}

.current-user-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.current-user-list div {
    display: grid;
    grid-template-columns: minmax(96px, 0.35fr) 1fr;
    gap: 12px;
    align-items: baseline;
}

.current-user-list dt {
    color: #777d74;
    font-size: 12px;
    font-weight: 800;
}

.current-user-list dd {
    color: #33352f;
    font-size: 14px;
    font-weight: 800;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.current-user-id-row dd {
    color: #8b8177;
    font-family: var(--kanau-font-mono);
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .profile-container {
        max-width: 100%;
        padding: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) * 2 + 44px) 24px 120px;
    }

    .current-user-list div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 800;
    font-size: 12px;
    color: #777d74;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.82);
    color: #33352f;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.save-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.2s, transform 0.1s;
}

.save-btn:hover {
    opacity: 0.9;
}

.save-btn:active {
    transform: scale(0.98);
}

.save-message {
    display: none;
    text-align: center;
    color: #4d7555;
    font-weight: 800;
    margin-top: 15px;
    font-size: 14px;
}

.learning-language-section {
    border-top: 2px solid #d7d0c5;
    margin-top: 28px;
    padding-top: 18px;
    text-align: left;
}

.learning-language-head,
.learning-language-panel-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.learning-language-head h2,
.learning-language-panel-head h3 {
    color: #777d74;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0;
    text-transform: uppercase;
}

.learning-add-btn,
.learning-edit-btn,
.learning-delete-btn,
.learning-close-btn {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    min-height: 32px;
    padding: 0 12px;
}

.learning-add-btn,
.learning-edit-btn {
    background: var(--primary);
    color: #fff;
}

.learning-delete-btn,
.learning-close-btn {
    background: #f2ece3;
    color: #8b8177;
}

.learning-language-message {
    color: #8b8177;
    font-size: 13px;
    font-weight: 700;
    min-height: 18px;
}

.learning-language-list {
    display: grid;
    gap: 10px;
}

.learning-language-card,
.learning-language-panel {
    background: rgba(255, 253, 247, 0.88);
    border: 1px solid #e5dfd6;
    border-radius: 8px;
    padding: 12px;
}

.learning-language-card {
    display: grid;
    gap: 8px;
}

.learning-language-title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.learning-language-title strong {
    color: #33352f;
    font-size: 16px;
    font-weight: 900;
}

.learning-primary-badge {
    background: #e8f1df;
    border-radius: 999px;
    color: #4d7555;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 8px;
}

.learning-language-meta {
    color: #777d74;
    font-size: 13px;
    font-weight: 800;
}

.learning-language-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.learning-language-panel {
    margin-top: 12px;
}

.learning-primary-toggle {
    align-items: center;
    color: #33352f;
    display: flex;
    font-size: 14px;
    font-weight: 800;
    gap: 8px;
    margin: 4px 0 12px;
}

.mentor-section {
    border-top: 2px solid #d7d0c5;
    margin-top: 28px;
    padding-top: 18px;
    text-align: left;
}

.mentor-section h2 {
    color: #777d74;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0 0 14px;
    text-transform: uppercase;
}

.mentor-form {
    display: grid;
    gap: 2px;
}

.mentor-message {
    color: #4d7555;
    font-size: 13px;
    font-weight: 800;
    min-height: 18px;
}

.mentor-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.mentor-card {
    border: 1px solid #e5dfd6;
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.88);
    padding: 12px;
}

.mentor-card strong,
.mentor-card span {
    display: block;
}

.mentor-card span {
    color: #777d74;
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

.mentor-card button,
.mentor-card a {
    align-items: center;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: center;
    margin-top: 10px;
    min-height: 34px;
    padding: 0 12px;
    text-decoration: none;
}

.mentor-card button {
    background: var(--primary);
    color: #fff;
}

.mentor-card a {
    background: #d4a373;
    color: #fff;
}

.support-links {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 2px solid #d7d0c5;
    text-align: left;
}

.support-links h2 {
    color: #777d74;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.support-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    padding: 0 2px;
    border-bottom: 1px solid #e5dfd6;
    color: #33352f;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.support-links a:last-child {
    border-bottom: 0;
}

.support-links a:hover {
    color: var(--primary);
}

.settings-arrow {
    color: #c8c2b8;
    font-size: 22px;
    line-height: 1;
}

/* ボトムナビゲーション（Community と同じ浮き上がり型） */
.profile-page .bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(4, minmax(74px, 1fr));
    gap: 4px;
    padding: 8px;
    width: auto;
    max-width: calc(100vw - 24px);
    background: rgba(255, 253, 247, 0.93);
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 999px;
    box-shadow: 0 5px 20px rgba(75, 68, 58, 0.08);
    z-index: 95;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.profile-page .nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    border: 0;
    border-radius: 99px;
    background: none;
    color: #52665d;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.profile-page .nav-btn.active,
.profile-page .nav-btn:hover {
    background: rgba(130, 168, 154, 0.2);
    color: #244d39;
}

.profile-page .nav-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-page .nav-label {
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .profile-page .bottom-nav {
        bottom: 16px;
        width: calc(100vw - 24px);
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .profile-page .nav-btn {
        padding: 8px 6px;
        min-width: 0;
    }

    .profile-page .nav-label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 360px) {
    .profile-page .nav-btn {
        padding: 8px 4px;
    }

    .profile-page .nav-label {
        font-size: 10px;
    }
}
