/* =================================================================
   友情链接合作页样式
   v3.0 - 仅重做页面视觉与响应式布局，不改变申请/换链业务逻辑
   ================================================================= */

:root {
    --primary: #5b5df0;
    --primary-strong: #4648d8;
    --primary-soft: #eef0ff;
    --accent: #7c3aed;
    --text: #1f2937;
    --text-soft: #667085;
    --text-faint: #98a2b3;
    --surface: #ffffff;
    --surface-soft: #f8f9fc;
    --border: #e4e7ec;
    --success: #16824a;
    --success-bg: #ecfdf3;
    --success-border: #abefc6;
    --error: #b42318;
    --error-bg: #fef3f2;
    --error-border: #fecdca;
    --warning: #b54708;
    --warning-bg: #fffaeb;
    --warning-border: #fedf89;
    --radius-lg: 24px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #f5f6fb;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(circle at 12% 0%, rgba(91, 93, 240, 0.15), transparent 32rem),
        radial-gradient(circle at 88% 8%, rgba(124, 58, 237, 0.11), transparent 28rem),
        linear-gradient(180deg, #f7f8fd 0%, #f2f4f8 100%);
}

button,
input {
    font: inherit;
}

.page-shell {
    width: 100%;
    padding: 48px 20px 64px;
}

.link-container {
    width: min(860px, 100%);
    margin: 0 auto;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(228, 231, 236, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* =========================
   顶部品牌区
   ========================= */
.link-hero {
    position: relative;
    padding: 36px 40px 28px;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(135deg, rgba(91, 93, 240, 0.08), rgba(124, 58, 237, 0.02) 54%, rgba(255, 255, 255, 0.8));
}

.link-hero::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    right: -100px;
    top: -130px;
    border-radius: 50%;
    background: rgba(91, 93, 240, 0.08);
    pointer-events: none;
}

.hero-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 24px;
}

.hero-logo-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    min-height: 78px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.hero-logo {
    display: block;
    max-width: 118px;
    max-height: 54px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.hero-copy {
    min-width: 0;
}

.hero-eyebrow,
.section-kicker {
    display: inline-block;
    color: var(--primary);
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.hero-copy h1 {
    margin: 8px 0 8px;
    color: #101828;
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.18;
    letter-spacing: -0.03em;
}

.hero-copy p {
    max-width: 560px;
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.75;
}

.rule-banner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 26px;
    padding: 14px 16px;
    color: #7a2e0e;
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 12px;
}

.rule-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 50%;
    background: #f79009;
    box-shadow: 0 0 0 4px rgba(247, 144, 9, 0.12);
}

.rule-banner strong,
.rule-banner span {
    display: block;
}

.rule-banner strong {
    margin-bottom: 3px;
    font-size: 13px;
}

.rule-banner span {
    color: #93370d;
    font-size: 13px;
    line-height: 1.65;
}

/* =========================
   页签导航
   ========================= */
.link-header {
    padding: 14px 18px 0;
    background: var(--surface);
}

.link-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 6px;
    margin: 0;
    background: var(--surface-soft);
    border: 1px solid #eef0f4;
    border-radius: 15px;
}

.link-nav a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 68px;
    padding: 10px 16px;
    color: var(--text-soft);
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 11px;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    cursor: pointer;
}

.link-nav a:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.72);
}

.link-nav a.active {
    color: var(--primary-strong);
    background: #fff;
    border-color: rgba(91, 93, 240, 0.16);
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.07);
}

.nav-title {
    font-size: 15px;
    font-weight: 750;
}

.link-nav small {
    margin-top: 4px;
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 400;
}

.link-nav a.active small {
    color: #7f82ad;
}

/* =========================
   内容与表单
   ========================= */
.link-content {
    padding: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-box {
    display: none;
    padding: 34px 40px 40px;
    animation: fadeIn .24s ease-out;
}

.content-box.active-page {
    display: block;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.section-heading h2 {
    margin: 7px 0 7px;
    color: #101828;
    font-size: 23px;
    line-height: 1.28;
    letter-spacing: -0.02em;
}

.section-heading p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.7;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.required {
    color: #d92d20;
}

.optional {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    color: #667085;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    background: #f2f4f7;
    border-radius: 999px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="password"] {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    color: #101828;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.form-group input:hover {
    border-color: #b4bac5;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 93, 240, 0.10);
}

.form-group input::placeholder {
    color: #a4aab4;
}

.field-hint {
    display: block;
    margin-top: 7px;
    color: var(--text-faint);
    font-size: 11px;
    line-height: 1.55;
}

.logo-card {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 6px 0 24px;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9ff, #fbfbfd);
    border: 1px dashed #cfd2ff;
    border-radius: var(--radius-md);
}

.logo-card-preview {
    position: relative;
    flex: 0 0 170px;
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 14px 14px;
    background: #fff;
    border: 1px solid #e2e5ea;
    border-radius: 12px;
}

.logo-card-preview img {
    display: block;
    max-width: 138px;
    max-height: 54px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo-card-label {
    position: absolute;
    top: 7px;
    left: 10px;
    color: var(--text-faint);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
}

.logo-card-copy {
    min-width: 0;
}

.logo-card-copy strong {
    display: block;
    margin-bottom: 5px;
    color: #344054;
    font-size: 14px;
}

.logo-card-copy p {
    margin: 0;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.65;
}

.form-actions {
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 11px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, opacity .18s ease;
}

.btn:disabled {
    opacity: .58;
    cursor: not-allowed;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 9px 20px rgba(91, 93, 240, 0.20);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(91, 93, 240, 0.26);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
}

.submit-note {
    margin: 10px 0 0;
    color: var(--text-faint);
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
}

/* =========================
   AJAX 消息与复制组件
   ========================= */
.message-container {
    padding: 0 40px;
}

.message {
    display: none;
    margin: 26px 0 -8px;
    padding: 15px 16px;
    font-size: 13px;
    line-height: 1.65;
    border: 1px solid transparent;
    border-radius: 12px;
}

.message.success {
    color: var(--success);
    background: var(--success-bg);
    border-color: var(--success-border);
}

.message.error {
    color: var(--error);
    background: var(--error-bg);
    border-color: var(--error-border);
}

.link-copy-wrapper {
    display: flex;
    align-items: stretch;
    margin-top: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(22, 130, 74, 0.22);
    border-radius: 10px;
}

.link-copy-wrapper input[type="text"] {
    min-width: 0;
    flex: 1 1 auto;
    padding: 10px 12px;
    color: #155eef;
    background: #fff;
    border: 0;
    outline: 0;
    font-size: 12px;
    font-weight: 600;
}

.btn-copy {
    flex: 0 0 auto;
    min-width: 76px;
    padding: 0 15px;
    color: #fff;
    background: var(--success);
    border: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: background-color .18s ease;
}

.btn-copy:hover {
    background: #116b3d;
}

/* =========================
   响应式
   ========================= */
@media (max-width: 720px) {
    .page-shell {
        padding: 20px 12px 32px;
    }

    .link-container {
        border-radius: 18px;
    }

    .link-hero {
        padding: 26px 22px 22px;
    }

    .hero-brand {
        align-items: flex-start;
        gap: 16px;
    }

    .hero-logo-wrap {
        width: 112px;
        min-height: 66px;
        padding: 11px 12px;
        border-radius: 14px;
    }

    .hero-logo {
        max-width: 88px;
        max-height: 44px;
    }

    .hero-copy p {
        font-size: 13px;
    }

    .content-box {
        padding: 28px 22px 32px;
    }

    .message-container {
        padding: 0 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .logo-card {
        align-items: stretch;
    }

    .logo-card-preview {
        flex-basis: 145px;
    }
}

@media (max-width: 520px) {
    .page-shell {
        padding: 0;
    }

    .link-container {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .link-hero {
        padding: 24px 18px 20px;
    }

    .hero-brand {
        display: block;
    }

    .hero-logo-wrap {
        width: fit-content;
        min-width: 116px;
        margin-bottom: 18px;
    }

    .hero-copy h1 {
        font-size: 28px;
    }

    .rule-banner {
        margin-top: 20px;
    }

    .link-header {
        padding: 12px 12px 0;
    }

    .link-nav {
        gap: 6px;
        padding: 5px;
    }

    .link-nav a {
        min-height: 60px;
        padding: 8px 7px;
    }

    .nav-title {
        font-size: 14px;
    }

    .link-nav small {
        font-size: 10px;
    }

    .content-box {
        padding: 26px 18px 30px;
    }

    .message-container {
        padding: 0 18px;
    }

    .section-heading {
        margin-bottom: 24px;
    }

    .section-heading h2 {
        font-size: 21px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .logo-card {
        display: block;
        padding: 14px;
    }

    .logo-card-preview {
        width: 100%;
        min-height: 82px;
        margin-bottom: 13px;
    }

    .logo-card-copy {
        text-align: center;
    }

    .message {
        margin-top: 20px;
    }

    .link-copy-wrapper {
        display: block;
    }

    .link-copy-wrapper input[type="text"] {
        width: 100%;
    }

    .btn-copy {
        width: 100%;
        min-height: 40px;
    }
}
