@charset "utf-8";
/* =========================
   guestbook.css
   在线留言 / お問い合わせフォーム
   ========================= */

/* 整体背景 */
.gb-page {
    background-color: #f5f7fb;
    padding: 0px 0 70px;
}

/* 白色卡片主体 */
.gb-inner {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 32px 40px 40px;
    background-color: #ffffff;
    border-radius:0 0 22px 22px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.gb-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    color: #2f3a4a;
}

.gb-desc {
    font-size: 14px;
    line-height: 1.8;
    color: #666;
    margin-bottom: 24px;
}

/* 表单行：左 label + 右 field */
.gb-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 12px 0 16px;
    border-bottom: 1px solid #edf0f7;
}

.gb-row:last-of-type {
    border-bottom: none;
}

/* label 区域 */
.gb-label {
    width: 26%;
    min-width: 160px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    line-height: 1.6;
}

/* 右侧字段区域 */
.gb-field {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: #333;
}

/* 必填标记 */
.gb-required {
    color: #e45a4f;
    margin-left: 4px;
    font-weight: 600;
}

/* 通用 input / textarea / select 样式 */
.gb-field input[type="text"],
.gb-field input[type="email"],
.gb-field input[type="tel"],
.gb-field input[type="number"],
.gb-field textarea,
.gb-field select,
#gb-content {
    width: 100%;
    max-width: 100%;
    padding: 9px 11px;
    border-radius: 6px;
    border: 1px solid #d3d7e5;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.gb-field input:focus,
.gb-field textarea:focus,
.gb-field select:focus,
#gb-content:focus {
    outline: none;
    border-color: #0072ce;
    box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.15);
}

/* textarea 高度 */
#gb-content,
.gb-field textarea {
    min-height: 140px;
    resize: vertical;
}

/* 单行选项（需要联系：是/否） */
.gb-inline-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 14px;
}

.gb-inline-options label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* 姓名：两个 input 并排 */
.gb-name-flex {
    display: flex;
    gap: 10px;
}

.gb-name-flex input {
    flex: 1;
}

/* 验证码行：输入 + 按钮 + 状态 */
.gb-code-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.gb-code-row input[type="text"] {
    width: 140px;
    flex: 0 0 auto;
}

/* 获取验证码按钮 */
#btn-send-mobile-code {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #0072ce, #005bb2);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(0, 91, 178, 0.35);
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}

#btn-send-mobile-code:hover {
    opacity: 0.95;
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(0, 91, 178, 0.3);
}

#btn-send-mobile-code:active {
    transform: translateY(2px);
    box-shadow: 0 2px 6px rgba(0, 91, 178, 0.25);
}

/* 验证码状态文字 */
#mobile-code-status {
    font-size: 12px;
}

/* 图片上传区域 */
#gb-image-uploader {
    margin-bottom: 10px;
}

/* 选择图片按钮 */
#gb-btn-select-images {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid #c5d1e8;
    background-color: #f5f8ff;
    font-size: 13px;
    font-weight: 500;
    color: #34508a;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

#gb-btn-select-images:hover {
    background-color: #e4edff;
    border-color: #a9bbdf;
}

/* 图片预览列表：PC 端 4 列 */
#gb-image-preview-list {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

/* 每一个缩略图 */
.gb-image-item {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 比例 */
    background-color: #f5f5f7;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.gb-image-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 删除按钮 */
.gb-image-del {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gb-image-del:hover {
    background: rgba(0, 0, 0, 0.75);
}

/* 图片上传说明文字 */
.gb-tips {
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* 提交按钮区域 */
.gb-submit {
    margin-top: 26px;
    text-align: center;
}

/* 提交按钮 */
.gb-btn-submit {
    min-width: 260px;
    padding: 13px 40px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #0072ce, #005bb2);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(0, 91, 178, 0.38);
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}

.gb-btn-submit:hover {
    opacity: 0.96;
    transform: translateY(1px);
    box-shadow: 0 10px 22px rgba(0, 91, 178, 0.35);
}

.gb-btn-submit:active {
    transform: translateY(2px);
    box-shadow: 0 5px 12px rgba(0, 91, 178, 0.3);
}

/* 成功弹窗（需要你在模板里加相应 HTML） */
.gb-success-mask {
    position: fixed;
    inset: 0;
    display: none; /* JS 改成 flex 显示 */
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
}

.gb-success-modal {
    position: relative;              /* ★ 新增：作为 X 的定位容器 */
    width: 90%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 20px;
    padding: 26px 22px 22px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    box-sizing: border-box;
}

/* 图标基础样式（默认用灰色） */
.gb-success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #999999;   /* 提交中：中性灰，不要用成功绿 */
    color: #ffffff;
    font-size: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 真正成功时的绿色对勾 */
.gb-success-icon-success {
    background: #28a745;
}
/* （可选）提交中状态的样式，如果以后想做动画可以挂这个类 */
.gb-success-icon-loading {
    background: #999999;
}



.gb-success-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.gb-success-text {
    font-size: 13px;
    line-height: 1.8;
    color: #666;
    margin-bottom: 18px;
}


.gb-success-btn {
    display: inline-block;
    min-width: 200px;
    padding: 9px 22px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #0072ce, #005bb2);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(0, 91, 178, 0.35);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
    min-width: 140px;
    padding: 8px 18px;
}

.gb-success-btn:hover {
    opacity: 0.96;
    transform: translateY(1px);
    box-shadow: 0 8px 18px rgba(0, 91, 178, 0.3);
}

.gb-success-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 10px rgba(0, 91, 178, 0.25);
}

/* ====== 响应式调整 ====== */

@media (max-width: 959px) {
    .gb-inner {
        padding: 24px 18px 30px;
        border-radius: 18px;
    }
}

@media (max-width: 768px) {
    .gb-row {
        flex-direction: column;
        gap: 8px;
    }

    .gb-label {
        width: 100%;
        min-width: 0;
    }

    #gb-image-preview-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    #gb-image-preview-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gb-btn-submit {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 420px) {
    #gb-image-preview-list {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}


/* 次级按钮（关闭）可以稍微淡一点，可选 */
.gb-success-btn.gb-success-btn-secondary {
    background-color: linear-gradient(135deg, #0072ce, #005bb2);
    color: #ffffff;
    border: 1px solid #007bff;
}


/* 提交成功后，本页只读模式 */
#guestbook-form.gb-form-disabled .gb-field input,
#guestbook-form.gb-form-disabled .gb-field textarea,
#guestbook-form.gb-form-disabled .gb-field select {
    background-color: #f5f5f5;
    color: #666;
}

#guestbook-form.gb-form-disabled .gb-submit-btn,
#guestbook-form.gb-form-disabled button[type="submit"] {
    opacity: 0.6;
    cursor: default;
}

.guestbook-my-page {
    max-width: 1220px;
    margin: 40px auto;
}

.gb-my-title {
    font-size: 22px;
    margin-bottom: 20px;
}



.gb-my-list .gb-my-item {
    border: 1px solid #eee;
    padding: 12px 15px;
    margin-bottom: 12px;
    border-radius: 4px;
    background: #fff;
}

.gb-my-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.gb-my-meta .status {
    margin-left: 8px;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.status-replied {
    background: #e6f5ff;
    color: #007bff;
}

.status-wait {
    background: #fff3cd;
    color: #856404;
}

.gb-my-content .title {
    font-weight: bold;
    margin-bottom: 4px;
}

.gb-my-empty {
    margin-top: 20px;
    color: #666;
}
/* guestbook 成功弹窗：按钮同一行 */
.gb-success-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 12px;
}



/* 右上角 X，保证能看见 */
.gb-success-dialog {
    position: relative;
}

.gb-success-close {
    position: absolute;
    right: 14px;
    top: 12px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    font-size: 20px;
    line-height: 1;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;                     /* 确保盖在内容上面 */
}

.gb-success-close:hover {
    background: rgba(0, 0, 0, 0.10);
}





/* 只读时的视觉效果 */
.gb-field input.gb-readonly,
.gb-field textarea.gb-readonly,
.gb-field select.gb-readonly,
#gb-content.gb-readonly {
    background-color: #f3f4f8;
    color: #777;
    cursor: not-allowed;
}

/* 禁用的按钮 */
button.gb-readonly,
input[type="submit"].gb-readonly {
    cursor: not-allowed;
    opacity: 0.7;
}


/* 单个元素被 JS 标记为 gb-readonly 时的灰色样式 */
.gb-readonly {
    background-color: #f5f5f5 !important;
    color: #666 !important;
}

.gb-readonly[disabled],
input[type="submit"].gb-readonly,
button.gb-readonly {
    opacity: 0.7;
    cursor: not-allowed;
}


/* ===== 我的留言（guestbook-my） ===== */

.guestbook-my-page {
    max-width: 1220px;
    margin: 40px auto;
}

/* 标题 */
.gb-my-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* 登录区域 */
.gb-my-login {
    padding: 18px 20px;
    margin-bottom: 26px;
    background: #f7f9ff;
    border-radius: 10px;
    border: 1px solid #d5e0f5;
}

.gb-my-tip {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

.gb-my-login .gb-my-tip span {
    font-weight: 600;
    color: #005bb2;
}
/* 我的留言登录：联系方式行（输入 + 按钮 + 状态） */
.gb-my-login .gb-contact-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* intl-tel-input 会包一层 .iti，这里让它和普通 input 一样可伸缩 */
.gb-my-login .gb-contact-row .iti,
.gb-my-login .gb-contact-row input[type="text"],
.gb-my-login .gb-contact-row input[type="email"],
.gb-my-login .gb-contact-row input[type="tel"] {
    flex: 1 1 280px;
    width: auto;
}

.gb-my-login .gb-contact-row .iti input[type="tel"] {
    width: 100%;
}

#login-mobile-status,
#login-email-status {
    font-size: 12px;
    color: #888;
}

/* 登录成功后显示的当前联系方式 */
.gb-my-current-contact {
    padding: 12px 16px;
    margin-bottom: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #c5d4eb;
    font-size: 14px;
    color: #444;
}

.gb-my-contact-item {
    font-weight: 600;
    color: #005bb2;
}

.gb-my-tip-small {
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

/* 列表卡片 */
.gb-my-list .gb-my-item {
    border: 1px solid #e3e7f0;
    padding: 12px 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #fff;
}

/* 顶部 meta 行：时间 + 状态 */
.gb-my-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.gb-my-meta .time {
    margin-right: 8px;
}

.gb-my-meta .no {
    margin-left: 8px;
    color: #aaa;
}

.gb-my-meta .status {
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.status-replied {
    background: #e6f5ff;
    color: #007bff;
}

.status-wait {
    background: #fff3cd;
    color: #856404;
}

/* 内容区 */
.gb-my-content .title {
    font-weight: 600;
    margin-bottom: 4px;
}

.gb-my-content .content {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
}

/* 回复块 */
.gb-my-reply {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e0e4ef;
}

.gb-my-reply .reply-label {
    font-size: 13px;
    font-weight: 600;
    color: #005bb2;
    margin-bottom: 4px;
}

.gb-my-reply .reply-content {
    font-size: 14px;
    color: #333;
    line-height: 1.8;
}

/* 空状态 */
.gb-my-empty {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

/* 验证码登录里的按钮，复用主表单的风格 */
#btn-send-guestbook-login-code,#btn-send-guestbook-login-code-mobile,
#btn-send-guestbook-login-code-email {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #0072ce, #005bb2);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(0, 91, 178, 0.35);
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}

#btn-send-guestbook-login-code:hover {
    opacity: 0.95;
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(0, 91, 178, 0.3);
}

#btn-send-guestbook-login-code:active {
    transform: translateY(2px);
    box-shadow: 0 2px 6px rgba(0, 91, 178, 0.25);
}

#login-code-status {
    font-size: 12px;
    color: #888;
}
/* 我的留言：正文下面的图片列表（4 张一行，4:3，图片完整显示&可变形） */
.guestbook-my-page .gb-my-images {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* 每个缩略图容器：一行 4 个，统一 4:3 */
.guestbook-my-page .gb-my-images .gb-image-item {
    flex: 0 0 calc(25% - 9px);   /* 一行 4 个 */
    box-sizing: border-box;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e7f3;
    background: #fff;

    /* 覆盖上传区的 padding-top:75%，改成真正的 4:3 容器 */
    padding-top: 0;
    aspect-ratio: 4 / 3;
    position: relative;
}

/* 链接和图片占满整个 4:3 容器 */
.guestbook-my-page .gb-my-images .gb-image-item a,
.guestbook-my-page .gb-my-images .gb-image-item img {
    display: block;
    width: 100%;
    height: 100%;
}

/* 覆盖上传预览那边对 img 的绝对定位 & 裁剪 */
.guestbook-my-page .gb-my-images .gb-image-item img {
    position: static;
    object-fit: fill;  /* 允许拉伸，完整显示整张图 */
}
/* intl-tel-input 宽度适配 */
.gb-field .iti { width: 100%; }
.gb-field .iti input { width: 100%; box-sizing: border-box; }
