/* 自建申请表单 */
.af { border: 1px solid var(--line); padding: 50px 54px 54px; position: relative; }

.af-part { border: 0; margin: 0 0 54px; padding: 0; min-width: 0; }
.af-part legend { display: flex; align-items: baseline; gap: 14px; width: 100%; padding: 0 0 16px; margin-bottom: 30px; border-bottom: 1px solid var(--line); font-family: var(--serif-zh); font-size: 22px; font-weight: 600; letter-spacing: 2px; }
.af-part legend em { margin-left: auto; font-family: var(--serif-en); font-style: italic; font-weight: 400; font-size: 17px; letter-spacing: 1px; color: var(--muted); }
.af-no { font-family: var(--serif-en); color: var(--gold); font-weight: 500; font-size: 20px; min-width: 26px; }

.af-row { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }
.af-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 30px; min-width: 0; position: relative; }
.af-field > label, .af-label { font-size: 13px; letter-spacing: 2px; color: var(--muted); }
.af-field i { font-style: normal; color: var(--gold); }
.af-field small { letter-spacing: 1px; color: #6e6a61; margin-left: 6px; }

.af input[type=text], .af input[type=tel], .af input[type=email], .af input[type=url], .af input[type=number], .af select, .af textarea {
    background: transparent; border: 0; border-bottom: 1px solid rgba(233,229,220,.28); border-radius: 0;
    color: var(--text); padding: 11px 0; font-size: 16px; font-family: inherit; width: 100%; transition: border-color .25s;
}
.af textarea { resize: vertical; min-height: 130px; line-height: 1.7; }
.af input::placeholder, .af textarea::placeholder { color: #6e6a61; }
.af input:focus, .af select:focus, .af textarea:focus { outline: none; border-bottom-color: var(--gold); }
.af select { appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
    background-position: calc(100% - 10px) 50%, calc(100% - 5px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.af select option { background: var(--ink-2); color: var(--text); }
.af input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
.af input[type=number] { -moz-appearance: textfield; }
.af-count { position: absolute; right: 0; bottom: -22px; font-size: 12px; color: #6e6a61; }
.af-hint { font-size: 12px; color: #6e6a61; letter-spacing: .5px; }

/* 选项胶囊 */
.af-chips { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.af-chips label { cursor: pointer; }
.af-chips input { position: absolute; opacity: 0; pointer-events: none; }
.af-chips span { display: inline-block; padding: 8px 18px; border: 1px solid rgba(233,229,220,.22); font-size: 14px; letter-spacing: 1px; color: var(--text); transition: all .2s; }
.af-chips label:hover span { border-color: var(--gold-soft); }
.af-chips input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.af-chips input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 照片上传 */
.af-drop { display: flex; align-items: center; gap: 18px; padding: 26px; border: 1px dashed rgba(233,229,220,.3); cursor: pointer; transition: border-color .2s, background .2s; }
.af-drop:hover, .af-drop.drag { border-color: var(--gold); background: rgba(217,196,122,.05); }
.af-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.af-drop:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.af-drop-plus { font-family: var(--serif-en); font-size: 44px; line-height: 1; color: var(--gold); }
.af-drop-text { font-size: 15px; letter-spacing: 1px; }
.af-drop-text small { display: block; margin: 2px 0 0; color: #6e6a61; font-size: 12px; }
.af-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.af-thumbs:empty { display: none; }
.af-thumb { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--ink-2); margin: 0; }
.af-thumb img { width: 100%; height: 100%; object-fit: cover; }
.af-thumb button { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(14,13,18,.75); color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; }
.af-thumb figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: 11px; color: rgba(255,255,255,.8); background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 确认 */
.af-confirm { margin-bottom: 36px; }
.af-check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 14px; cursor: pointer; }
.af-check input { margin-top: 5px; accent-color: var(--gold); flex-shrink: 0; width: 16px; height: 16px; }
.af-check a { color: var(--gold); }

/* 错误提示 */
.af-field.invalid > label, .af-field.invalid .af-label { color: #ff8a80; }
.af-field.invalid input, .af-field.invalid textarea { border-bottom-color: #ff8a80; }
.af-field.invalid .af-chips span, .af-field.invalid .af-drop { border-color: rgba(255,138,128,.6); }
.af-check.invalid { color: #ff8a80; }
.af-err { font-size: 12px; color: #ff8a80; letter-spacing: .5px; }

.af-submit { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.af-btn { font-family: inherit; cursor: pointer; padding: 16px 52px; font-size: 15px; letter-spacing: 3px; }
.af-btn:disabled { opacity: .6; cursor: not-allowed; }
.af .form-status { margin: 0; font-size: 14px; }
.af .form-status.error { color: #ff8a80; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 提交成功 */
.af-done { padding: 30px 0 0; }
.af-done .h-zh { font-size: clamp(28px, 3vw, 40px); margin: 14px 0 10px; }
.af-done p { color: var(--muted); }
.af-dump { margin-top: 26px; padding: 18px; background: var(--ink-2); border: 1px solid var(--line); font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; color: var(--muted); font-family: var(--sans); }
.af.sent .af-part, .af.sent .af-submit { display: none; }

@media (max-width: 860px) {
    .af { margin: 0 -20px; padding: 34px 20px 40px; border-left: 0; border-right: 0; }
    .af-row { grid-template-columns: 1fr; gap: 0; }
    .af-part legend { font-size: 20px; }
    .af-part legend em { font-size: 15px; }
    .af-chips span { padding: 8px 14px; }
    .af-btn { width: 100%; }
}
.af-thumb.no-preview img { display: none; }
.af-thumb.no-preview::before { content: '已选择 · 无法预览'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
