/* 全局重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    max-width: 600px;
    width: 100%;
    background: #fff;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin: 0 auto;
}

h1, h2, h3 {
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a2e;
}

/* 链接列表 */
.link-list {
    list-style: none;
    padding: 0;
}

.link-item {
    background: #f8f9fc;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: 1px solid #e9ecf0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.link-item:active {
    transform: scale(0.97);
    background: #eef0f4;
}

.link-title {
    font-size: 18px;
    font-weight: 500;
    color: #1e293b;
    flex: 1;
    margin-right: 10px;
}

.link-badge {
    background: #dbeafe;
    color: #2563eb;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.copy-badge {
    background: #fce7f3;
    color: #db2777;
}

.link-url {
    font-size: 14px;
    color: #64748b;
    word-break: break-all;
    flex-basis: 100%;
    margin-top: 4px;
}

.link-sort {
    font-size: 13px;
    color: #94a3b8;
    margin-left: 8px;
}

.admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-basis: 100%;
    justify-content: flex-end;
}

.admin-actions a {
    padding: 6px 14px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 14px;
    background: #e2e8f0;
    color: #334155;
    transition: background 0.2s;
}

.admin-actions .btn-edit {
    background: #dbeafe;
    color: #1d4ed8;
}

.admin-actions .btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.admin-actions a:hover {
    opacity: 0.8;
}

/* 表单 */
.form-box {
    background: #f1f5f9;
    padding: 18px 16px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.form-box div {
    margin-bottom: 12px;
}

.form-box label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 4px;
}

.form-box input[type="text"],
.form-box input[type="url"],
.form-box input[type="number"],
.form-box input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 16px;
    background: #fff;
    transition: border 0.2s;
}

.form-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.form-box button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 8px;
}

.form-box button:hover {
    background: #1d4ed8;
}

.form-box a {
    color: #64748b;
    text-decoration: none;
    font-size: 15px;
}

.footer {
    text-align: center;
    margin-top: 30px;
    font-size: 14px;
    color: #94a3b8;
}

.footer a {
    color: #3b82f6;
    text-decoration: none;
}

/* 手机适配增强 */
@media (max-width: 480px) {
    .container {
        padding: 16px 12px;
    }

    .link-item {
        padding: 14px 16px;
        flex-wrap: wrap;
    }

    .link-title {
        font-size: 17px;
    }

    .link-badge {
        font-size: 12px;
        padding: 2px 10px;
    }

    .admin-actions {
        justify-content: flex-start;
        margin-top: 6px;
    }
}