/* ============================================================
   友链提交系统 - 玻璃拟态风格
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-1: #1e293b;
    --text-2: #475569;
    --text-3: #94a3b8;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --radius: 20px;
    --radius-sm: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f1f5f9;
    color: var(--text-1);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    position: relative;
    overflow-x: hidden;
}

@keyframes floatBg {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.page-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-bottom: 40px;
}

.container {
    max-width: 580px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================================
   返回按钮（前台顶部）
   ============================================================ */
.page-top {
    display: flex;
    align-items: center;
    padding: 16px 0 8px;
    animation: fadeDown 0.5s ease both;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 50px;
    color: var(--text-1);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.back-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    text-decoration: none;
}

.back-btn:active {
    transform: translateX(0);
}

.back-btn svg {
    transition: transform 0.3s ease;
}

.back-btn:hover svg {
    transform: translateX(-2px);
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   首页Logo区
   ============================================================ */
.hero-section {
    text-align: center;
    padding: 20px 0 24px;
    animation: heroIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    margin-bottom: 16px;
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-1);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-3);
}

@keyframes heroIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   玻璃卡片
   ============================================================ */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 26px 24px;
    margin-bottom: 18px;
    animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   友链要求卡片（有背景，文字居中）
   ============================================================ */
.req-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 18px;
    animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.req-card-header {
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.req-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 10px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.req-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1);
}

.req-card-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 4px;
}

.req-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.req-item {
    text-align: center;
    padding: 12px 16px;
    background: rgba(129, 140, 248, 0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(129, 140, 248, 0.12);
    transition: all 0.3s ease;
    animation: reqItemIn 0.4s ease both;
}

.req-item:nth-child(1) { animation-delay: 0.15s; }
.req-item:nth-child(2) { animation-delay: 0.2s; }
.req-item:nth-child(3) { animation-delay: 0.25s; }
.req-item:nth-child(4) { animation-delay: 0.3s; }
.req-item:nth-child(5) { animation-delay: 0.35s; }
.req-item:nth-child(6) { animation-delay: 0.4s; }

.req-item:hover {
    background: rgba(129, 140, 248, 0.14);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.req-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-right: 8px;
    vertical-align: middle;
}

.req-text {
    font-size: 13px;
    color: var(--text-2);
    font-weight: 500;
    vertical-align: middle;
}

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

/* ============================================================
   域名获取区（搜索框样式）
   ============================================================ */
.fetch-section {
    margin-bottom: 22px;
}

.fetch-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 14px;
}

/* 搜索框容器：输入框和按钮融合 */
.fetch-search-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.fetch-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #fff;
}

.fetch-search-box .search-icon {
    color: var(--text-3);
    flex-shrink: 0;
    margin-right: 8px;
}

.fetch-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-1);
    outline: none;
    padding: 8px 0;
    font-family: inherit;
    min-width: 0;
}

.fetch-input::placeholder {
    color: var(--text-3);
}

.fetch-btn {
    flex-shrink: 0;
    padding: 10px 22px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.3);
}

.fetch-btn:hover:not(:disabled) {
    transform: scale(1.03);
    box-shadow: 0 5px 18px rgba(99, 102, 241, 0.4);
}

.fetch-btn:active:not(:disabled) {
    transform: scale(0.98);
}

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

.fetch-tip {
    margin-top: 12px;
    font-size: 12px;
    min-height: 16px;
    text-align: center;
    font-weight: 500;
}

.fetch-tip.tip-success { color: var(--success); }
.fetch-tip.tip-error { color: var(--danger); }
.fetch-tip.tip-info { color: var(--text-2); }

@keyframes tipIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.spin {
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   分割线
   ============================================================ */
.divider {
    display: flex;
    align-items: center;
    margin: 22px 0 24px;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

.divider span {
    padding: 0 16px;
}

/* ============================================================
   表单
   ============================================================ */
.form-group {
    margin-bottom: 18px;
    animation: fieldIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.form-group:nth-of-type(1) { animation-delay: 0.15s; }
.form-group:nth-of-type(2) { animation-delay: 0.2s; }
.form-group:nth-of-type(3) { animation-delay: 0.25s; }
.form-group:nth-of-type(4) { animation-delay: 0.3s; }
.form-group:nth-of-type(5) { animation-delay: 0.35s; }
.form-group:nth-of-type(6) { animation-delay: 0.4s; }

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 8px;
    padding-left: 4px;
}

.form-group label .required {
    color: var(--danger);
    margin-left: 3px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    font-size: 14px;
    color: var(--text-1);
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-3);
}

.form-group textarea {
    resize: vertical;
    min-height: 76px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* 输入框带预览 */
.input-with-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-with-preview input {
    flex: 1;
    min-width: 0;
}

.preview-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.preview-box:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.12);
}

.preview-box img {
    max-width: 38px;
    max-height: 38px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

.preview-placeholder {
    font-size: 10px;
    color: var(--text-3);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* 字段填充高亮 */
.field-highlight {
    animation: fieldPulse 1.5s ease;
}

@keyframes fieldPulse {
    0% { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); background: #eef2ff; }
    100% { border-color: #e2e8f0; box-shadow: none; background: #f8fafc; }
}

/* ============================================================
   提交按钮
   ============================================================ */
.btn-submit {
    width: 100%;
    padding: 15px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 50%, var(--accent) 100%);
    background-size: 200% 200%;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius);
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    font-family: inherit;
    animation: submitIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both, gradientShift 4s ease infinite;
}

@keyframes submitIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

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

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

.submit-wrap {
    margin-top: 24px;
}

/* ============================================================
   提示框
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    font-weight: 600;
    background: #fff;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    animation: alertIn 0.4s ease;
}

.alert-success { color: var(--success); }
.alert-error { color: var(--danger); }

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   页脚
   ============================================================ */
.footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-3);
    animation: fadeUp 0.5s ease 0.5s both;
}

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

/* ============================================================
   后台管理
   ============================================================ */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.admin-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 10px 0;
    animation: heroIn 0.6s ease both;
}

.admin-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-1);
}

.admin-header p {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 4px;
}

.stats-bar {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
}

.stat-item {
    flex: 1;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    animation: cardIn 0.5s ease both;
    text-align: center;
}

.stat-item:nth-child(1) { animation-delay: 0.05s; }
.stat-item:nth-child(2) { animation-delay: 0.1s; }
.stat-item:nth-child(3) { animation-delay: 0.15s; }
.stat-item:nth-child(4) { animation-delay: 0.2s; }

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.18);
}

.stat-item .num {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-1);
}

.stat-item .label {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 4px;
    font-weight: 600;
}

.table-wrap {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    animation: cardIn 0.6s ease 0.25s both;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background: #f8fafc;
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-2);
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-1);
    vertical-align: top;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: #f8fafc;
}

.site-name-cell {
    font-weight: 700;
    color: var(--text-1);
    font-size: 14px;
}

.site-url-cell {
    font-size: 12px;
    margin-top: 4px;
    word-break: break-all;
}

.site-url-cell a {
    color: var(--primary);
    text-decoration: none;
}

.site-url-cell a:hover {
    text-decoration: underline;
}

.preview-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.preview-row img {
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px;
}

.preview-logo {
    max-width: 36px;
    max-height: 36px;
}

.preview-ico {
    max-width: 20px;
    max-height: 20px;
}

.desc-cell {
    max-width: 220px;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
}

.meta-cell {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.8;
    font-weight: 500;
}

.time-cell {
    font-size: 12px;
    color: var(--text-3);
    white-space: nowrap;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-3);
    font-size: 14px;
    font-weight: 600;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 560px) {
    .container { padding: 0 14px; }
    .glass-card, .req-card { padding: 20px 18px; }
    .hero-title { font-size: 24px; }
    .hero-logo { width: 60px; height: 60px; border-radius: 16px; }
    .form-row { flex-direction: column; gap: 0; }
    .stats-bar { flex-direction: column; }
    .fetch-search-box { padding: 4px 4px 4px 16px; }
    .fetch-btn { padding: 9px 16px; font-size: 12px; }
    .input-with-preview { flex-direction: column; align-items: stretch; }
    .preview-box { width: 100%; height: 56px; }
    .preview-box img { max-width: 44px; max-height: 44px; }
}
